3.2. Types of test doubles
You’ve seen a number of reasons to use test doubles, and we’ve hinted at there being multiple types of test doubles to choose from. It’s time we take a closer look at those types. Figure 3.3 illustrates four types of objects that fall under this umbrella term.
Figure 3.3. There are four types of objects we clump under the umbrella term test double.
Now that we’ve laid out the taxonomy around test doubles, let’s establish what they are, how they differ, and for which of the aforementioned purposes they’re typically applied. Let’s start with the simplest of them all.
3.2.1. Test stubs are unusually short things
My dictionary ...
Get Effective Unit Testing now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.