A robust test suite will run fast, be deterministic, and cover all essential code paths. Unfortunately, dependencies often get in the way of these goals. Sometimes, we can’t reliably test code while it’s integrated with other libraries or systems.
In this part of the book, we’re going to talk about test doubles, including mock objects. These allow you to tightly control the environment in which your tests run. The result will be faster, more reliable specs.