bohrbug
loreprogramming
A solid, reproducible bug that behaves the same way every time you run it.
The counterpart to the heisenbug, named after the deterministic Bohr atom. A bohrbug is the good kind of hard: it does not hide from observation, so once you find the input that triggers it, it triggers every time.
A bohrbug is the opposite of a heisenbug and, mercifully, the common case. It is deterministic: the same input produces the same failure every time, it survives a debugger, and it does not care whether anyone is watching. The name comes from the Bohr atom, solid and predictable, in contrast to Heisenberg's uncertainty.
Its virtue is that it is tractable. A reproducible bug can be bisected, minimized to a small case, fixed and then proven fixed by a regression test that fails before and passes after. The whole apparatus of software testing is built for this class, which is why bohrbugs are the ones that get closed and heisenbugs are the ones that get reopened.
The useful reflex is to try converting one into the other. When a fault is intermittent, effort spent finding the input that makes it deterministic is usually better spent than effort spent catching it in the act, and much of debugging skill is exactly this: narrowing conditions until an unpredictable failure becomes a predictable one. The taxonomy also includes mandelbugs, whose causes are so complex the behaviour looks chaotic, and schrödinbugs, which work fine until someone reads the code and realizes they never should have.
Also known as: bohrbug, bohr bug
Sources
- The Jargon File