Home » Agile » TDD vs. BDD or why can’t we all just get along?

About Dror Helper

Dror Helper

TDD vs. BDD or why can’t we all just get along?

I was listening to another good Hanselminuets podcast – Understanding BDD and NSpec with Matt Florence and Amir Rajan. As always it was a good an informative show. Towards the end of the show one of the interviewees (I think it was Amir) explained why BDD is much better than TDD…
 by djclear904
For those of you who does not know what I’m talking about – TDD is Test Driven Development (or design) and BDD is Behavior Driven Development. TDD is more “low level” talking about unit tests and integration tests and how to write code that test code while BDD is about specifications and behaviors.
In TDD we talk about Arrange Act Assert while in BDD we have Given When Then
Each methodology has its own frameworks that help write and run tests (or specifications) that make sure our code does what it meant to do.
Am I the only one that see a resemblance?
You might argue that one is better than the other till you blue in the face it does not change the fact that they are two sides of the same coin.
There are differences – BDD is more “high level” dealing with specifications and was intended to be used by domain experts as well as developers – although I’m yet to find the product manager that would write specifications. On the other side TDD is developer oriented and intended to be used by people who write and read code daily.
But regardless of these differences I don’t really see a reason why you should choose one over the other. I confess I use TDD and unit/integration tests in most of my projects but I do have several projects where I use both. I like the fact that I can write unit tests as well as specifications – because I need to test both. I also find myself using unit testing framework (i.e. NUnit) to write more “BDD’ish” kind of tests.
And so I don’t really understand why one is better than the other. Mainly because I prefer to use both – when possible.
And if you never tried BDD (or TDD) before I suggest you do and see for yourself.
Happy Coding…

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a sysadmin Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. Introduction to NGINX
2. Apache HTTP Server Cookbook
3. VirtualBox Essentials
4. Nagios Monitoring Cookbook
5. Linux BASH Programming Cookbook
6. Postgresql Database Tutorial
and many more ....
I agree to the Terms and Privacy Policy
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments