Acceptance test spike example

John Roth newsgroups at jhrothjr.com
Sun Jun 26 20:13:18 EDT 2005


"Andrew McDonagh" <news at andrewcdonagh.f2s.com> wrote in message 
news:d9nfau$g2s$1 at news.freedom2surf.net...
> Steve Jorgensen wrote:
>> I'm posting this message for 2 reasons.
>>
>> First, I'm still pretty new and shakey to the whole Acceptance Testing 
>> thing,
>> and I'm hoping for some feedback on whether I'm on the right track. 
>> Second,
>> although all the Agile literature talks about the importance of doing
>> Acceptance Testing, there's very little in any of the books or out on the 
>> Web
>> that helps with how to do it.  If I am on the right track, this will be 
>> one
>> more helpful item folks can find on a Google search.
>>
>> The code below is basically a spike I wrote in a few hours last night to 
>> prove
>> to myself and my team that it would be feasible to quickly create a 
>> simple,
>> useful Acceptance Testing harness for our learning project.
>>
>> First, I wrote an example test script I would hope to be able to 
>> execute...
>>
>> ===============
>> ?recipeListCount:0
>> !new
>> ?name:"New Recipe"
>> name:"PB&J"
>> ?name:"PB&J"
>> !save
>> !close
>> ?recipeListCount:1
>> !goToListItem 1
>> !openListItem
>> ?name:"PB&J"
>> ===============
>>
>
> Snipped.
>
> Its best to aim the Acceptance Test at your Customers level of expertise, 
> not at the developers. As a Customer is the person best placed to tell us 
> What they want. Yes Our team people (Devs or testers) can help write the 
> actual tests, but the Customer should still be able to read them. After 
> all, the tests are Executable Requirements.
>
> There's two flavors of Customer oriented styles I've come across.
>
> The first uses a Domain Specific Language...eg using your values above..
>
> ---------------------------------
> IsTotalNumberOfRecipes 0
>
> ClickNewRecipeButton
> RecipeNameToUse  "PB&J"
> SaveNewRecipe
> CloseDialog
>
> IsTotalNumberOfRecipes 1
>
> IsThereOneRecipeCalled "PB&J"
> ---------------------------------
>
> All commands are the first full word. No need for special tokens to decide 
> what the command is supposed to do, as each Command is the name of a class 
> to use.
>
> You can use reflection to dynamically create the Command instances or the 
> name can be used by a factory as an id.
>
> The Commands themselves know what they are supposed to do, not the Script 
> parsing engine.
>
> The second approach is using FIT/Fitnesse - google these for exact 
> description. They take information in Table form. This allows the customer 
> to use any software to create the test scripts, so long as it can create 
> tables: Word processors, Spread Sheets, etc.

The Python version of FIT (currently at 0.7a2) can be found in the
file section of either the FitNesse Yahoo group or the ExtremeProgramming
Yahoo group. One of these days I'm going to get it on PyPi.

It's full featured, works both in batch and with FitNesse, and
includes most of FitLibrary.

There's a book coming out on FIT (FIT for Developing Software)
by Rick Mugridge and Ward Cunningham. It was supposed to be out
a week ago Friday, but B&N says it was delayed.

John Roth
PyFit

>
> Andrew 




More information about the Python-list mailing list