Skip to content

Checks catalog

Every failure story ends with a check: an observable test that passes for the better design and fails for the obvious one. This catalog collects all 24 as test templates you can adapt.

They’re fitness functions: tests of an architectural guarantee rather than of a feature. Retrying one intent creates one booking. An incomplete snapshot closes nothing. The destination rejects a stale owner. A guarantee written as a test survives refactoring, framework upgrades and team changes; a guarantee written in a design document usually doesn’t.

Each check has:

Part What it tells you
Proves The guarantee, in one sentence
Fails for The design it catches, linked to its failure story
Harness needs The test hooks the check depends on, such as dropping a response or pausing a worker
Templates Java (JUnit 5 with AssertJ) and Python (pytest). Where the guarantee can be stated as data, an SQL invariant you can also run in production as a monitor

The templates call a small test harness with descriptive names, such as faults.dropNextResponse() or clock.pauseWorker("A"). They’re the part you write once for your system. Most need only three capabilities:

  • Fault injection: drop a response, delay or reorder a message, crash a process at a named point.
  • Pause points: stop a thread or worker at a named step so a race happens every time, not one run in a thousand.
  • Observation at the far side: count what actually happened at the destination (charges at the payment sandbox, shipments at the carrier, emails in a fake mail sink), not what your own service believes happened.

The third matters most. A check that counts rows in your own database proves your database is consistent with itself, which is rarely what failed.

Group Checks
Requests, retries and side effects One intent, one booking · changed requests can’t borrow old answers · cancellations survive reordering · one shipment per order
Events and replay Replay sends nothing · meaning survives schema changes · stale events can’t reopen · the past is reproducible
Time, ownership and inter-agency data Owners win · both bitemporal answers · incomplete snapshots close nothing · merges can be undone
Migration, backfills and cutovers Newest revision wins in any order · rollback keeps acknowledged writes · keyed reconciliation · coverage before agreement
Concurrency and ownership Multi-row rules hold · stale owners are fenced · delayed fills can’t republish · compensation touches only its own work
Observability and recovery Completions don’t fall when scaling · journeys alert, not endpoints · slow starts aren’t killed · cohorts can fail a canary
  • Run the race deterministically. Every concurrency check uses a pause point, so it fails on every run for the wrong design. A check that fails one run in a thousand gets marked flaky and ignored.
  • Keep the SQL invariants running. The SQL versions, such as no intent has two bookings, work as production monitors: schedule them and alert on any row returned.
  • Name the guarantee in the test name. retryingOneIntentCreatesOneBooking tells the next engineer what they’re about to break. testBooking3 doesn’t.

Written and edited by Abhinav Taduka, enterprise software architect.