Fixing Bugs First

Do You Fix Bugs Before Writing New Code?

Spolsky tells how the first version of Microsoft Word for Windows became a "death march": managers insisted on the schedule, programmers rushed out bad code, and bug fixing was not part of the plan. Microsoft responded with a "zero defects methodology": fix known bugs before writing any new code.

The rule works for two reasons. A bug written this morning takes minutes to fix; found months later, it takes hours, and found by customers, it can cost a patch release. And because new features are easier to estimate than old bugs, a team that keeps its bug count near zero can trust its schedule.

Modern teams wire the rule into the workflow: a failing required check blocks the merge, production errors alert whoever is on call, and every fix ships with a regression test that reproduces the bug so it cannot quietly return.