How Programmers Miss Obvious Bugs

This article was automatically translated from Japanese by AI. Read the original Japanese version →

Regardless of the platform (web, mobile, game consoles, etc.), if you write code, you're going to create bugs. Today I want to explain why one particularly dreaded scenario happens: "right after product launch, a feature that users rely on fairly often breaks even when operated completely normally." For example, a brand-new service launching and users not even being able to get past the login screen.

Let me say upfront that there's still no silver-bullet solution to this problem. Still, this article is my attempt to explain why it happens. I hope it helps you.

To switch gears abruptly, imagine you run a business making and selling cups. Suppose the cup-making process splits roughly into two stages: shaping the cup, and painting a design on it.
First, you shape the cup. Since a cup obviously can't leak, at the end of this stage you always pour water into it to check for leaks. Once you confirm there are no leaks, you move on to the next stage.
Next, you paint the cup. The painting comes out great. However, somewhere along the way while painting it, you apparently bumped the cup against something and left a tiny crack in it—and didn't even notice.
And so, a cracked cup ends up in the customer's hands, and you get an angry complaint asking, "How on earth did you miss such an obvious defect?!"

There are a few takeaways from this story.
First, why didn't you check for cracks after painting? The answer is simple: you didn't think the painting step could crack the cup. Conversely, you did think cracks could happen during the shaping step. That intuition isn't unreasonable at all—yet in the end, it was wrong. So what should you do? Again, the answer is simple: check for cracks again after painting. However, doing that adds a non-trivial amount of extra work.

Okay, that's enough about cups. Let's bring this back to programming.

To deal with the cost of re-checking everything, we programmers have come up with a couple of approaches.
The first is to run a comprehensive end-to-end check all at once right before launch. This approach is widely used because, logically, a full integration check can only happen after development is wrapped up anyway. However, anyone in this industry knows how intense the pressure for late changes from all sides can be. Most of the time you give in, make a change after the check, and end up forced to choose between spending the cost to test everything all over again or shipping a product with bugs.
The second is automating those checks with code. From an outsider's perspective, you might wonder, "What if the test program itself has bugs? And doesn't writing automated tests take extra time too?" Explaining that in detail would make this post way too long, so I'll skip it here—but either way, it's an approach we actively invest in.

If this topic interests you, give "The Mythical Man-Month" a read. It's a historic classic that (probably) both programmers and non-programmers alike can enjoy.

The Mythical Man-Month [New Edition]

The Mythical Man-Month [New Edition]

  • Author: Frederick P. Brooks, Jr. (translated by Toru Takizawa, Yuko Makino, Noboru Tomizawa)
  • Publisher: Maruzen Publishing
  • Release Date: 2014/04/22
  • Format: Paperback
  • View blog posts featuring this item (19)