How to Write Good Bug Reports

I’ve created and maintained several open source projects over the years, and my biggest annoyance with them is bug reports. Not bugs themselves. Those are inevitable, and the actual process of fixing them is interesting. But bug reports are another matter. Far too often, I get reports that are all but useless. They waste time and cause frustration for everyone involved. In the hope that I can reduce this, I offer some guidelines for writing good bug reports.

The goal of a bug report is to make it possible for a developer to reproduce the bug. I cannot emphasize this enough. A developer who can reproduce a bug is halfway to fixing it. At that point, they can bring their entire toolset to bear: debuggers, profilers, test cases, and lowly (but useful) printf()s. Inversely, trying to fix an unreproducible bug is an exercise in futility. Often, one ends up flying blind, reduced to changing code based on hunches and guessing. Believe me, it is not fun.

So how do you make it easier for devs to reproduce a bug? Developers know the software in question, but your computing environment is a complete mystery to them. The more they know about that, the easier it will be for them to reproduce the issue. With this in mind, reports should contain information such as:

Err on the side of including too much. It’s quite rare that I read a bug report and think, “Wow. This is way more info than I need.” Also, overcommunicating helps to reduce back-and-forth. Every reply/response cycle decreases the likelihood that a dev will get to the bottom of the issue.

Guidelines are good, but I find examples help more. I don’t want to single anyone out, but here are some examples of bad bug reports. If you see your name on one of those issues, don’t feel upset. Reporting bugs is a skill. It doesn’t come naturally. Just try to do better in the future.

What am I supposed to do with these? They don’t even describe what the problem is, let alone how to reproduce it. On the flip side, here are some good bug reports:

These are pretty close to ideal. They include everything needed to reproduce the issue. One even linked to an example file that caused the bug. The limiting factor for fixing these was me, not the reporter. That is how it should be.

Writing good bug reports requires more effort, but the payoff makes it worthwhile. Remember this when clicking, “Create Issue” and not only will you make developers’ lives easier, but you’ll improve the likelihood of getting the bug fixed.

When commenting, remember: Is it true? Is it necessary? Is it kind?

Go dark.