How to Reproduce a Bug
Reproduction is the skill that makes every fix possible: turn a vague report into a bug you can trigger on demand, shrink it to its essence, and tame the intermittent ones that won't show up when you're watching.
Download EPUB- Why Reproduction Is the Whole Game You can't fix - or verify a fix for - a bug you can't trigger on demand. Reproduction converts a vague report into a controllable experiment. The whole skill is two moves: make it happen reliably, then shrink it.
- Nailing It Down Four variables decide whether a bug reproduces: the exact steps, the environment, the input data, and the state/timing. Pin all four, then shrink to a minimal reproduction by removing everything that isn't load-bearing. 'Works on my machine' is one of these four differing.
- When It Won't Reproduce (Heisenbugs) Intermittent bugs have a hidden input you haven't pinned: timing/races, uninitialized state, an external dependency, or caching. The tactics that make them reliable: log around it, force the timing, control randomness and the clock, and pin the dependency.