deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Outdata argues deterministic simulation testing is for every application, not just distributed systems

A blog post that reached Hacker News' front page argues that deterministic simulation testing applies to ordinary applications, pairing a deterministic core with a simulated environment for reproducible, time-compressed tests.

Outdata argues deterministic simulation testing is for every application, not just distributed systems

Deterministic simulation testing, generalized

An essay published on Outdata and dated 20 November 2026, which reached Hacker News' front page, makes a focused argument: deterministic simulation testing (DST), a technique usually attached to databases and distributed infrastructure, is a general-purpose method that ordinary applications can adopt. According to the post, the reason is structural. Every program, not only a distributed one, consists of a machine plus an environment, and both halves can be engineered for testability.

Why tests exist at all

The post opens with motivations rather than mechanics. We test to catch bugs before users find them, either reactively — writing a failing test that reproduces a known defect and keeping it as a regression guard — or defensively, anticipating where bugs are likely to appear. We also test to remove doubt: constantly second-guessing whether a feature can be added or a dependency removed creates decision fatigue, and machine-checked properties restore confidence.

A third motivation, obligation, receives shorter shrift. The author argues that test-driven development practised as external pressure produces tests that are numerous, brittle and of limited utility, and that the discipline evaporates once its internal champion leaves the organisation.

The anatomy of a test and what makes it useful

In the post's framing, every test has three parts: a system under test, the test logic (setup plus assertions), and a test seed that controls any random values. The seed is chosen randomly by default but can be overridden to replay a specific run.

Usefulness is then judged along three dimensions. Scope runs from a single function to an entire program, and only at larger scopes do the tested properties start corresponding to real-world requirements. Determinism decides whether a failure means anything at all: a flaky test cannot tell you whether a bug is actually fixed. Thoroughness separates hand-picked example inputs from declaratively described, randomly generated ones, which explore far more of the state space on every run.

Scored against these criteria, the familiar approaches each give something up, according to the post. End-to-end tests have wide scope but are almost never deterministic, because most systems perform IO internally. Unit tests are deterministic by convention but narrow. Property-based testing is thorough and typically deterministic, yet usually confined in scope. Black-box fuzzing is broad but deterministic only when the system under test is, and it cannot steer execution toward interesting states. DST is the outlier: it covers most of the program, is deterministic, and is thorough.

How DST actually works

DST combines two halves. The program under test becomes a deterministic machine — single-threaded or at least deterministically scheduled, with no direct IO calls — so the same inputs always produce the same state transitions. Everything the program touches in the outside world is simulated behind an interface: user IO, network IO, time and persistent storage. Randomness is allowed only when derived from the test seed, which keeps it reproducible. Simulation also enables controlled chaos: odd inputs, injected failures and unlikely coincidences can be turned up at will.

The test itself is typically its own executable. Given a seed, it loops against the simulated environment and checks the properties each iteration; when a property fails, it exits and reports the seed, making the error exactly reproducible. Because network and storage delays are simulated rather than real, the test never actually waits. Some implementations run like a game loop advancing in ticks, and the post illustrates the effect with a run that covers a month of simulated time in about an hour of real time, shrinking the interval before a latent bug surfaces.

Not only for infrastructure

The post acknowledges that DST evokes names like Dropbox, FoundationDB, TigerBeetle and Turso — projects built by teams with deep systems-engineering expertise. Its counterargument is that nothing in the technique depends on distribution: make the machine deterministic, define an interface so the environment can be simulated, and the same testing model applies to a plain application. For implementation details, the author points to an earlier article on structuring programs around a deterministic core.

Why it matters

If the argument holds, teams building unglamorous applications gain access to the one combination that other testing styles trade away: broad scope, full determinism and generated inputs. Failures become replayable by seed instead of intermittent, and long-horizon behaviour becomes testable in compressed time. Just as significantly, it reframes flakiness as an architectural decision — a consequence of how a program handles IO and scheduling — rather than an unavoidable nuisance of testing.

  • #testing
  • #deterministic-simulation
  • #software-engineering
  • #quality-assurance

Related posts