I already twitted about it but it’s worth repeating as I got the same discussion a couple of days ago. TDD and BDD are not the same thing but TDD and BDD frameworks are often the same thing.

TDD (Test Driven Development) is a programming methodology that produces unit tests. They automatically test units as in methods or functions. They’re a developer’s tool. BDD (Behavior Driven Development) is a programming methodology that produces behavioral tests also called automated tests. They automatically test the program’s behavior. They’re a tester and developer’s tool.

Both behavioral tests and unit tests are automated. That’s why most BDD frameworks and TDD frameworks are interchangeable. One example: Jasmine is a JavaScript BDD framework that can be used solely for TDD if you want to. It has a Gherkin-like syntax, used in BDD but is low-level enough to do TDD.

And nothing prevents you to use a xUnit framework to write and execute behavioral tests.

So that’s not because you’re using PHPUnit that you’re doing TDD and don’t call it BDD when you’re testing methods. Strictly speaking, you’re testing the methods’ behavior but it’s just confusing.

Oh and one last thing: (TDD != BDD) == true but (TDD > BDD) == false and (TDD < BDD) == false.

PS: Yes I know I misspelled “Potatoe” in the title here on purpose… Geez, it’s a reference to a Louis Amstrong’s song.