Tuesday, March 12, 2019

Alternatives to Estimating Bugs

This question frequently pops up, especially when onboarding new teams. Let's first level-set what we mean by "bugs" in this context. A bug is a software defect that causes undesired and unexpected behavior.

Here are some reasons why including bugs in estimations might not be the best approach:

  • Unpredictable Complexity: Bugs are inherently complex. As Bob Hartman famously said, "There are only two sizes for defect fixes: trivial (because I already know what's broken and how to fix it) or infinite (because I have no idea what's broken or how to fix it)."  Estimating something with an unknown root cause and solution is challenging.
  • Limited Business Value: Bugs are flaws, not features. Ideally, customers shouldn't pay extra for fixing what should have worked from the start. While critical bugs require immediate attention, fixing them should be seen as part of the original development effort, not something with separate value.
  • Misleading Metrics:  Estimates are meant to be forecasts. Estimating bugs can distort metrics by double-counting effort.  The original user story should have already accounted for the possibility of bugs. Spending time estimating a bug's complexity might be better spent fixing it directly.
  • Focus on Fixing, Not Estimating: If a bug is critical, it needs to be fixed ASAP, regardless of the time it takes. Prioritize fixing critical bugs over estimating them.


Why Estimating Bugs Can Impact Your Scrum Process

The Scrum Guide doesn't prescribe specific estimation techniques, allowing teams the freedom to choose what works best.  However, some argue against estimating bugs because it can negatively impact Scrum practices:

  • Unpredictable Velocity:  Estimating bugs can make velocity an unreliable measure of predictability.  Even with a good team velocity, unexpected bugs can derail sprint plans.
  • Focus on Delivery Over Value:  If the goal becomes meeting pre-defined velocity through bug estimation, it can overshadow the true value delivered in each sprint.


Alternatives to Bug Estimation

  • Preventative Measures: Implement strong quality checks like TDD, pair programming, and CI/CD pipelines to catch bugs early and minimize their impact.
  • Prioritize Bug Reporting: Encourage clear and detailed bug reports with evidence to aid in prioritization and estimation during refinement meetings.
  • Handle Bugs During Sprints: Decide whether to fix low-priority bugs encountered during development immediately or create a backlog item. For critical production bugs, involve experts to estimate the effort and update the estimate as work progresses.
  • Allocate Dedicated Bug Fixing Time: Set aside a predefined amount of time within each sprint specifically for bug fixing. This could be a fixed percentage of the team's overall velocity (e.g., 5%) or a dedicated buffer in the sprint schedule.
  • Placeholder Estimates: Consider using a placeholder estimate, like 0.5-1 day, for each bug. This approach, suggested by Jeff Sutherland (co-creator of Scrum), leverages the fact that many bugs are relatively quick to fix (as evidenced by Steve McConnell's claim in his book Code Complete that 85% of bugs are fixed in under a few hours). This simplifies estimation without overly inflating effort.


There are strong arguments against estimating bugs.  These are just a few examples. While Scrum allows flexibility in estimation techniques, considering the arguments above, focusing on quality practices and efficient bug handling might be a more effective approach for your team. 

Can the EU Compete?