IS Department

Specification Testing Example

Posted in Programming by Brian Russell on March 12, 2007

I have been interested in Behavior Driven Development/Design (BDD) for a while now.  It, along with Test Driven Development (TDD), seem like the way to go in order to create better software designs.  The added benefit you get of code coverage and a tightly woven safety net is even better.

I ran across this post on the AgileJoe blog.  Basically he runs down how to take a senerio and test it out.  I really liked the way he laid it out in a very readable and digestible way.

Another interesting point he made was that naming can really help the whole process from understanding the test all the way to reading the test output with the right tools:

It is important to note that BDD allows the context and specifications of the test to be easily shared.  The next steps would be to use the XML that NUnit produces and create a style sheet that will display the following information similar to AgileDox.

Person Validator Specifcation
– A person with information filled in
— should be inValid if the name is blank : passed
— should be inValid if the what ever date is greater than last year : passed
— should be inValid if at least one of the following fields is blank phone mobile email : passed

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: