When TDD Needs Some Help

Test-driven development is very helpful, but it won’t solve all of your development problems by itself. There are areas where developer testing doesn’t apply or doesn’t work very well.

I mentioned one case already: developer tests are not very good at determining whether the application is behaving correctly according to requirements. Strict TDD is not great at acceptance testing. There are, however, automated tools that do try to tackle acceptance testing. Within the Rails community, the most prominent of these is Cucumber; see Chapter 10, ​Integration Testing with Capybara and Cucumber​. Cucumber can be integrated with TDD—you’ll sometimes see this called outside-in testing. That’s a perfectly valid ...

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.