# John Hughes - Testing the Hard Stuff and Staying Sane

> For agents: start with the [agent guide](https://ratstack.sh/llms.txt). Every page is Markdown by default; add `Accept: text/html` for HTML.

[ClojureTV](https://www.youtube.com/@ClojureTV) · Published 2014-03-26 · 47:17 · S tier · Systems thinking

[Watch on YouTube](https://www.youtube.com/watch?v=zi0rHwfiX1Q) · [All RatTube videos](/tube)

## Summary

John Hughes shows why enumerating example tests becomes difficult when operations interact. He uses small models and [generated operation sequences](/lore/model-based-testing) to specify behavior and find bugs in imperative code.

The demonstrations [shrink](/lore/property-based-testing) failures into short cases that are easier to debug. Hughes then moves from sequential behavior to parallel tests, where the model must first match ordinary operation. Examples expose race conditions and corruption that successful individual results can hide.

## Section notes

- [1:01](https://www.youtube.com/watch?v=zi0rHwfiX1Q\&t=61s): Combinations and race conditions make exhaustive hand-written cases grow quickly.
- [8:03](https://www.youtube.com/watch?v=zi0rHwfiX1Q\&t=483s): Small pure functions specify the behavior of imperative operations.
- [17:37](https://www.youtube.com/watch?v=zi0rHwfiX1Q\&t=1057s): One specification finds different bugs and shrinks them to small failing cases.
- [26:09](https://www.youtube.com/watch?v=zi0rHwfiX1Q\&t=1569s): Industrial testing finds problems in implementations and in their standard.
- [34:00](https://www.youtube.com/watch?v=zi0rHwfiX1Q\&t=2040s): A model must match sequential behavior before parallel tests are meaningful.
- [42:28](https://www.youtube.com/watch?v=zi0rHwfiX1Q\&t=2548s): Concurrent operations can return plausible results while corrupting stored data.

## Key concepts

- [generated operation sequences](/lore/model-based-testing)
- [shrink](/lore/property-based-testing)

## Our take

John Hughes shows why example tests cannot keep up with interactions between features and with race conditions, and how QuickCheck tests generated from a state machine model find those bugs and shrink them to a minimal failing case. This is why the stack prefers property and model tests.

## Related videos

- [John Hughes - How to specify it! A guide to writing properties of pure functions | Code Mesh LDN 19](/tube/how-to-specify-pure-function-properties)
- [All Code Is Slop (Except Mine) — Lauren Tan, SpaceXSI](/tube/all-code-is-slop-except-mine-lauren-tan)
- ["Simple Made Easy" - Rich Hickey (2011)](/tube/simple-made-easy-rich-hickey-2011)
- [David Khourshid: Simplifying Complex UIs with Finite Automata & Statecharts | JSConf Iceland 2018](/tube/simplifying-complex-uis-with-statecharts)

Summary based on the transcript. Written 2026-11-15.
