liveBook · Manning

Five Whys

As explained in Build High Value Software Systems

A root-cause analysis technique that repeatedly asks why a problem occurred, using each answer to guide the next question.

A restart, retry, or larger queue may clear an alert without preventing its return. Five Whys is a root-cause technique for tracing a failure beyond its first visible symptom: ask why it happened, use the answer to form the next question, and stop when you reach something you can change. Five is a prompt to keep investigating, not a required count. section 8.0 section 8.2.1

Intermittent uploads

Uploads fail because storage returns 503. Storage returns 503 because its request queue is full. Large files fill the queue faster than workers drain it because files are not size-validated before enqueue. Validation is absent because the original specification never set a maximum upload size. The countermeasure is a size limit at the API boundary, not simply a bigger queue. section 8.2.1

Back each answer with observed behavior, logs, metrics, traces, or a reproducible test. If an answer is a guess, gather evidence before asking the next why; an unsupported link can misdirect the entire chain. The questions expose assumptions, such as whether a full queue really means the queue is too small. section 8.2.1

Five Whys traces one cause chain, but it need not complete an investigation alone. Is/Is Not can narrow where a failure occurs; a fishbone diagram can check for causes the chain missed; Pareto analysis can help prioritize by impact. In post-incident reviews, people also need to feel safe describing what happened rather than defending their actions. section 8.2.5 section 13.2

Listing 8.4 AI approach to fixing a bug it was presented with
# AI-generated fix: retry until user appears
def test_user_exists():
    user = create_test_user()
    for attempt in range(5):
        if db.find_user(user.id):
            break
        time.sleep(0.1)
    assert db.find_user(user.id) is not None

This retry makes an intermittent database test pass without resolving its cause. Tracing why the assertion runs before the user exists leads to an asynchronous insert that the helper does not await; the durable fix is to await the write. section 8.4

How Build High Value Software Systems covers it

How deep it goes
Works through successive why-questions and an evidence rule, stopping at a changeable cause rather than a fixed question count.
Examples
Uses failed uploads and a flaky asynchronous database test to contrast cause-directed fixes with larger queues and retries.
What it assumes
Assumes access to failure evidence but requires no specialized tool; starts with a simple incident and successive questions.
What you can do after
Practice/perform an evidence-backed cause chain and choose a countermeasure that addresses its changeable cause.
How it connects
Connects root cause analysis with Is/Is Not, fishbone diagrams, Pareto analysis, and blameless post-incident reviews.

Also explained in

Compare how 5 books explain Five Whys →

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.