BDD, TDD, and Everything Between
Behavior Driven Development, Test Driven Development, and Everything Between
What is TDD (Test Driven Development)
What is BDD (Behavior Driven Development)Behavior Driven Development assumes requirements may be vague (due to language barriers, a complicated domain, or other).
BDD builds on the Given - When - Then formula:
- Given a certain scenario
- When an action takes place
- Then this should happen
- As a role in the flow
- I want to perform an action
- So that the desired outcome will happen
Everything Between (Opinions, and Conclusions)As you can see, these are two seperate approches towards unit testing, and testing in general, While it seems like BDD requires a bit more code, this is only due to the nature of the framework, which enables the use of proper English. The output from the BDD approach will be much more readable. More over, this approach allows the stakeholders (and/or QA) to create their own scenarios, thus making sure we are testing what is needed, and not what we think id needed.
This approach eliminates the constant wondering of "What should be tested" as it is the QA and business side who decides that. It does (and will) prevent developers testing built-in methods such as .ToString() or performing tests for cases we're not interested in.
Elad Shalom, M.Sc
Director of R&D at InteliSys Aviation Systems