Home > Archive > Extreme Programming > April 2004 > Acceptance Testing questions
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Acceptance Testing questions
|
|
| Steve Jorgensen 2004-04-24, 6:33 pm |
| I'm having a bit of trouble grokking how to design Acceptance tests. What
would some FIT-style acceptance tests look like for, say, a time tracker
program, for instance?
Also, is there anything like FIT for Python, or could FIT be used directly to
test Python code in some way?
Thanks,
- Steve J.
| |
| Robert C. Martin 2004-04-24, 8:30 pm |
| On Sat, 24 Apr 2004 20:53:39 GMT, Steve Jorgensen
<nospam@nospam.nospam> wrote:
>I'm having a bit of trouble grokking how to design Acceptance tests. What
>would some FIT-style acceptance tests look like for, say, a time tracker
>program, for instance?
Can you give us a few requirements?
>
>Also, is there anything like FIT for Python, or could FIT be used directly to
>test Python code in some way?
I think there is a Python FIT that John Roth has built. I also think
he's had some success binding it to FitNesse.
-----
Robert C. Martin (Uncle Bob)
Object Mentor Inc.
unclebob @ objectmentor . com
800-338-6716
"Distinguishing between the author
and the writing is the essence of civilized debate."
-- Daniel Parker
| |
| John Roth 2004-04-24, 10:30 pm |
|
"Steve Jorgensen" <nospam@nospam.nospam> wrote in message
news:r1ll801r8nl5vd98t5p53eve27sek2sofp@
4ax.com...
> I'm having a bit of trouble grokking how to design Acceptance tests. What
> would some FIT-style acceptance tests look like for, say, a time tracker
> program, for instance?
As in the old recipe for stewed rabbit that starts
with: "first, catch a rabbit," the first thing is to write
the stories.
So if I have a story that says: "add employee",
I'd create a table that has the test employees,
one per line, and subclass ColumnFixture to
drive the actual logic that puts them in the
system. Then I'd probably want to check
that they're there, so I'd write a table that
verifies that, and subclass RowFixture to
hook into the appropriate collection (or data
base table, or whatever.)
> Also, is there anything like FIT for Python, or could FIT be used directly
to
> test Python code in some way?
There are two Fit implementations for Python. The one on
fit.c2.com got hit when RExec went away in release 2.2.3,
but it's a 3 line change in TypeAdapter to fix it. (just change
it to use exec().) I've forgotten whether there's a similar
problem in Fixture (same fix if there is.)
I've also got a version that's substantially more up to date -
in fact, I just got done bringing it up to the latest Java release
and making sure all the acceptance tests and spec tests that
Ward has defined to date work. I also put in a bit of work
documenting it - but there's a lot of wish list stuff in the doc.
Unfortunately, since I don't do sourceforge and don't have
a web site, it's nowhere to be found [sigh.] I may correct
one or more of those in the next month or so, but until then
if you want it I can zip it and mail it to you. The previous
version has been distributed to Ron Jeffries and Robert
Martin, so it may show up on Ron's site. (It's also not the
world's most sterling code example, but I haven't been in
the mood to do a ground up refactoring, especially since
I do want to keep it reasonably close to Ward's Java version.)
HTH
John Roth
>
> Thanks,
>
> - Steve J.
| |
| Steve Jorgensen 2004-04-25, 1:31 am |
| On Sat, 24 Apr 2004 21:10:53 -0400, "John Roth" <newsgroups@jhrothjr.com>
wrote:
>
>"Steve Jorgensen" <nospam@nospam.nospam> wrote in message
> news:r1ll801r8nl5vd98t5p53eve27sek2sofp@
4ax.com...
>
>As in the old recipe for stewed rabbit that starts
>with: "first, catch a rabbit," the first thing is to write
>the stories.
>
>So if I have a story that says: "add employee",
>I'd create a table that has the test employees,
>one per line, and subclass ColumnFixture to
>drive the actual logic that puts them in the
>system. Then I'd probably want to check
>that they're there, so I'd write a table that
>verifies that, and subclass RowFixture to
>hook into the appropriate collection (or data
>base table, or whatever.)
That goes right to one of the things I don't get. Given that adding an
empoyee is a persistent operation, how is the acceptance test set up? Use
mock objects for the data store? Point to a testing data store, and wipe it
each time before the tests?
Also, visually, what would the test you're talikg about would look like? A
column showing a few employee names to add, and another column showing the
same employee names read back out?
>to
>
>There are two Fit implementations for Python. The one on
>fit.c2.com got hit when RExec went away in release 2.2.3,
>but it's a 3 line change in TypeAdapter to fix it. (just change
>it to use exec().) I've forgotten whether there's a similar
>problem in Fixture (same fix if there is.)
>
>I've also got a version that's substantially more up to date -
>in fact, I just got done bringing it up to the latest Java release
>and making sure all the acceptance tests and spec tests that
>Ward has defined to date work. I also put in a bit of work
>documenting it - but there's a lot of wish list stuff in the doc.
>
>Unfortunately, since I don't do sourceforge and don't have
>a web site, it's nowhere to be found [sigh.] I may correct
>one or more of those in the next month or so, but until then
>if you want it I can zip it and mail it to you. The previous
>version has been distributed to Ron Jeffries and Robert
>Martin, so it may show up on Ron's site. (It's also not the
>world's most sterling code example, but I haven't been in
>the mood to do a ground up refactoring, especially since
>I do want to keep it reasonably close to Ward's Java version.)
Cool - thanks for the info, and I'll get back to you if I want you mail it to
me.
| |
| John Roth 2004-04-25, 8:31 am |
|
"Steve Jorgensen" <nospam@nospam.nospam> wrote in message
news:59gm80paon0iv691u9uatbbkjdc2uqd1lr@
4ax.com...
> On Sat, 24 Apr 2004 21:10:53 -0400, "John Roth" <newsgroups@jhrothjr.com>
> wrote:
>
What[color=darkred]
tracker[color=darkred]
>
> That goes right to one of the things I don't get. Given that adding an
> empoyee is a persistent operation, how is the acceptance test set up? Use
> mock objects for the data store? Point to a testing data store, and wipe
it
> each time before the tests?
You do both. You need a test data base (or whatever you're using,
like Prevalyar) that you can reset to a known state before running
the tests. Since data base access takes long enough that you can't
run a full suite while developing and maintain flow, you also need to
mock out the data base.
> Also, visually, what would the test you're talikg about would look like?
A
> column showing a few employee names to add, and another column showing the
> same employee names read back out?
Not exactly. I'd suggest visiting either fit.c2.com or www.fitnesse.org
for examples of tests.
In this case, you do two tables. The first table has the employee
specifics, one employee per row. You might have a column for the
employee name, a second for the job responsibility, a third for the
HR code and so forth. The fixture for this table is probably a subclass
of ColumnFixture.
Then you have a second table that is almost an exact duplicate. This
is most useful if you're testing add and delete logic, so you load the
data using one table, then drive your virtual UI to insert another
employee (using ActionFixture) and then use the second table to
check that the correct data exists.
John Roth
| |
| Robert C. Martin 2004-04-25, 10:32 am |
| On Sun, 25 Apr 2004 04:41:51 GMT, Steve Jorgensen
<nospam@nospam.nospam> wrote:
>On Sat, 24 Apr 2004 21:10:53 -0400, "John Roth" <newsgroups@jhrothjr.com>
>wrote:
>
>
>That goes right to one of the things I don't get. Given that adding an
>empoyee is a persistent operation, how is the acceptance test set up? Use
>mock objects for the data store? Point to a testing data store, and wipe it
>each time before the tests?
I often use a mock object for the data store; at least at first. I
like to get the test set up and passing before engaging a real
database.
>
>Also, visually, what would the test you're talikg about would look like? A
>column showing a few employee names to add, and another column showing the
>same employee names read back out?
Yes, that's pretty much it. There's an example at
http://fitnesse.org/FitNesse.PayrollTests.AddAndPayTest
This does a bit more than just adding and checking, but not much more.
If you want to see a full acceptance tests suite, you can look at:
http://fitnesse.org/FitNesse.SuiteAcceptanceTests
You can hit the 'suite' button and see all the tests run, or you can
go to each individual test, study them one at a time, and run them one
at a time.
-----
Robert C. Martin (Uncle Bob)
Object Mentor Inc.
unclebob @ objectmentor . com
800-338-6716
"Distinguishing between the author
and the writing is the essence of civilized debate."
-- Daniel Parker
| |
| John Roth 2004-04-27, 1:19 am |
|
"Robert C. Martin" <unclebob@objectmentor.com> wrote in message
news:0aul8099l0vs5fc3o1oea8nv3i5fbt1bf6@
4ax.com...
> On Sat, 24 Apr 2004 20:53:39 GMT, Steve Jorgensen
> <nospam@nospam.nospam> wrote:
>
What[color=darkred]
>
> Can you give us a few requirements?
>
directly to[color=darkred]
>
> I think there is a Python FIT that John Roth has built. I also think
> he's had some success binding it to FitNesse.
Old version, I'm afraid. I haven't gotten around to downloading
the latest version and building the new driver.
John Roth
> -----
> Robert C. Martin (Uncle Bob)
> Object Mentor Inc.
> unclebob @ objectmentor . com
> 800-338-6716
>
> "Distinguishing between the author
> and the writing is the essence of civilized debate."
> -- Daniel Parker
|
|
|
|
|