This project is read-only.

BDD in Practice

Feb 28, 2008 at 9:39 PM
Edited Feb 28, 2008 at 9:40 PM
I've been trying to use BDD for a while but I'm having trouble getting my head around it, particularly how you guys use NBehaves stories in practice. So here's my question...

One of the things that most interests me about BDD and NBehave in particular is the idea of having higher level tests that show the overall behavior of a piece of the system. Seeing the discussion at your blog the advantage of defining the stories are:

-> Providing a more complete description of the behavior of the system
-> Unit tests too granular
-> Even specifications can be difficult to organize
-> Stories provide a better overall, macro view of the system

This really attracts me because I think that to get some of the advantages of TDD you need to test at lower levels but if you do this the specifications stop acting as good examples. I find this is especially true if there is a lot of interaction testing involved, A->B->C and there's interaction testing right down to C which also has some state tests. To work out the final behavior of A you've got to put in some serious effort.

So my question is how do you do use the story based tests to raise your understanding?

For example when you're writing the top level story based specifications how thorough do you make them. Do you only cover the most common cases using these stories then leave all the more detailed tests to unit tests or lower level specifications?

I'm coming to my own views on this but you guys are the experts on it so I'd be very interested in your views.