Chapter 1. Exploring Test Doubles
"I never make stupid mistakes. Only very, very clever ones."
It is very difficult to find stupid mistakes, but it's even more daunting when you are trying to figure out the clever ones. Debugging an application to know how to fix a problem is very expensive and time-consuming. Automated unit tests provide an extremely effective mechanism for catching regressions, especially when combined with test-driven development; it creates a test safety net for the developers.
This chapter covers the concepts of unit testing, quality of unit tests, external dependencies, and test doubles.
The Working with unit tests section introduces you to test automation and describes the characteristics of a good unit test.