A bug is a software defect that requires rework or prevents a product from meeting expectations. Some break functionality, cause outages, or return incorrect results. Others are harder to spot: code can look plausible and pass tests while failing to do what was intended in another context. Defects are one of the eight wastes in software development because fixing them consumes effort without adding the intended value. section 2.4.7 section 2.4
Listing 2.7 Defects waste
from datetime import datetime
def is_expired(expires_at):
return datetime.utcnow() > datetime.fromisoformat(expires_at)
This expiry check looks reasonable but assumes compatible time zones and date formats. If those assumptions fail, the bug may surface far from the code that introduced it. section 2.4.7
A workaround may be necessary to keep a system running: a manual check, retry, runbook, or feature flag can reduce immediate harm. But when workarounds become routine, they can hide the underlying bug and add friction. No nontrivial system is defect-free; the useful question is which accepted failures deserve a closer look. section 2.4.7
To reduce the cost of bugs, look at where they enter and where they are found:
- Catch defects close to the code that introduces them. Pair programming, test-driven development, and automated linting provide earlier feedback than a separate QA handoff. section 13.4.3
- Review AI-generated code for untested edge cases and integration assumptions, even when it follows style conventions and passes happy-path tests. The developer who merges it owns its quality. section 2.4.7 section 13.4.3
- Treat a rolled-back deployment as a signal to examine upstream tests, review, and staging conditions—not only as an incident to recover from. section 12.5.3




