When TDD needs help
Explore the limitations of test-driven development in Rails applications. Understand when TDD alone is insufficient, including its challenges with acceptance testing and exploratory coding modes. Learn strategies like test-next mode, using test doubles, and balancing test coverage to maintain effective and efficient test design. This lesson helps you recognize when to adapt your approach beyond classic TDD for better application quality and design.
TDD limitations
Test-driven development is helpful, but it won’t solve all of the development problems by itself. There are areas where developer testing doesn’t apply or doesn’t work very well.
Application behavior
As mentioned in one case already: developer tests are not very good at determining whether the application behaves correctly according to requirements. Strict TDD is not great at acceptance testing. There are, however, automated tools that try to tackle acceptance testing. The most prominent are Capybara and Cucumber; (see Integration Testing with Capybara and Cucumber). Acceptance testing can be integrated with TDD. We’ll sometimes see this called outside-in testing. That’s a perfectly valid and useful test paradigm, but it’s an extension of the classic TDD process.
Application testing
Testing our application assumes that we know the right answer ...