Chapter 2. The Test-Driven Development Process

In Chapter 1, Automated Testing, we were introduced to the unit test, and learned how it can help reduce the number of defects, catch regressions, and increase developer productivity by reducing the need to manually test and tinker with code. In this chapter we are going to turn our focus from testing to specification as we delve into test-driven development. Test-driven development (TDD) is a programming technique that moves unit tests to the front row, making them the primary entry point to production code. In test-driven development tests are written as specification before writing production code. This practice has a host of benefits, including better testability, cleaner interfaces, and improved ...

Get Test-Driven JavaScript Development 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.