liveBook · Manning

Bug

As explained in Build High Value Software Systems

A fault in software that can cause incorrect, unreliable, or unintended behavior.

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

How Build High Value Software Systems covers it

How deep it goes
Defines defects, works through a compatibility example, and gives detection heuristics; stops short of a detailed debugging procedure.
Examples
Uses a Python expiry check with time-zone assumptions, AI-assisted code review, and a rolled-back deployment.
What it assumes
Assumes familiarity with code, tests, reviews, and deployments while defining defects in terms of rework and unmet expectations.
What you can do after
Diagnose/debug with it by identifying hidden assumptions, recurring workarounds, and upstream gaps revealed by escaped defects.
How it connects
Links bugs to Lean waste, defect distance, collective code ownership, AI-generated code, and operational feedback loops.

Also explained in

Compare how 5 books explain bug →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.