Joel Drapper

Bugs of Omission and Bugs of Commission

Two kinds of bugs:

  1. Bugs of Omission: The software refuses to proceed. It raises an exception, crashes or otherwise stops doing anything.
  2. Bugs of Commission: The software confidently does the wrong thing. It silently corrupts data, deletes records, sends emails, makes payments, returns incorrect results or processes invalid input.

The former is always preferable to the latter. Bugs of omission are easier to detect and fix. The consequences are bounded and predictable. In contrast, bugs of commission can be more subtle. They’re difficult to detect and the consequences can be devastating, unlimited, sometimes irreparable.

This is why I advocate for runtime assertions. It’s impossible to test every possible scenario ahead of time, but you can test every actual scenario just in time.