What is the Difference Between TDD and BDD?

This is a question asked many times: What is the difference between Test-Driven Development (TDD) and Behavior-Driven Development (BDD).

In my mind, I’ve accepted the following explanation:

Doing TDD, I write the code I want to have;
Doing BDD: I describe the behavior I need to have

I use both approches together: I start writing my tests in terms of GWT (Given-When-Then), describing
the behavior I need to have, and as I implement those individual steps I write the code I want to have.

This is the simplified explanation that works in my own mind, and it has taken many years for it to take that shape. It may not work to others, but I’m sticking with it for the time being, at least until I find a better way to explain it.

I sense there’ll be more posts coming up expending on this subject. 🙂

Advertisements

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: