Using Test Doubles to Remove Dependencies
Learn the advantages of test doubles with the help of a test, and the problems we might face when removing dependencies.
We'll cover the following...
If we don’t want to start at 20,000 feet with acceptance tests, test doubles are another way to get tests started without disrupting the untested code.
Test double advantages
In a legacy context, the advantage to using test doubles is their ability to isolate a single class and method from the rest of the application. When working with a legacy application, this allows us to temporarily put aside the issue of how shaky the rest of the application may be and focus on the single part we’re trying to figure out at that very moment.
In practice, this is similar to the test-double behavior-centric tests we saw in the chapter “ ...