Behavior-driven development (BDD)

Behavior-driven development appeared after TDD, with the mission of being a refined version of TDD. BDD focuses on the way tests are described (specs) and states that the tests should focus on the application requirements and not the test requirements. Ideally, this will encourage developers to think less about the tests themselves and think more about the entire application.

The original article in which the BDD principles were introduced by Dan North is available at http://dannorth.net/introducing-bdd/.

As we have already learned, Mocha and Chai provide APIs for both the TDD and BDD approaches. Later in this chapter, we will further explore these two approaches.

Recommending one of these methodologies is ...

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.