Interfaces as dependencies
As always, implementing and exploring unit testing techniques begins with exploring code writing techniques. This is a theme we will see regularly throughout this book. We cannot study testing in isolation. It requires insight into the code design and its intended purpose.
In this section, we will look at the concept of software dependencies and how to manage them. Figure 3.1 depicts the three main types of dependencies:
Figure 3.1 – Types of dependencies from the point of view of the UUT
From the viewpoint of the UUT, the four main types of dependencies are as follows:
- Direct internal dependencies: These contain internal functionality that your UUT imports. These dependencies could be defined in the same package or module as UUT, but are required to deliver its functionality.
- Transitive internal dependencies: These contain internal functionality that the Direct internal dependency parts of your UUT import. These...