Book Image

Learning Behavior-driven development with Javascript

Book Image

Learning Behavior-driven development with Javascript

Overview of this book

Table of Contents (17 chapters)
Learning Behavior-driven Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

TDD versus BDD


There are inherently two test-first approaches: Test Driven Development (TDD) and Behavior Driven Development (BDD). Some authors consider them to be the same thing, although I don't incline towards this view.

TDD is the earliest of the two approaches and actually only laid the foundations of the test-first cycle. This is not enough, since you can apply the technique at any level of abstraction and in a wide variety of granularity. I have done TDD with a bunch of totally different granularities: testing single classes in isolation, testing private methods, testing a "cluster of objects", and so on. Sometimes, these approaches have been successful, and sometimes not. The key to the success or failure of these tests was that, sometimes, I was testing the right thing, and at other times, I was testing something irrelevant, ending with tons of tests that did not say much about whether the system behaved correctly or not. Does it mean that TDD is wrong (or dead)? No, it just means...