Chapter 17. Testing

It’s not that Rails encourages you to do test-driven development, it’s that it makes it difficult for you to not do test-driven development.

Brian Eng, interviewed on the Rails podcast

Automated tests allow us to verify the functionality of our application, prevent regression (introduction of new and previously fixed bugs), and help us to keep our code flexible. Test coverage refers to the quality and number of automated tests that we have in relation to production code. When our test coverage is deficient, there is no proof that the system works as intended. We could change something that breaks the application, and not notice the failure until much time has passed, when it will be much more difficult to diagnose ...

Get The Rails Way now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.