I recently heard of BDD and found it very similar to TDD.
Which of these two do you use (if any)?
and which are the pros and cons of each?
TDD is a development practice while BDD is a team methodology. In TDD, the developers write the tests while in BDD the automated specifications are created by users or testers (with developers wiring them to the code under test.) For small, co-located, developer-centric teams, TDD and BDD are effectively the same.
BDD is in a more readable format by every stakeholder since it is in English. Unlike TDD, test cases are written in programming languages such as Ruby and Java. BDD explains the behavior of an application for the end-user while TDD focuses on how functionality is implemented.
Behavior-driven development is pure agile Again, the user experience is at the center of it. BDD is pure agile in that test cases, like user stories, are written in a common language that can be understood by all development team members and business stakeholders.
Behavior-driven developmentBDD falls between TDD and ATDD as an Agile development technique. As with TDD, a developer defines a test, watches it fail on the current code version, then implements changes to achieve a pass result.
I'm very much of the BDD = TDD done properly camp. If you're doing TDD as originally described by Beck - and practised by many - then there is essentially no difference.
What BDD brings to the table is some interesting variants on the language used to describe the process. By using alternate terminology in the descriptions of the process and the tools BDD folk hope to encourage better practices - a laudable goal.
I've been doing TDD for so long now it's hard for me to judge whether this actually helps. I think (hope :-) I've already learned many of the lessons that BDD tools/language encourage so that they don't seem to provide much extra value to me. Of course YMMV - and I've not done a whole "real world" project using BDD tools - so I might be taking my personal experiments and extrapolating too far.
I'd guess that BDD tools/language may be more useful to folk being introduced to this way of approaching development - since they avoid the whole confusion with "test" being used in the more traditional sense. I've not done this myself yet - and would be interested if folk here have had any such experience.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With