Mark Pitt
claude-skills
  1. claude-skills
  2. Engineering practices
  3. root-cause-analysis
  4. resources/rca-methodologies.md

A file in root-cause-analysis

resources/rca-methodologies.md

Markdown 17 KB
rca-methodologies.mdMarkdown, rendered

RCA Methodologies: Comprehensive Guide

This resource covers the five core root cause analysis methodologies with step-by-step guidance, when to use each, and practical examples.

1. The 5 Whys Method

The 5 Whys is the foundational systematic root cause analysis method, developed by Sakichi Toyoda for the Toyota Production System.

Key Principles

  • Go and See: Base answers on direct observation, not assumptions
  • Data Validation: Support each cause-effect link with evidence
  • People Over Blame: Focus on process failures, not individual fault
  • Actionable Root Cause: Stop when you reach a cause you can fix

Process

  1. State the problem clearly (What, Where, When, Impact)
  2. Ask "Why did this happen?" and answer with facts
  3. For each answer, ask "Why?" again
  4. Continue until you reach the root cause (usually 3-7 iterations)
  5. Verify the root cause leads back to the problem

When to Use

  • Single clear failure chains
  • Need quick analysis under time pressure
  • Problem has obvious initial cause but needs deeper investigation
  • Immediate action required

Example: Production API Failure

Problem: Production API returning 500 errors

Why #1: Why is the API returning 500 errors?
→ Database connection pool is exhausted

Why #2: Why is the connection pool exhausted?
→ Connections not being released after queries

Why #3: Why aren't connections being released?
→ Connection timeout set too high, queries hanging

Why #4: Why are queries hanging?
→ Recent code change added unindexed query on large table

Why #5: Why was unindexed query added?
→ Code review process doesn't include database performance checks

Root Cause: Missing database performance validation in code review
Solution: Add DB query analysis to CI/CD pipeline and review checklist

Best Practices

  • Support each answer with evidence (logs, data, observations)
  • Dig deeper when answers are vague or blame-oriented
  • Consider multiple pathways if answer could lead to multiple causes
  • Stop at actionable causes, not abstract ones

---

2. Fishbone Diagram (Ishikawa)

Created by Kaoru Ishikawa, this visual tool organizes potential causes into categories for comprehensive systematic analysis.

Structure

                    Methods          Machines
                      /                 /
                     /                 /
        ___________/_________________/__________ PROBLEM/EFFECT
                   \                 \
                    \                 \
                  Materials      Measurements
                  (+ Manpower, Mother Nature/Environment)

The 6 M's Categories

  • Manpower/People: Skills, training, staffing, communication, procedures
  • Methods/Process: Workflows, documentation, standardization, procedures
  • Machines/Equipment: Tools, hardware, software systems, infrastructure
  • Materials/Inputs: Components, supplies, dependencies, data quality
  • Measurements/Monitoring: Metrics, monitoring, detection, feedback systems
  • Mother Nature/Environment: External factors, conditions, seasonal effects

Process

  1. Draw the fishbone with problem at the head
  2. Add main category branches (6 M's or domain-specific)
  3. Brainstorm causes for each category
  4. Add sub-causes as smaller branches
  5. Identify most likely root causes for investigation
  6. Use 5 Whys to drill deeper into top 2-3 candidates

When to Use

  • Complex problems with multiple potential causes
  • Team brainstorming sessions
  • Problems where category analysis adds clarity
  • Need to explore all possible contributing factors
  • Want systematic coverage across all dimensions

Example: E-Commerce Checkout Failures

METHODS/PROCESS:

  • Retry logic insufficient
  • Error handling incomplete
  • Circuit breaker not implemented

MACHINES/EQUIPMENT:

  • Payment gateway API
  • Database connection pool
  • Load balancer configuration

MATERIALS/INPUTS:

  • Traffic volume (3x normal)
  • Payment data validation
  • Third-party API responses

MEASUREMENTS/MONITORING:

  • Limited observability into payment flow
  • No alerting on payment gateway errors
  • Missing SLA monitoring

MANPOWER:

  • On-call engineer unfamiliar with payment code
  • Payment processor contact info outdated
  • No runbook for payment failures

ENVIRONMENT:

  • Black Friday traffic surge
  • Third-party payment gateway under load
  • Database experiencing high connection count

Advantages

  • Visual representation helps team communication
  • Ensures comprehensive exploration
  • Good for cross-functional analysis
  • Helps identify contributing vs. root causes
  • Tracks multiple cause paths

Disadvantages

  • Can be overwhelming for simple problems
  • May identify causes that don't actually contribute
  • Requires domain knowledge for meaningful categories

---

3. Pareto Analysis (80/20 Rule)

Prioritize problems by identifying which causes contribute most to the effect.

Principle

Typically, 20% of causes account for 80% of problems. Focus resources on the vital few.

Process

  1. List all potential causes
  2. Measure or estimate frequency/impact of each
  3. Sort by impact (highest to lowest)
  4. Calculate cumulative percentage
  5. Identify the vital few causing 80% of impact
  6. Focus investigation on high-impact causes

When to Use

  • Multiple problems competing for attention
  • Need to prioritize limited resources
  • Data-driven decision required
  • Want to maximize impact of corrective actions
  • Resource constraints necessitate triage

Example: Software Bugs by Category

Category              Count    Cumulative %
---------------------------------------------
Missing input validation    45      45%
Insufficient error handling 25      70%
Resource leaks              15      85%
Concurrency issues          8       93%
Other                       7      100%

Focus on input validation and error handling (70% of issues)

Implementation Tips

  • Use historical data when available
  • Be objective about measurements
  • Don't ignore the "other" 20% (might contain critical issues)
  • Recalculate regularly as patterns change
  • Combine with other methods for complete analysis

---

4. Fault Tree Analysis (FTA)

Top-down deductive approach using Boolean logic to analyze failure modes, primarily for safety-critical and high-stakes systems.

When to Use

  • Safety-critical systems (aerospace, medical, automotive)
  • High-cost failures requiring rigorous analysis
  • Complex systems with multiple failure paths
  • Regulatory or compliance requirements
  • Need to identify all possible failure combinations

Basic Structure

                         ╔═══════════════╗
                         ║  TOP EVENT    ║
                         ║ (Undesired)   ║
                         ╚═══════════════╝
                                ▲
                         ┌──────┴──────┐
                         │             │
                     ╔═══╩═══╗     ╔═══╩═══╗
                     ║ OR Gate║     ║ AND Gate║
                     ╚═══╤═══╝     ╚═══╤═══╝
                    ┌────┴────┐       │    │
                    │         │       │    │
                 ┌──▼──┐  ┌───▼──┐ ┌─▼─┐ ┌─▼─┐
                 │Basic│  │Basic │ │ B │ │ B │
                 │Event│  │Event │ │ E │ │ E │
                 └─────┘  └──────┘ └───┘ └───┘

Logic Gates

  • OR Gate: Any single input can cause the output
  • AND Gate: All inputs must occur for the output
  • XOR: Exactly one input must occur

Process

  1. Define the undesired top event
  2. Identify immediate causes (first level)
  3. Decompose each cause recursively
  4. Continue until reaching basic events
  5. Apply Boolean logic to gates
  6. Calculate probability if data available
  7. Identify critical failure combinations

Advantages

  • Rigorous, formal analysis
  • Identifies all failure paths
  • Quantifiable risk assessment
  • Good for complex systems
  • Regulatory compliant

Disadvantages

  • Complex and time-consuming
  • Requires specialized knowledge
  • Can become very large
  • Best with quantitative failure data
  • Not suitable for quick analysis

---

5. Barrier Analysis

Examines what controls or barriers failed to prevent or detect the problem.

Key Questions

  • What barriers existed to prevent this problem?
  • Which barriers failed? Why?
  • What barriers were missing?
  • How did the problem bypass existing controls?

Categories of Barriers

Preventive Barriers:

  • Controls designed to stop the problem before it starts
  • Example: Input validation, access controls, safety interlocks

Detective Barriers:

  • Controls designed to catch the problem early
  • Example: Monitoring, alerts, status checks, reviews

Mitigating Barriers:

  • Controls designed to reduce impact once problem occurs
  • Example: Failovers, circuit breakers, rollback procedures

Process

  1. Map all barriers that should have prevented the problem
  2. For each barrier, determine: Did it exist? (Yes/No/Partial) Was it active? (Yes/No/Conditional) Did it function? (Yes/No/Partially) Why did it fail? (If applicable)
  3. Identify gaps (missing barriers)
  4. Analyze barrier interactions
  5. Develop improvements

When to Use

  • Process breakdowns
  • Multiple failures cascading
  • Systematic failures in systems
  • Safety or security incidents
  • Want to strengthen system resilience

Example: Payment Processing Failure

Preventive Barriers:

  • ❌ Query performance monitoring (Missing)
  • ✓ Code review (Existed but incomplete)
  • ❌ Load testing with production volume (Failed)

Detective Barriers:

  • ✓ Error logging (Worked but slow alerting)
  • ❌ Performance alerts on latency (Missing)
  • ✓ Health checks (Existed but inadequate)

Mitigating Barriers:

  • ❌ Circuit breaker (Not implemented)
  • ✓ Manual failover (Existed, took 45 minutes)

Root improvement focus: Implement all missing barriers, especially query monitoring and performance alerts.

---

6-Phase Structured RCA Process

Integrating all methodologies into a complete process:

Phase 1: Define the Problem

Create clear problem statement with What/Where/When/Impact:

  • What: Observable symptom (not assumed cause)
  • Where: Location, system, component
  • When: Timeline, frequency, pattern
  • Impact: Users affected, severity, business impact

Phase 2: Gather Evidence

Follow "Go and See" principle—collect facts, not opinions:

  • Logs, metrics, monitoring data
  • Timeline of events and changes
  • Recent system/code/configuration changes
  • Environmental factors (load, traffic, season)
  • User reports and reproduction steps

Phase 3: Select & Apply Methodology

Choose based on problem complexity:

  • Simple: 5 Whys alone
  • Complex: Fishbone + 5 Whys
  • Multiple: Pareto + 5 Whys
  • Safety-critical: Fault Tree
  • Process failures: Barrier Analysis

Phase 4: Verify Root Cause

Test conclusions:

  • Forward Test: Would this root cause create the observed problem?
  • Backward Test: Would eliminating this prevent the problem?
  • Evidence Test: Data supporting causal chain?
  • Scope Test: Explains all problem instances?

Phase 5: Develop Solutions

Address root cause with:

  • Eliminate: Remove cause entirely
  • Control: Add safeguards
  • Detect: Improve monitoring
  • Mitigate: Reduce impact

Phase 6: Implement & Verify

  • Execute solution
  • Monitor for side effects
  • Measure effectiveness
  • Document and share learning
  • Follow up on recurrence

---

Red Flags: Signs You Haven't Found Root Cause

❌ "Human error" → Why did human make that error? What in system allowed it?

❌ "User made a mistake" → Why was mistake possible? What prevented detection?

❌ "Someone forgot" → Why no reminder/checklist/automation?

❌ "Bad luck" → What made system vulnerable?

❌ "It just broke" → What caused failure? Why now?

❌ "Not enough time" → Why insufficient? What prioritization led to this?

❌ "Lack of communication" → What process/tool failure enabled miscommunication?

❌ "Budget constraints" → Why not funded? What drove allocation?

❌ "That's just how it is" → What systemic issue perpetuates this?

Keep digging until you reach a controllable, actionable cause.

---

Methodology Selection Heuristic

Problem CharacteristicsRecommended MethodologyReason
Single clear failure, obvious initial cause5 WhysFast, focused, iterative
Complex, multiple possible causesFishbone → 5 WhysComprehensive exploration then deep dive
Multiple issues, need prioritizationPareto → 5 WhysIdentify vital few then analyze
Safety-critical, high-stakesFault TreeRigorous, formal, probabilistic
Process breakdown, control failureBarrier AnalysisIdentifies specific control gaps
Unknown cause, system explorationFishboneStructured exploration
Time-critical situation5 WhysSpeed without sacrificing rigor
Need team alignmentFishbone or BarrierVisual, collaborative
Learning from near-missBarrier AnalysisIdentifies what worked vs. what didn't

---

Domain-Specific Guidance

Software Debugging Focus Areas

Key 5 Whys questions:

  • Why did the code allow this condition?
  • Why wasn't this caught in testing?
  • Why didn't monitoring detect earlier?
  • Why didn't code review catch it?
  • Why doesn't our process prevent this class of error?

Fishbone categories for software:

  • Code (logic errors, edge cases, concurrency)
  • Configuration (environment, feature flags, secrets)
  • Dependencies (versions, API changes, compatibility)
  • Deployment (rollout completeness, migrations, caching)
  • Testing (coverage, environment differences)
  • Monitoring (blind spots, alert delays)

Hardware/Mechanical Focus Areas

Fishbone categories (adapted):

  • Design (engineering, tolerances, specifications)
  • Materials (quality, wear, fatigue, corrosion)
  • Assembly (installation, alignment, torque)
  • Operation (usage patterns, load, stress)
  • Maintenance (schedules, procedures, parts)
  • Environment (temperature, humidity, contamination)

Process/Organizational Focus Areas

Barrier Analysis focus:

  • Communication channels and effectiveness
  • Approval/review checkpoints and rigor
  • Training programs and knowledge sharing
  • Documentation accuracy and accessibility
  • Incentive alignment with desired outcomes
  • Escalation procedures and timeliness

---

Templates

5 Whys Template

PROBLEM STATEMENT:
[What, Where, When, Impact]

WHY #1: Why did [problem] occur?
Answer: [Evidence-based]
Evidence: [Data/logs/observations]

WHY #2: Why did [answer #1] occur?
Answer: [Evidence-based]
Evidence: [Data/logs/observations]

WHY #3: Why did [answer #2] occur?
Answer: [Evidence-based]
Evidence: [Data/logs/observations]

WHY #4: Why did [answer #3] occur?
Answer: [Evidence-based]
Evidence: [Data/logs/observations]

WHY #5: Why did [answer #4] occur?
Answer: [Evidence-based]
Evidence: [Data/logs/observations]

ROOT CAUSE:
[Deepest actionable cause]

VERIFICATION:
- Forward test: [Would this cause the problem?]
- Backward test: [Would fixing this prevent it?]
- Evidence: [What supports this?]

SOLUTION:
- Immediate: [Stop current problem]
- Root cause: [Prevent recurrence]
- Systemic: [Strengthen system]
- Monitoring: [Detect if recurs]

Fishbone Template

PROBLEM/EFFECT: [The problem]

MANPOWER/PEOPLE:
- [Cause]
  - [Sub-cause]

METHODS/PROCESS:
- [Cause]
  - [Sub-cause]

MACHINES/EQUIPMENT:
- [Cause]
  - [Sub-cause]

MATERIALS/INPUTS:
- [Cause]
  - [Sub-cause]

MEASUREMENTS/MONITORING:
- [Cause]
  - [Sub-cause]

ENVIRONMENT:
- [Cause]
  - [Sub-cause]

TOP CANDIDATES:
1. [Most likely based on analysis]
2. [Second most likely]
3. [Third most likely]

NEXT STEPS:
[Apply 5 Whys to top candidates]

---

Best Practices

Do's ✓

  • Base analysis on facts and evidence, not assumptions
  • Use "Go and See"—observe directly
  • Focus on process/system failures, not blame
  • Document each step and reasoning
  • Verify root causes before implementing solutions
  • Involve people with direct problem knowledge
  • Consider multiple perspectives and hypotheses
  • Stop at actionable root cause
  • Share learning to prevent similar issues
  • Combine methodologies for complex problems

Don'ts ✗

  • Stop at symptoms or proximate causes
  • Accept "human error" as root cause
  • Skip evidence gathering
  • Blame individuals—fix systems
  • Implement solutions without verification
  • Rush to solutions before understanding
  • Ignore contradictory evidence
  • Forget follow-up on effectiveness
  • Use only one methodology for complex problems
  • Make root cause analysis about punishment

---

Continuous Improvement

After solving immediate problem:

  1. Pattern Recognition: Is this part of larger pattern?
  2. Process Improvement: How prevent this class of problems?
  3. Knowledge Sharing: Who else should learn from this?
  4. Monitoring Enhancement: Can detect earlier next time?
  5. Documentation: Capture solution for future reference?

This embodies Toyota's Kaizen philosophy of continuous improvement.

---

Remember: The goal is disciplined systematic investigation until reaching a root cause you can actually fix. Sometimes that's three whys, sometimes seven. The number matters less than the rigor of the process.