将 bug 修复纳入 Scrum 过程的最佳方法?

在过去的几天里,我一直在学习和阅读关于 Scrum 的知识,以及 Sprint 规划和任务的知识。我突然想到的一个问题是如何处理 Scrum 中的 bug。Henrik Kniberg 在他的书 来自战壕的 Scrum 和 XP中列出了一些处理这个问题的方法:

  1. 产品负责人打印出来的最多 高度优先的吉拉项目,带来 他们去参加 Sprint 计划会议, 然后挂在墙上 连同其他的故事 (从而隐含地指定 这些项目的优先次序相比 其他故事)。
  2. 产品所有者创建引用 Jira 的故事 例如: 「 重要的后勤部门报告错误, Jira-124 Jira-126 Jira-180”。
  3. 修正错误被认为是 在 sprint 之外,也就是团队 保持足够低的聚焦系数(对于 例50%) ,以确保他们 有时间来修复错误,那就这样吧 只是假设团队会 花一定的时间 Sprint 修复了 Jira 报告的 bug
  4. 把产品待办事项交给吉拉 (例如,抛弃 Excel) 就像其他故事一样。

这是否真的需要根据每个项目来决定,还是有更好的解决方案?我可以想出每种方法的问题。这些方法中是否有最佳的混合方法?在你的项目中你是如何处理这个问题的?

39063 次浏览

There is no one size fits all solution and each project is different. Bugs might also be categorized from mission critical to hardly worth fixing.

Unless critical to the running of the system, I prefer bugs to become story cards. That makes the priority of feature development vs. bug fixing really explicit. In a scenario where bug fixes are considered to be "outside of the sprint" the bug fixing might move toward fixing really trivial bugs while really important business features aren't being developed.

We've gone trough a number of permutations before setting on the bug as a story approach. Try some different things and replay them at team retro meetings.

In our case (greenfield development, 2-3 devs) found bugs are written down, marked clearly as a bug and based on their severity they are assigned to next iteration or left in the backlog. In case of critical and urgent bugs they are added to the ongoing iteration.

This is a very good question and I have some observations when it comes to different approaches to this problem.

  1. Treating all bugs equally with backlog items might sound like a good idea in theory (work tracked in a single place) but doesn't work well in practice. Bugs are usually low-level and more numerous, so if you create an individual user story for each bug then the "real" stories will get obscured soon.
  2. Explicit time in each sprint reserved for fixes is fine if done in a way that is visible for the product owner. Bugs should be mentioned during the daily scrum and discussion about bugs fixed should occur during the sprint review. Otherwise the product owner won't be aware of what's going on in the project.
  3. Putting the whole backlog in bug tracking tool leads to the same set of problems as in 1. Moreover most bug trackers are not designed with Scrum in mind and using them for this purpose can be painful.

The solution we found the most satisfying was to put a single user story called "Tickets" or "Bugs" on every sprint. Then such a story can be divided either into low-level tasks describing a particular bug (if known during planning) or meta-tasks reserving a given number of hours for general bug fixing. This way the product owner has visibility into the process and the burndown chart reflects the progress.

Just remember to mercilessly close all "bugs" that are actually new features and create new backlog items for them. Also make sure to fix all the bugs reported against the current sprint before the sprint is over in order to consider the sprint as done.

Don't track defects on a list, find them and fix them -- Mary Poppendieck

Indeed, If inventory is waste, what about an inventory of defects...

That's why I always try to implement a Stop-the-Line mentality with test-driven development and continuous integration, so that we find and fix most defects instead of putting them on a rework list.

And when defects pass through, we fix them before writing new code (stories with bugs aren't done anyway). Then, we try to fix our process to make it more mistake-proof and detect defects the moment they occur.

Actually I think that best is answer by jpeacock from this question Do you count the hours spent on bug fixes towards the scrum?

Let me cite it:

  • If the bug is easy/quick to fix (one liner, etc), then just fix it.
  • If the bug is not trivial, and not a blocker, then add it to the backlog.
  • If the bug is a blocker then add a task (to the current sprint) to capture the work required to fix it, and start working on it. This requires that something else be moved (from the current sprint) to the backlog to account for the new hours because your total hours available hasn't changed.

The first step is to define what a bug is. I teach that a bug is only a bug if it is functionality that does not work in production as it was intended/designed. These become bug type PBIs to be prioritized against new development. Missing functionality in production is a Feature and becomes a normal product backlog item. Any defective code found during a sprint is considered incomplete work and since you don't move on to the next story until the current one is done-done; it is unnecessary to track these defects in the sprint as the team is always working on the offending code. Post-its can be super handy here for quick reminders between team-mates. Fixing broken code always takes precedent over writing new code. If the defects are due to misunderstanding the story then you need to work on your conditions of acceptance before starting the story.

Inventory is waste. Bug tracking is inventory. Bug tracking is waste.

Treating all bugs equally with backlog items might sound like a good idea in theory (work tracked in a single place) but doesn't work well in practice. Bugs are usually low-level and more numerous, so if you create an individual user story for each bug then the "real" stories will get obscured soon.

If you have that many more bugs than features then you need to work on your engineering practices. This is a smell that something else is wrong and tracking is not the answer. Dig deeper. Actually bugs are always smelly. They aren't cool and if you have lots of them you need to find the root causes(s), eliminate those, and stop focusing on tracking bugs.

I don't know why something as simple as fixing bugs is complicated with rules.. Scrum has very few rules, remember? Every feature, Support, Recommendation or Defect is a Backlog issue in Scrum, there is no differentiation. So, as the Scrum guide says: the tasks in a Sprint are never limited to what you decide during the planning meeting the Daily Scrum helps people discuss "impediments" along their way.

Why?

So you discuss and think rationally as a team if you want the defect i.e. backlog issue to go into PBI or remain in this Sprint and deliver it...

Better question is how do I stop creating bugs in development phase? see--> http://bit.ly/UoTa4n

If you are identifying and documenting bugs you will have to triage and fix then at some future time. This leads to "stabilisation sprints" i.e. one whole sprint just to fix bugs. Or you can add them back to the backlog and prioritise them as part of some future sprint. It also means that you will are providing and expect to get signed off and released software with known bugs in it (P3 & P4 aka cosmetic and minor).

This is not really agile?

I have tabled the idea in our project to introduce a short bug fix sprint every third sprint. Our current sprints are three weeks.

The idea is that it will allow all dev to focus on bug fixing together, allow focus on just new stories in regular sprints and keeps a regular focus on reducing tech debt.

Bug fixes will be grouped into relevant stories and prioritised. Emphasis is not on sizing before the sprint as devs struggle to size bug fixes without getting stuck in to understand the nature of the defect.

Has anyone tried this or have any feedback on how they think this might work?

Cheers, Kevin.