Should I record a bug that I discovered and patched

issue-trackingproject-managementversion control

I suppose that this is a common situation: I test some code, discover a bug, fix it and commit the bug-fix to the repository. Assuming that many people work on this project, should I first create a bug report, assign it to myself, and refer to it in the commit message (e.g. "Fix bug #XYZ. The bug was due to X and Y. Fixed it by Q and R")? Alternatively, I can skip bug report and commit with a message such as "Fixed a bug that caused A when B. The bug was due to X and Y. Fixed it by Q and R".

What is considered a better practice?

Best Answer

It depends on who the audience of a bug report is.

If it is only looked at internally by developers, to know what needs to be fixed, then don't bother. It's just noise at that point.

Non-exhaustive list of reasons to log anyway:

  • Release-notes include information about fixed bugs (to some threshold which this bug meets) - especially if there is a vulnerability exposed by this bug
  • Management wants a notion of "Time spent bugfixing" / "Detected bug count", etc.
  • Customers can see the current state of the bugtracker (to see if their issue is known about, etc.)
  • Testers get information about a change that they should test for.
Related Topic