thebeebs | BDD and C# – I Need your help
thebeebs
Zeroing the desk - Ignore the design
 
 

BDD and C# – I Need your help

by thebeebs 11. November 2009 07:32

Just read this blog on BDD seems very interesting as it addresses a problem that I’ve come across allot… understanding what a users wants and formalising it in a way that the user can understand and the developer can work too.

 

I had a brief look at some of the tools Cucumber etc and it seemed apparent that none of them would fit nicely into my actual development environment.

 

What I like about BDD mainly is the language so for the moment that's all I'm going to take from it.

I’ll write the following in my comments and use it as a base to craft my unit tests.

BDDTEsts

Now an immediate problem I can see is that my scenarios test allot more than I'd want to do in one test, so I'll need to create more than one unit test per scenario.

 

Has anyone worked with BDD in C#? am I missing something? Help my out with your comments.

Tags: ,

Comments (9) -

Michael
Michael United States
11/11/2009 4:33:05 PM #

Have you had a look at NGourd?

http://code.google.com/p/ngourd/

Adam Nowotny
Adam Nowotny Australia
12/11/2009 6:33:10 PM #

BDD style tests are better suited for testing interactions between objects or behavior of application as perceived by the user. Unit tests operate on more detailed view and test only a single class/method. I used StoryQ (http://www.codeplex.com/storyq) for BDD. It has a nice feature where you can start with text description as in your comments and then gradually add methods that describe a certain condition or action.

thebeebs
thebeebs United Kingdom
12/16/2009 1:30:50 AM #

Sure but since I'm using MVC I can test the controllers in a similar way to actual user interatction. Plus I can test any JS or view side logic directly in the unit test using something like teleriks WebUI test studio dlls.

So I can write a unit test that can check to see if a user hovers over a textbox that the textbox clears the text for example.

Although I'm using Unit tests i'm not atually using them to test single units of code, i'm using them to validate the BDD stories that I have discussed with the client.... I know it's hacky.

Thanks for the StoryQ link I'll take a look later today.

Stepan
Stepan Belarus
1/3/2010 6:53:26 AM #

You can take a loot at SpecFlow http://specflow.org/. It seems very easy to use and rather powerfull!

thebeebs
thebeebs United Kingdom
1/7/2010 11:15:44 PM #

@Stepan, Now that looks like something I can use. I much prefer the annotation approach compared with the lamda syntax of storyq.

Gregory Despain
Gregory Despain United States
8/7/2011 8:24:21 AM #

Zune and iPod: Most people compare the Zune to the Touch, but after seeing how slim and surprisingly small and light it is, I consider it to be a rather unique hybrid that combines qualities of both the Touch and the Nano. It's very colorful and lovely OLED screen is slightly smaller than the touch screen, but the player itself feels quite a bit smaller and lighter. It weighs about 2/3 as much, and is noticeably smaller in width and height, while being just a hair thicker.

stratford upon avon hotels
stratford upon avon hotels United States
9/5/2011 6:27:28 PM #

Hey this is a great post. Could you keep me updated with any other info similar to this? If travelling to the UK why not stay at Stratford hotel and watch a Shakespear play

Birmingham Airport Parking
Birmingham Airport Parking United States
9/7/2011 8:19:53 AM #

What a struggle to find Parking at Birmingham Airport.

Issac Maez
Issac Maez United States
10/21/2011 10:16:34 AM #

Save on your flight tickets and Accommodation - <A href="www.searchflightshotels.com">www.searchflightshotels.com</A>; I'm very satfised with the results so i thought of sharing it with you! My friends are already using it!

Comments are closed