Root cause analysis template for software bugs, with a worked example

A root cause analysis (RCA) template is a form a team fills in after a bug that mattered, to find out why it happened and stop it happening again. This one is written for bugs in websites and web apps: a problem statement, the impact, a timeline from records, five whys with evidence, fishbone categories, the root cause and contributing factors, owned actions, and a last block that proves the fix worked. A filled-in example follows the blank.

  • Template
  • 8 fields, explained
  • Updated

Most root cause analysis templates on the first page of Google are written for a factory floor or a business process: a problem, some causes, a list of solutions, and a line asking someone to monitor the result. A bug in a web app needs the same thinking with different parts. The causes sit in code, browsers, data, releases and tests, the evidence is in logs, diffs and bug reports, and the analysis is not finished until someone has rerun the original steps on the fixed build. The template below has a block for each of those.

Watercolour of a seedling with two pale olive leaves, fine grey roots, a burnt orange taproot and soil crumbs.

In the template

  1. Problem statement
  2. Impact and detection
  3. Timeline
  4. Five whys
  5. Fishbone categories
  6. Root cause and contributing factors
  7. Fix and prevention actions
  8. Fix verification

Root cause analysis template, ready to copy

Copy it as it is. There is no email step, and nothing on this page is behind one.

Which version of the artefact to show
# Root cause analysis: [bug ID] [short title]

## Problem statement
What happened, in one or two sentences somebody outside the team would understand:
Where it happened (page or screen, environment, browser and device):
What should have happened instead:
Bug report or ticket the analysis starts from:

## Impact and detection
Who was affected, and how many, with the record the number comes from:
What it cost (orders, data, support contacts, hours):
Severity and priority given at triage:
How it was found (customer, monitoring, a colleague, a test):
Release or change in which it first appeared:
Found after release (an escaped defect) or before:

## Timeline
| Date and time | What happened | Source |
|---|---|---|
| [when the cause was introduced] | | |
| [when it first reached users] | | |
| [first report] | | |
| [triage] | | |
| [containment] | | |
| [fix released] | | |

## Five whys
Start from the problem statement. Every answer names its evidence. Where an answer has two causes, branch and follow both.
| # | Question | Answer | Evidence |
|---|---|---|---|
| 1 | Why did [the problem] happen? | | |
| 2 | Why did that happen? | | |
| 3 | Why? | | |
| 4 | Why? | | |
| 5 | Why? | | |
Stopped here because:

## Fishbone categories
Ask what in each category made the bug possible or let it through. Leave a category empty only after asking.
Code and design:
Data and configuration:
Environment, browser and device:
Third parties and dependencies:
Process (review, release, triage):
Tests and checks:
Communication and knowledge:

## Root cause and contributing factors
Root cause (the condition that, once removed, stops this bug and its relatives):
Contributing factors (made it likelier, larger or slower to find):
Trigger (the event that exposed it, if different from the cause):
What the analysis did not establish, and what would settle it:

## Fix and prevention actions
| Action | Type (contain, correct, prevent, detect) | Owner | Due | Ticket |
|---|---|---|---|---|
| | | | | |
| | | | | |
| | | | | |

## Fix verification
Steps from the original report rerun on (environment, browser, device, build):
Result:
Regression test added, and where it runs:
Related cases checked (other pages or flows with the same pattern):
Measure watched after release, over which dates, and what it showed:
Closed by, and date:
# Root cause analysis: SHOP-2187 Discount applied twice after Back from payment (fictional example)

## Problem statement
What happened, in one or two sentences somebody outside the team would understand: customers who went back from the payment page and then paid were given the same discount code twice, so their order total was 10.00 lower than it should have been.
Where it happened (page or screen, environment, browser and device): the checkout of the Fernhill Plants web shop, production, release 5.12. Reproduced in Safari on iPhone, Chrome on Android and Safari on a Mac.
What should have happened instead: one discount line per code per order, whatever the customer does with the Back button.
Bug report or ticket the analysis starts from: SHOP-2187, raised by customer service from a customer email with a screenshot of the order confirmation.

## Impact and detection
Who was affected, and how many, with the record the number comes from: 61 orders between 4 and 6 November, counted from the orders table (orders with two discount lines carrying the same code).
What it cost (orders, data, support contacts, hours): 610.00 in discounts given twice, 3 support contacts, about 9 engineering hours on the fix and this analysis. No data was lost.
Severity and priority given at triage: severity major, priority P1.
How it was found (customer, monitoring, a colleague, a test): a customer, who wrote in because the total looked too low.
Release or change in which it first appeared: release 5.12, which made the payment page reapply a saved discount code every time the page is shown.
Found after release (an escaped defect) or before: after release. It is an escaped defect, and the regression suite passed on 5.12.

## Timeline
| Date and time | What happened | Source |
|---|---|---|
| 3 Nov 2026, 16:10 | Release 5.12 deployed. The payment page reapplies a saved discount code whenever it is shown | Deploy log |
| 4 Nov 2026, 09:42 | First order with the same code applied twice (order 58213) | Orders table |
| 6 Nov 2026, 11:05 | Customer service files SHOP-2187 with the customer's screenshot | SHOP-2187 |
| 6 Nov 2026, 11:40 | Triage: reproduced in Safari on iPhone with Back then Pay. Severity major, priority P1 | SHOP-2187 comments |
| 6 Nov 2026, 12:15 | Containment: flag checkout-reapply-code switched off, so saved codes are no longer reapplied | Flag history |
| 7 Nov 2026, 15:30 | Fix released in 5.12.1: the server refuses a second line for the same code | Deploy log |

## Five whys
Start from the problem statement. Every answer names its evidence. Where an answer has two causes, branch and follow both.
| # | Question | Answer | Evidence |
|---|---|---|---|
| 1 | Why did the same discount appear twice on one order? | The apply-discount request reached the server twice for the same basket, and the server added a line each time | Request log for order 58213: two POST /basket/discount calls 1.4 seconds apart |
| 2 | Why did that happen? | Going Back restored the payment page from the browser's back/forward cache, and the page's pageshow handler, added in 5.12, sent the saved code again | Reproduced with the network panel open; the handler is in the 5.12 diff |
| 3 | Why? | The server never checked whether the basket already held that code. The one-code-per-order rule lived only in the front-end form validation | Code review of the discount handler |
| 4 | Why? | When the checkout was rebuilt in release 5.0, the rule was written as a form validation, and no story or review asked where else it had to hold | Story SHOP-1904 and its acceptance criteria |
| 5 | Why? | The checkout tests cover forward paths only. No test presses Back, so a page shown twice was never tried | Regression suite listing for the checkout |
Stopped here because: the next answer is a change the team controls (server-side rules and Back navigation in tests), so a sixth why would add nothing to act on.

## Fishbone categories
Ask what in each category made the bug possible or let it through. Leave a category empty only after asking.
Code and design: the pageshow handler runs on every display of the page, including a restore from the back/forward cache. The discount endpoint is not idempotent.
Data and configuration: saved codes sit in session storage and survive a Back navigation. Nothing wrong with the data itself.
Environment, browser and device: the back/forward cache keeps the page alive in Safari and Chrome, so the bug showed on phones and desktops alike. Not browser-specific, which ruled out a WebKit quirk early.
Third parties and dependencies: the payment provider charged the total it was sent. Not a cause.
Process (review, release, triage): the 5.12 review looked at the handler and not at what the server does with a repeated request. Triage was quick once the report arrived.
Tests and checks: no Back or Forward navigation in the checkout tests. No alert on orders with duplicate discount lines.
Communication and knowledge: the rule "one code per order" was known to the product owner and the front-end team, and not written anywhere the back-end team reads.

## Root cause and contributing factors
Root cause (the condition that, once removed, stops this bug and its relatives): the one-code-per-order rule was enforced only in the browser, and the server applied every discount request it received.
Contributing factors (made it likelier, larger or slower to find): the pageshow handler from 5.12; no Back navigation in the tests; no alert on duplicate discount lines, so 61 orders went through before a customer noticed.
Trigger (the event that exposed it, if different from the cause): release 5.12, which started resending the saved code.
What the analysis did not establish, and what would settle it: whether any order before 5.12 got two discounts by a double tap on Apply. A query on the orders table since 5.0 would settle it, ticket SHOP-2194.

## Fix and prevention actions
| Action | Type (contain, correct, prevent, detect) | Owner | Due | Ticket |
|---|---|---|---|---|
| Switch off flag checkout-reapply-code | contain | Priya, front end | 6 Nov | SHOP-2188 |
| Server refuses a second line for the same code and returns the existing one | correct | Tom, back end | 7 Nov | SHOP-2189 |
| Move every rule in the checkout's front-end validation list to the server, one ticket per rule | prevent | Tom, back end | 21 Nov | SHOP-2190 |
| Add Back and Forward navigation to the checkout regression tests, in WebKit and Chromium | prevent | Ana, QA | 14 Nov | SHOP-2191 |
| Alert when an order holds two discount lines with the same code | detect | Sam, operations | 12 Nov | SHOP-2192 |

## Fix verification
Steps from the original report rerun on (environment, browser, device, build): production, release 5.12.1, Safari on iPhone, Chrome on Android and Safari on a Mac, with the flag switched back on.
Result: one discount line on every order. The second request now returns the existing line, visible in the network panel.
Regression test added, and where it runs: checkout-back-navigation, in the end-to-end suite on every merge, in WebKit and Chromium.
Related cases checked (other pages or flows with the same pattern): gift cards were already checked on the server. Loyalty points had the same front-end-only rule and are in SHOP-2190.
Measure watched after release, over which dates, and what it showed: orders with two lines for the same code, 8 to 14 November: none. The alert from SHOP-2192 fired once in a staging test and never in production.
Closed by, and date: Ana, QA, 15 November 2026.

It is a form, one per bug, filled in by the people who worked on the bug, in one sitting, with the records open. The filled-in version is a fictional web shop's checkout bug, a discount applied twice after the Back button, worked from the first report to the closing check, so each block can be read beside an answer. The terms it leans on, five whys, escaped defect and defect prevention, are defined in the glossary.

An RCA is neither the bug report nor the triage decision. The report says what is broken, triage decides how soon it is fixed, and the RCA comes afterwards, asking why the bug could exist and why nothing caught it. How the first two steps work is covered in this site's post on the bug triage process.

What each field is for

Scroll the table sideways for the examples.

Field Why it earns its place Example
Problem statement What broke, where, and what should have happened, in words somebody outside the team would follow. The statement is the question every why below answers, so a vague one such as checkout is broken produces a vague analysis. The environment, browser and device belong here because they rule causes in or out before the discussion starts, and the ticket number ties the analysis back to the report and its evidence. Customers who went back from the payment page and then paid got the same discount twice. Production, release 5.12, Safari on iPhone, Chrome on Android and Safari on a Mac.
Impact and detection How many people it reached, what it cost and how it was found, each with the record behind the number. Impact decides how deep the analysis goes. How the bug was found matters as much: a bug a customer found is one every check the team owns missed, which is what an escaped defect is, and that changes which actions the analysis needs. 61 orders, 610.00 in discounts given twice, found by a customer. An escaped defect from release 5.12.
Timeline When the cause went in, when it reached users, when it was reported, triaged, contained and fixed, with the source of each line. The timeline is built from records such as deploy logs, the tracker and production data before anyone offers a theory, because every later answer is checked against it. The gap between the cause going in and the first report is how long detection took, and the gap from report to fix is the response. 3 Nov, 16:10, release 5.12 deployed. 4 Nov, 09:42, first affected order. 6 Nov, 11:05, first report.
Five whys A chain of why questions from the problem statement down to a cause the team can change, with the evidence for each answer in its own column. The evidence column is the difference between an analysis and a guess: an answer with no log, diff or test result behind it is a hypothesis to check, never a step to build on. Five is a habit, not a rule, and the block ends by saying why the chain stopped. 3. Why? The server never checked whether the basket already held the code. Evidence: code review of the discount handler.
Fishbone categories Seven areas to ask about, so the analysis looks sideways as well as down. A chain of whys tends to follow one line of causes; the fishbone makes the team ask, in each area, what made the bug possible and what let it through. The categories are a web team's version of the manufacturing ones: code, data, environment and browser, third parties, process, tests and communication. A category may stay empty once somebody has asked. Tests and checks: no Back or Forward navigation in the checkout tests. No alert on duplicate discount lines.
Root cause and contributing factors The decision the analysis exists to reach, split into three kinds of cause. The root cause is the condition whose removal stops this bug and its relatives. Contributing factors made it likelier, larger or slower to find. The trigger is the change or event that exposed it. Keeping the three apart stops a team fixing the trigger and calling it done. The last line records what is still unknown and how to find out. Root cause: the one-code-per-order rule lived only in the browser. Trigger: release 5.12.
Fix and prevention actions Each action with its type, an owner, a date and a ticket. The four types answer four questions: what limited the damage now (contain), what fixed this bug (correct), what stops the whole class of bug (prevent) and what will find the next one sooner (detect). An analysis with only a correct action has fixed one bug and changed nothing else, and an action without an owner and a ticket is a wish. Add Back and Forward navigation to the checkout regression tests, in WebKit and Chromium. Prevent. Ana, QA. 14 Nov. SHOP-2191.
Fix verification The proof that the fix worked: the original steps rerun on the fixed build, on the same browsers and devices, the regression test that now guards the case, related flows with the same pattern, and a measure watched after release. Generic templates stop at monitoring, which is where bugs come back. A fix verified only on a developer's laptop, or only in the browser where it was first seen, is a fix nobody has verified. Rerun on 5.12.1 in Safari on iPhone and Chrome on Android: one discount line. Orders with duplicate lines from 8 to 14 November: none.

A root cause analysis that changes nothing, and the same analysis written usably

Not this

Root cause: developer error in the discount logic. Fixed in 5.12.1. Action: be more careful with checkout changes, QA to test more.

This instead

Root cause: the one-code-per-order rule lived only in the browser, so the server applied every discount request it received. Trigger: release 5.12 resent saved codes after Back. Contributing: no Back navigation in the tests, no alert on duplicate discounts. Actions: server refuses a second line (Tom, 7 Nov), every front-end checkout rule moved to the server (Tom, 21 Nov), Back and Forward tests in WebKit and Chromium (Ana, 14 Nov), duplicate-discount alert (Sam, 12 Nov). Verified on 5.12.1 on iPhone and Android, and no duplicates from 8 to 14 November.

Both describe the same bug. The first names a person, which ends the inquiry where it should begin, and its actions have no owner, no date and nothing anyone could check, so the next rule held only in the browser will fail the same way. The second names a condition the team can remove, separates it from the release that exposed it, gives every action an owner and a date, and shows the fix was checked on the devices where the bug was seen.

When a bug needs a root cause analysis

Not every bug earns one. A typo fixed in a minute needs a clear ticket and nothing more, and a team that writes an analysis for every defect soon writes them badly. The Google SRE book, in its chapter on postmortem culture, lists the triggers Google's teams commonly use for an incident review: user-visible downtime or degradation beyond a threshold, data loss of any kind, an on-call engineer having to step in with a rollback or similar, a resolution time above a threshold, and a monitoring failure, where people found the problem before the alerts did. It also advises agreeing the criteria before an incident, so nobody argues about them afterwards. For bugs in a website or web app, the same idea gives a short list: a bug that reached customers and cost them money, data or a task; a bug that came back after it was fixed; a regression in a flow that has tests; and any bug a customer found before the team did. The last is worth an analysis even when the damage was small, because it means every check the team owns missed it.

How to fill in the template in one sitting

Book an hour with the people who worked on the bug: whoever reported or triaged it, whoever fixed it and whoever owns the tests for that flow. Fill in the problem statement, the impact and the timeline before the meeting, from records, and send them round, so the hour goes on causes rather than on reconstructing what happened. In the meeting, run the five whys first with the timeline on screen, and write the evidence beside each answer as it is given. Then go through the fishbone categories one by one, including those that look irrelevant, since that is where a second cause usually turns up. Decide the root cause and the contributing factors together, and write the actions with owners before anyone leaves. Fix verification is filled in later, by the owner of the correct action, after release. Keep the tone the Google SRE book asks of a postmortem: identify the contributing causes without blaming a person or a team, and assume everyone acted in good faith with the information they had. The book's reasoning is practical. Where people are blamed for problems, they stop bringing them to light.

Using the five whys and the fishbone together

The two methods answer different questions. The five whys, which comes from the Toyota Production System, goes deep: each answer becomes the next question until the team reaches a cause it can change. The fishbone, or Ishikawa diagram, goes wide. Kaoru Ishikawa popularised it in the 1960s, and in manufacturing its branches are often the 5 Ms: manpower, machine, material, method and measurement. A software team has the same branches under other names, and this template uses them: code and design for the machine, data and configuration for the material, process for the method, tests and checks for the measurement, and communication and knowledge for the people. Environment, browser and device, and third parties, are added because a web app runs on hardware and code the team does not own. Run the whys first to find the main chain, then the fishbone to find what the chain missed. In the worked example, the chain led to a rule held only in the browser, and the fishbone added two things the chain had passed over: no test ever pressed Back, and nothing alerted on duplicate discounts.

Root cause, contributing factor or trigger

Most weak analyses fail here, by naming the most recent change as the cause. The trigger is the event that exposed the bug: a release, a browser update, a spike in traffic. The root cause is the condition that let the trigger do damage, and it would have done damage again under a different trigger. In the example, release 5.12 was the trigger. Reverting it would have hidden the bug until the next time a request was sent twice, from a double tap or a retry on a slow connection. The root cause was that the server trusted the browser to enforce a business rule. Contributing factors made the bug likelier, larger or slower to find, here the missing test and the missing alert. A useful test for a proposed root cause is to ask whether removing it would stop this bug's relatives as well as this bug. Human error never passes that test. A person who made a mistake is the start of the next why: what let that mistake reach production unnoticed.

Proving the fix worked

A bug is closed when somebody has shown it cannot happen any more, which is a different statement from a developer saying it is fixed. The verification block asks for four kinds of proof. Rerun the steps from the original report on the fixed build, on the same browser, device and environment, because a fix checked in a desktop browser says nothing about the phone where the customer met the bug. Name the regression test that now guards the case and where it runs, so the next release cannot bring it back quietly. Check related flows with the same pattern: if one rule lived only in the browser, others may too. Then watch a measure in production for a stated period, with the dates written down. A bug report that arrives with its evidence makes this block quicker to fill in. The browser and its version, the console output and the failed requests from the original session are the baseline the rerun is compared with, and the screenshot shows what the fixed page should no longer look like.

Common questions

What should a root cause analysis template include?

A root cause analysis template should include a problem statement, the impact and how the problem was found, a timeline built from records, the analysis itself (five whys, a fishbone or both, with evidence for each answer), the root cause kept apart from contributing factors and the trigger, actions with owners and dates, and a check that the fix worked.

How do you write a root cause analysis for a software bug?

Start from the bug report and write a precise problem statement, then build the timeline from deploy logs, the tracker and production data. Ask why the bug happened and answer from evidence, repeating until the cause is something the team can change. Check each fishbone category for causes the chain missed, write owned actions, and rerun the original steps once the fix ships.

What is the 5 whys method for root cause analysis?

The 5 whys method finds a root cause by asking why a problem happened, then asking why again of each answer, until the answer is a cause the team can act on. The method comes from the Toyota Production System. Five is a rule of thumb: some chains end after three questions and others branch into several.

What is the difference between a root cause and a contributing factor?

A root cause is the condition that, once removed, stops the problem and its relatives from happening. A contributing factor made the problem likelier, larger or slower to find without causing it alone, such as a missing test or a missing alert. Most bugs worth an analysis have one root cause and several contributing factors.

Is a root cause analysis the same as a postmortem?

A postmortem is the wider record of an incident. The Google SRE book defines it as a written record of the incident, its impact, the actions taken to mitigate or resolve it, the root causes and the follow-up actions to prevent a recurrence. A root cause analysis is the part that finds the causes, and for a single bug it is often the whole document.

When should a team do a root cause analysis on a bug?

Teams usually run one when a bug reached customers and cost them money, data or a task, when a fixed bug came back, when a tested flow regressed, or when a customer found the bug before the team did. Agreeing those triggers in advance, as the Google SRE book advises for postmortems, avoids an argument after each incident.

More templates

  • Watercolour of a single hairline crack across a pane of glass, the wash pooling dark along the fracture

    Template

    Bug report template

    A copyable bug report template with the fields that decide whether a report can be acted on: environment, steps, expected against actual, evidence.

    8 fields, explained ·

  • Watercolour of an olive wooden abacus with three rods of shaded round beads, one burnt orange, on warm paper.

    Template

    Issue tracker template

    A free issue tracker template for website projects: a copyable issue log for Excel or Google Sheets, every column explained, and a filled-in example log.

    5 fields, explained ·

  • Watercolour of a pale wooden clipboard holding a blank sheet beneath a burnt orange clip, with a soft olive shadow.

    Template

    Bug report form

    A copyable software bug report form for clients and testers: plain questions with help text, which answers are required, a team-only block, a filled example.

    14 fields, explained ·

Or skip the template and capture the fields automatically.

Environment, console and network attach themselves, on the free plan.

<script src="…/widget.js" data-key="pb_pub_…">