A stub is the simplest test pattern that we can use in our tests. Stubs typically implement a particular interface and don't contain any real logic; they just provide fixed answers to calls that are performed through the course of a test.
Let's dissect a short code example that illustrates how we can effectively use the concept of stubs for our tests. The Chapter04/captcha package implements the verification logic behind a CAPTCHA test.