What Is TDD Good For?

The primary purpose of test-driven development is to go beyond mere verification and use the tests to improve the code’s structure. That is, TDD is a software-development technique masquerading as a code-verification tool.

Automated tests are a wonderful way of showing that the program does what the developer thinks it does, but they are a lousy way of showing that what the developer thinks is what the program actually should do. “But the tests pass!” is not likely to be comforting to a customer when the developer’s assumptions are just flat-out wrong. I speak from painful experience.

The kinds of tests written in a TDD process are not a substitute for acceptance testing, where users or customers verify that the ...

Get Rails 4 Test Prescriptions 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.