Simulating Time — Testing the Behavior That Only Happens Later
Some of the most consequential code in any system runs when nobody is deploying: renewals at midnight, trials expiring on day 14, tokens timing out, retries backing off, data retention sweeping on schedule. Testing it by waiting is absurd; testing it by mocking one clock call is fragile; testing it properly means making time itself a controllable dependency of the system under test — and that choice, it turns out, improves the architecture even before it improves the tests.
Time becomes testable as an injected dependency: audit its disguises (timeouts, backoffs, TTLs, expiries), drive schedules through clock-driven executors, simulate by scope — discrete-event clocks in-process, one-clock slices across services, simulation as a product feature for platforms. Calendar edges are shared fixtures.