exceptionz

Thoughts on Technology, Methodology and Programming.

Behavior-Driven Development Framework

Posted by Marcus Wyatt on 29 August 2006

NSpecify.Framework

Test-Driven Development has jumped the chasm to general acceptance. This is a good thing, but like Dave said in the Google video he presented, there are still a high percentage of people who practices Test-Driven Development badly.

On the other side of the coin, there is also people who is practicing Behavior-Driven Development while their doing Test-Driven Development.

So what is the difference?

In my opinion, most people think that Test-Driven Development is about Testing. When you explain that Test-Driven Development is really at its hart a design process, they squawk at you and give you a look like you have lost your mind.

I see Test-Driven Development performing the following roles:

  • Design process
  • Behavior Specification
  • Requirements Capturing
  • Regression Test Suite

For this reason I think we need a Behavior-Driven Development framework and NSpecify is an attempt to bridge this gap.

Here is an example of a Specification for a calculation domain object class:

using NSpecify.Framework;
 
namespace SampleBehaviour
{
  [ Functionality() ]
  public class Calculation
  {
    int one = 1;
    int two = 2;
 
    [ Specification() ]
    public void OnePlusOneMustEqualTwo()
    {
      Specify.That( one + one ).Must.Equal( two );
      Specify.That( two ).Must.Be.GreaterThan( one );
      Specify.That( two ).Must.Not.Equal( one );
    }
  }
}

If you would like to get a alpha release of the NSpecify.Framework and a NUnit install that integrates with NSpecify. You can download the framework and NUnit 2.2.8(.NET 2) or NUnit 2.4 Beta 1 (.NET 2) install.

 

tags: , ,

Currently listening to: Sea (PFM Mix) – Winamp *** 96. 10 – Saint Etienne – The Sea (PFM Mix)

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: