Outro

Refactoring to an interface is a key technique that should be in the toolbox of every developer.
Automocking, on the other hand, should be evaluated on a case by case basis: a mock-heavy testing approach often leads to high-maintenance test suites.
Nonetheless, it's important to play with it at least once, so that you can make an informed decision. That was the primary goal of this section!

What's next?

The next three sections will zoom on three different types of external dependencies: the filesystem, databases and HTTP APIs.
We'll look at a few techniques to perform full(er)-fidelity testing when the code under test interacts with this kind of systems.

Exercise

The exercise for this section is located in 03_mocks/06_outro