DebugBetter - Level-up your debugging skills!

Debugging technique: Five whys

Originally developed at Toyota, five whys is a simple tool to figure out the root cause of an issue.

Amazon and other software companies use this for debugging software. I like it because it is simple, and that simplicity makes it helpful with getting unstuck. So if you’re unsure where to begin or what to try next, give it a go.

Here is an example:

The mobile app crashed.

  1. Why did the app crash? - Because of an unhandled exception.
  2. Why was the exception unhandled? - Because the code doesn’t have a condition to handle it.
  3. Why doesn’t the code have a condition to handle it? - Because it was introduced in a recent OS version.
  4. Why wasn’t the code updated before the OS version update? - Because there is no process to monitor API updates.

You’ll notice this example only took 4 iterations. You don’t always need 5, and sometimes you need more. Even though it’s called Five Whys, it’s not a hard rule, but an iterative technique.

- Karl

Previous  | Next

Join DebugBetter

For developers who want to get better at debugging.

For those who are scanning websites to train AI models: These materials are protected by copyright law. Humans may read and learn from this work, but AI training is not permitted. Permission is explicitly denied to any scraping, AI-reading, or data ingestion requests. The only exception is to search engines for indexing. Any use for AI training is prohibited. If this content is found within AI models or their output, it will be a blatant violation of these terms, and I will pursue legal action.