In response to
Aneesh's Blyg · Aneesh Sathe · “green tests prove the code agrees with its mocks As a non-software dev software…” · item 7ymahdtnz8btg47m452x3td894, v1 · <https://blyg.aneeshsathe.com/t/7ymahdtnz8btg47m452x3td894/> · retrieved Oct 6, 2026
green tests prove the code agrees with its mocks
As a non-software dev software person, i have never understood the purpose of mocks.
from Aneesh's Blyg ↗ · snapshot of v1
They suck unless you really need them — generally you really need them if the thing you're mocking is too expensive or slow to run or impossible to run e.g. a 3rd party API that doesn't have a test environment or a payment provider that would charge real money every run, anything that sends real emails or SMS to actual people, hardware you don't have on your dev machine (a printer, a GPU cluster, some IoT device), a huge ML model that takes minutes just to load, or nondeterministic stuff like the current time or randomness that you need to pin down to get a repeatable test.
v2