Why Fakes Beat Mocks and Testcontainers
Summary
The article argues that mocks and Testcontainers can fail to reveal partial production failures and advocates for 'fakes'βin-memory implementations that can simulate arbitrary failure modes. It presents a practical pattern for swapping production and fake implementations via interfaces, explains when to fake, and cites industry examples of simulation-driven testing. The piece promotes moving toward simulation-driven development to improve test coverage and reliability.