Model checking
Exploring the states of a concurrent system to find bugs, with languages such as TLA+ or Quint.
Model checking explores the states of a concurrent or distributed system to find bugs in a design, before or alongside the implementation. TLA+ and Quint are languages in this family: you describe the states, the next-step relation, and the properties that must hold, and a checker searches for a counterexample. It is a way to test a design against all the interleavings you will never write by hand.
This is most useful for protocols, queues, locks, and any place where two processes can race. It is less useful for a purely sequential function with a clear type. A small model that captures the safety property you care about is enough; you do not have to model the entire product.
Start with a tiny state space, an invariant, and a liveness property if you need one. When the checker finds a counterexample, read the trace carefully — it is usually showing you a sequence no test ever hit. Then decide whether to change the design or the property.
Pair model checking with tests in the real code. The model is not the implementation, and it will drift if you never look at it again. Keep the model next to the protocol it describes.