# Testing with Fakes: Why This Pays Off

Because the checkout service is handed its clock and its loan repository, a test can hand it a clock set to any day and loans kept in memory, so every late-fee rule and the five-book limit are checked in a few milliseconds, with no database and no waiting; this lesson writes those tests, names the kinds of stand-in (fakes, stubs and mocks), and says what they can't catch.

![Cheat sheet: Testing with Fakes: Why This Pays Off](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/0a5c641afa0444e295153a062c2c1fbc.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: Flaky Test, OOP, software-development, Stub and Fake, Test Double, Test Isolation
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-testing-with-fakes-cheat-sheet
