Test/Behavior-driven development

Posted by Raymond Law Wed, 26 Mar 2008 02:50:00 GMT

I have done testing using the Rails testing framework (test-driven development) and also am looking at RSpec (behavior-driven development), so I asked Chad Fowler about his view on the two approaches. He told me the inventor of behavior-driven development said to him:

“You don’t need to do behavior-driven development because you already know behavior-driven development.”

Translation: TDD and BDD are basically the same thing. If you really understand what TDD is about, you are already doing BDD, regardless which testing framework you are using.

I also asked him how long it takes to do TDD/BDD versus w/o any testing. He answer:

“Negative twenty percent.”

A lot of existing projects don’t follow TDD/BDD and it is difficult/impossible to get involved in the middle and do that because development time is expected and it is less motivating when you are the only developer who writes tests.

Therfore, one thing I am determined to do from now on is that for my next Rails personal project, before I write any code, I will write a test to fail and then write code to make it pass.

Initially, it may take more time and getting used to, but hopefully it will cut down on debugging time and redesigning later on in the development process.

I’ve heard about TDD/BDD for quite some time and have also tried for some personal projects. But I think I will really force myself to strictly follow this paradigm, so I can get a real feel of how well it works.

Trackbacks

Use the following link to trackback from your own site:
http://blog.rayvinly.com/articles/trackback/57

Comments

Leave a response

Comments