Until a couple of days, I didn’t know there was something called Behaviour-Driven Development (BDD). I realized and was quite impressed with how BDD can add value in combination with Test Driven Development (TDD). Below are the principles of BDD, copied from its home page.
- It is all behavior - Business and Technology should refer to the same system in the same way
- Where is the business value - Any system should have an identified, verifiable value to the business
- Enough is enough - Up-front analysis, design and planning all have a diminishing return
Theory is good but we understand concepts better with examples. In fact before I read about BDD at its home page I learnt how to do BDD when I read an article on “How I Learned to Love Testing” presentation, on Rails Envy. The presentation (a 30 minute quicktime movie) explains two aspects. The first aspect is why writing test code is important and how you can get to a mode from “I don’t like writing tests” to “I love testing”. The second aspect is on the BDD using the RSpec plugin for Rails. The concept is good and I really see a value, particularly the 1st principle which would help technical people start thinking and speaking in business terms throughout the development of a system. I am yet to try my hands on RSpec but based on the presentation and the links provided in the above article, I am keen on trying it soon on a project.