The Single Cockroach Rule

Seeing one cockroach under the sink usually means an infestation. Roaches like to hide. It only showed up because the hiding spots were overcrowded.

I like to apply this generalization to software engineering—especially over beer.

  • If you receive a single bug report about a feature you just launched, it likely means the feature is completely broken. Users tend to work around UX issues and only reach out to support when things are really bad and they have no other options.
  • That one security, usability, or other issue you noticed in a pull request? If there’s one in the PR, there are probably more in the adjacent code.
  • A missing space in a code change? That usually means there’s no linting in place.
  • A missed edge case? It might indicate something is off in our testing process.

The way I defined this Cocroach Rule matches the definition of a Hasty Generalization. After all, one cockroach—or one bug—is a sample size of one. There’s always a chance that a reported issue is an extreme outlier, something no one else will ever encounter. Maybe a high-energy particle hit a chip somewhere. It happens.

But my long-term experience shows that the Single Cockroach Problem largely holds true. It applies in many areas where the difference between zero and one is significant.

4 thoughts on “The Single Cockroach Rule

Leave a reply to Veselin Cancel reply