# Deterministic Simulation Testing

DevFeed: [Deterministic Simulation Testing](<https://devfeed.tech/articles/deterministic-simulation-testing-139734.md>)

Original publisher: [Read original article](<https://martinfowler.com/articles/deterministic-simulation-testing.html>)

Author: Martin Fowler (martin@martinfowler.com)

Published: 2026-11-17T14:33:00Z

Content type: article

Language: en

Sources: [Martin Fowler](<https://devfeed.tech/sources/martin-fowler.md>)

Topics: [Simulation](<https://devfeed.tech/topics/simulation.md>), [Distributed Systems & Parallel Computing](<https://devfeed.tech/topics/distributed-systems-parallel-computing.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [Chaos Engineering](<https://devfeed.tech/topics/chaos-engineering.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [etcd](<https://devfeed.tech/topics/etcd.md>)

Tags: [allows](<https://devfeed.tech/tags/allows.md>), [approach](<https://devfeed.tech/tags/approach.md>), [article](<https://devfeed.tech/tags/article.md>), [can](<https://devfeed.tech/tags/can.md>), [clocks](<https://devfeed.tech/tags/clocks.md>), [code](<https://devfeed.tech/tags/code.md>), [components](<https://devfeed.tech/tags/components.md>), [deterministic-simulation](<https://devfeed.tech/tags/deterministic-simulation.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [example](<https://devfeed.tech/tags/example.md>), [execution](<https://devfeed.tech/tags/execution.md>), [failures](<https://devfeed.tech/tags/failures.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [java](<https://devfeed.tech/tags/java.md>), [key](<https://devfeed.tech/tags/key.md>), [key-value-store](<https://devfeed.tech/tags/key-value-store.md>), [latency](<https://devfeed.tech/tags/latency.md>), [simulation](<https://devfeed.tech/tags/simulation.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

Deterministic simulation testing makes distributed-system executions repeatable by replacing real time, scheduling, networking, and storage with components that advance only when a single-threaded tick loop drives them. In the Tickloom Java example, tests can set link delays, partitions, message loss, and tick-based timeouts, then replay runs with a seeded fault schedule and check client-visible histories for linearizability. Simulated storage separates visible writes from durable data, so crashes can discard unsynced writes. Production adapters use the same Network and FileIO interfaces with non-blocking I/O and return completions to the tick thread. The approach supports reproducible gray-failure scenarios and fast-forward fault exploration, but requires upfront architectural constraints: asynchronous non-blocking APIs, controlled randomness and time, and rules that prevent nondeterminism from entering the core. The single event loop must not block or perform long CPU work; multi-core scaling uses independent processes.

## Source excerpt

Distributed systems are hard to test because partial failures overlap with live traffic and the same fault can produce different execution traces on different runs. Unmesh Joshi describes how deterministic simulation testing addresses this by replacing real clocks, networks, and storage with simulated components driven by a single-threaded execution loop. This allows simulating both hard failures and routine slowdowns--such as network and disk latency spikes--and more importantly makes every execution reproducible. This article explains the technique using a quorum key-value store as a running example, with code from Tickloom, a Java implementation of the approach. more...