In 1999 Amazon engineers found fifteen bugs in real distributed-systems protocols — not by testing, but by writing TLA+ specifications. One was a data-loss bug that would have surfaced only under a rare combination of failures nobody had imagined.
TLA+ is a formal specification language invented by Leslie Lamport (the same Lamport behind Lamport clocks and the Paxos consensus protocol, awarded the Turing Award in 2013). It describes a system as a state machine: a set of variables holding the current state, an initial condition, and a collection of actions — guarded transitions that may update those variables. Every possible interleaving of actions across concurrent processes is explored automatically by a model checker called TLC.
The core insight is simple but powerful: if you can write down what a system is supposed to do (its invariant — a predicate that must hold in every reachable state), then a model checker can exhaustively verify it on all finite executions up to a bounded depth. Bugs that survive every unit test often die instantly against a spec.
Comments
Loading comments...