BDD vs. TDD
Eric Hodel | Tue, 25 Apr 2006 03:41:55 GMT
At both Canada on Rails and the Silicon Valley Ruby Conference I watched talks on Behavior Driven Development with RSpec, the former given by Dave Astels and the latter by Steven Baker. At SVRC one person asked why we need a new testing framework and Steven replied that BDD changes the way you think about TDD.
As I gained experience with TDD my failing test cases expressed the next piece of behavior I wanted my object to have. Learning how to do this took me about a year because I didn’t know how to think properly. BDD is designed to get you to think correctly about what you are testing, but it is hard to communicate how you should think about writing code.
With Test::Unit it is too easy to run off chasing edge cases that typically aren’t important. I did this back when I was new to testing and ended up with big, ugly tests that didn’t make my development much better. RSpec discourages edge-case chasing by expressing the tests at a higher level.
I think the only thing missing from the two presentations was a set of slides that show a small session of BDD like Steven displayed on classic TDD at Canada on Rails. The examples on the RSpec page are fully formed, so you can’t see the specification develop over time along with the code.
3 commentsComments 
Comments are disabled

Articles