As we have seen, testing part of the software when it doesn't depend on other parts of the same app is quite straightforward:
This is even easier if the class being tested is well-designed and has only a single well-defined responsibility. However, it's not common to have a class that depends on other classes, or, even more complicated, a class that depends on external collaborators, such as databases, a network service, or user input.
In the next section, we'll see a technique to test this scenario. The nomenclature we use is the one defined by Gerard Meszaros in his seminal bookXunit test Patterns,Chapter 11,Using Test Doubles, and now widely used in the industry.