Today I'd like to share with you a really important aspect of Agile software development - how to account for bugs in your daily plans.
I am frequently asked by teams I consult with how to deal with bugs if you're Agile and using Scrum. Questions like the following come up time and time again:
"Should I track hours burned fixing bugs?"
"Should the hours burned on fixing bugs count toward my Story Point velocity?"
"When do you schedule bugs and should this be done during Sprint planning?"
My company is often working on many simultaneous projects and having to juggle resources. To get everything done on time and bug free requires careful planning. As a result we have to ensure that we're considering all aspects of software development including bug fixing. Bottom line is Bugs take time to fix and so you have to account for them. If you don't, you will have an inaccurate measure of your teams productivity - something that will definitely lead to poor planning and late deliveries. (....read more)
Time to fix bugs therefore, should come out of your teams available capacity. So when one schedules bugs to be fixed, bugs should be estimated just like you do with tasks on the sprint backlog. Developers must therefore determine for each bug scheduled, the hours remaining to complete the bug daily. And this WILL be reflected in the daily burn-down along with tasks.
Essentially teams have a certain capacity i.e. available time during the week to do meaningful work. This can be calculated as follows:
(# of team members) * (# days in the week) * (hours in the day) = capacity
You should however modify the capacity to reflect reality (time spent in meetings, doing email, vacation etc) so this can get quite complicated. The best thing to do is to figure out what percentage of time per day you get real work out of the team on AVERAGE.
At our company we work on a 4 or 5 hour day therefore:
Actual Capacity = Capacity * 0.5
Once again, don't get hung up on being extremely accurate as this all averages out in the end. Just be reasonable in your approach. If you want to take vacation into account etc one can get quite fancy about this, but usually a rough estimate works fine. It does for my team.
The time spent resolving bugs however should NOT be counted towards the Teams overall Story point velocity. i.e. I'm not going to give my team credit for buddy code!
Bugs should be scheduled into a sprint or iteration along with user stories during the Sprint planning meeting. So the total time to implement tasks and fix bugs should not be more than the available capacity you determined for the Team (See above capacity calculation). Note that this total time in hours is the intersection with the Y-axis on your burndown.
I know many coaches will argue that bugs should be tracked seperately and that bugs should be dealt with in the sprint that they're found. However in practice this is not always practical. Try it, and you'll improve your teams predictability significantly.
Next week I will give a detailed account of how we do Planning.
If you have any questions about Planning or Bug Tracking in general or if you have strong opinions on this topic, please don't hesitate to pitch in!
Comments
Counting towards velocity
February 27, 2009 by Mike Evans (not verified), 1 year 2 weeks ago
Comment id: 2292
If you do not count bug fix work toward your overall velocity, how do you accurately choose a work-load at the beginning of a sprint? This would be most problematic for team just starting out. I'm not sure I understand the necessity of the capacity calculation. If you account for all work done in your Velocity calculation you could use that figure (adjusted for vacations, etc..) to judge how much work can be done. If you are not using Velocity to judge sprint workload and translate all work into hours before judging how much work can get done in a spring, what are your points used for? A pat on the back for how much non-bug work we got done in the sprint?
Assume that the team is consistently committing to 20 story points and 5 points worth of defects. In iteration 5 they have no defects to work on (yay!), if defect points don't contribute toward velocity, they are going to commit to 20 points of story work. They will be done early and it won't be immediately apparently what happened. If the team responds at the next sprint planning meeting and selects more work, but this time has a defect to work on, they are going to fall short of their commitment.
I'm just trying to understand.
Cheers!
-Mike
Bug fixes don't count on the release burn down chart
February 27, 2009 by Dennis Stevens (not verified), 1 year 2 weeks ago
Comment id: 2293
Mike,
You are right, bugs fixes do get counted in the team's sprint capacity. You set aside a certain amount of capacity (story points per sprint) to fix defects from old code. You estimate bug fixes in story points, and include them in the sprint. You fix the bugs and track them on the sprint burn-down. This determines the teams sprint capacity.
The distinction is that you aren't making progress if you are fixing bugs. Time spent on bug fixes is time spent not moving new features into production. A Product Owner can't determine the progress we are making towards a product release and therefore make accurate decisions without understanding the rate we can move working (bug-free) code into production. So bugs fix time doesn't count as project velocity and its not additional work on the release burn down. You get better velocity by producing less buggy code.
In the case where you get done early, you should have some extra backlog groomed and fit that into the sprint. If you are producing more production code (not fixing stuff that is broken) you get credit for it and your velocity will exceed plan. Do this often enough and you can increase velocity for planning purposes. So you know how much capacity you have, and you set some aside some of it for defects. But you don't count your bug fix time towards team velocity for product planning purposes.
Accounting for bugs and story point velocity
February 27, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2294
Awesome questions Mike. Let me try to explain ...
Story point velocity is should be used as a guide in determine how many "done" user stories you can accomplish in a given sprint. So for example, my team on Agilebuddy on average deliver 45 story points in a two week sprint. Some sprints we do more (we have gone as high as 70) and some sprints we do less. So when we do our Sprint planning i.e. selecting which and how many story points to put in a sprint we go by our Story point velocity. So in this example, we would schedule 45 story points worth of work. But, we're not done yet.
Now, we need to break those story points down into tasks and then estimate hours. Once you're done and you total the hours, you may have more or less hours than the capacity you have. Part of this process is adding up the hours it's going to take to fix the bugs as well. So the total time to complete the tasks in hours plus the total time to fix the bugs in hours should be less than or equal to the capacity you have available.
Now, if it isn't you can work with the product owner to drop a couple user stories, or drop a couple of bugs based on priority. Or your team can simply commit to having it done.
Hope this helps,
Jack
>>I know many coaches will
February 27, 2009 by Michael Dubakov (not verified), 1 year 2 weeks ago
Comment id: 2295
>>I know many coaches will argue that bugs should be tracked seperately and that bugs should be dealt with in the sprint that they're found. However in practice this is not always practical
I have just one question. Do you have Definition of Done for user stories? If you have it, how it happens that you do not have "Zero Bugs" rule in your DoD?
What Done means
February 27, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2296
Thanks for the question. Again, this is a really good one.
Well firstly, everyone's definition of "Done" is different although there is general understanding that Done includes bug fixes. However, in practice you don't always find all the bugs during the sprint. Many times you find bugs after you have deployed to production and the customer starts using it. Additionally, some bugs you may decide to push out (they may be minor).
Secondly, during the sprint, when you find bugs they need to get added just like tasks do and you need to account for how long it's going to take to fix. This will cause the burndown total hours to increase on that day they're added.
Jack
>> Many times you find bugs
February 27, 2009 by Michael Dubakov (not verified), 1 year 2 weeks ago
Comment id: 2297
>> Many times you find bugs after you have deployed to production and the customer starts using it.
Of course it happens and even more often than desired ;)
There is HUGE difference between bug found during story development and bug found by customer. I did not get the distinction in the article. Bug found during story development is MUCH easier to fix, since you have focus on the story, you know what you've done 2-3 days ago and everything is fresh in mind. If bug found next month, it will take time to switch to it, include into the new build, deliver, etc.
>> Additionally, some bugs you may decide to push out (they may be minor).
To be honest, we've tried to push out minors bugs. As a results during 1 year we accumulated about 100 bugs (with Normal and Small severity) that live in the database in Open state. Can the application run without these bugs? Yes, it can. Is it good? No, it is not. This practice does not work for us and currently we have zero bugs rule in DoD. BTW, it'll take time to get rid of all these bugs accumulated during 2 years.
>>Secondly, during the sprint, when you find bugs they need to get added just like tasks do and you need to account for how long it's going to take to fix. This will cause the burndown total hours to increase. on that day that you find them.
No objections here if you track burn down in hours. But there is a simpler approach. Normally you have quite the same development/bug fixing ratio for each iteration. So you may just run 1-2 iterations and define the time you need to fix all discovered bugs.
Finding bugs and accounting for them
February 27, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2298
We have a zero bug rule as well here at Agilebuddy. But unfortunately the realities are that not all companies can have such strict rules - although they REALLY SHOULD! It's so easy for these bugs to pile up. We also have a 100% test coverage rule by the way but in reality we're sitting at around 95%.
I personally am not fond of running specific bug fix sprints but this is an approach that many companies follow and more often than not, companies have to do it this way.
Thanks for the contribution
Jack
>>I personally am not fond of
February 27, 2009 by Michael Dubakov (not verified), 1 year 2 weeks ago
Comment id: 2299
>>I personally am not fond of running specific bug fix sprints but this is an approach that many companies follow and more often than not, companies have to do it this way.
C'mon! That's plain wrong practice! It is just a bug fixing phase in waterfall. It contradicts to agile development nature. How it sounds for example "well, waterfall is bad, but companies have to do it this way".
I think we should not try to advocate bad practices in any case, but just say that they are bad and should not be followed. No excuses.
Best,
Michael Dubakov
http://twitter.com/mdubakov
Bug sprints
February 27, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2300
I completely agree with you that it's bad practice. I am not suggesting in any way that this is what companies should do. I was just saying that there are still many companies that work this way.
Jack
concept of commitment and slack?
February 28, 2009 by Derek Neighbors (not verified), 1 year 2 weeks ago
Comment id: 2301
I like that you are talking about this subject and I'm not sure there are any "correct" answers and more ideas to implement to find what works best for you. Here are some quick thoughts I had while reading the article.
Zero Defect Mentality
The current approach you are using has the assumption that defects will continue to be found at a pace to have a sufficient future impact. I think once you take the approach that defects should really be a rare occurrence and that defect free software development is possible it will change how you manage this problem. I like the comment that talks about "done is done" problems. If you are seeing a high rate of defects when things are going into production it is a symptom that your current process is broken in some way.
Defects Should Be Estimated
I guess when you get to the point where you feel its viable to be defect free then you come to the conclusion that original story points are in fact the measure of future defect estimation. That is you do not estimate defects because it means you didn't actually correctly complete stories that had estimates marked as completed originally. If you are forced to consume those defects it gives you a more realistic picture of what your velocity really is...
Before you completely freak on this concept.. if a team starts to write sloppy software in order to increase velocity.. ie: I increase my velocity from 12 to 20, but am writing really bad software... Then bugs come back three iterations later... I am able to continue my 20 point velocity without it raising concerns because I adjust for all the defects showing up. If instead I was forced to consume them. My velocity would drop significantly. The product owner would freak and we would have to discuss why we are seeing so many defects.
Consider Slack
One thing I have seen is teams add in a small amount of slack to their iteration. So while they might be able to do a 22 velocity they commit to say a 20 instead. This allows them to deal with defects, tackle code debt (refactor), do research or deal with issues that were not for seen.
I am not a huge fan of the slack method and I hate the estimate/include method. I guess I just believe in defect free enough to inflict pain that forces us to deal with it. I loved the post and that someone is talking about it.
Zero Defect Mentality
February 28, 2009 by Michael Dubakov (not verified), 1 year 2 weeks ago
Comment id: 2302
Zero Defect Mentality sounds good. But in reality you still have errors after production. EVEN in predictable and quite easily testable industries (hardware, cars, etc) we have problems with 100K power adapters or hard drive problems (seagate recently). How can we expect zero defects in software development? It is harder to test, harder to define in details, etc (it is complex adaptive system, we can't predict al effects). So bugs in production is a NORMAL thing, we can't bring them to zero. But we can (and should) minimize them using all possible ways. Anyway, we have to deal with bugs in production.
Zero defects mentality kill motivation? ;)
February 28, 2009 by Michael Dubakov (not verified), 1 year 2 weeks ago
Comment id: 2303
BTW, quote from Lean Software Development by Mary & Tom Poppendieck :)
"One of the fastest ways to kill motivation is what is called in the US Army a zero defects mentality. A zero defects mentality is an atmosphere that tolerates absolutely no mistakes; perfection is required down to the smallest detail. The army considers a zero defects mentality to be a serious leadership problem, because it kills the initiative necessary for success on a battlefield"
Bug estimating
February 28, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2311
Thanks for all the comments to this blog.
I do want to add a little more color to this thread.
When we're estimating user stories, we estimate in story points and that estimate is a relative estimate against already previously completed user stories and is our best estimate of effort to totally complete the user story taking into account size, complexity, risk, technology, unit tests required, documentation etc... i.e. everything we can think of to declare the story as done.
During the second half of the sprint planning meeting, when we breakdown the user story into tasks and estimate the hours for each task, that's where we take any left over bugs, or bugs that were found after the fact and assign hours to those bugs as well and that is added to the total of task hours and is reflected on the burndown.
Generally speaking, most teams when breaking down stories into tasks and estimate hours they don't include hours to fix bugs that haven't been found yet. Remember that the burndown is supposed to reflect reality in real-time.
Also, during the sprint, just like when you think of a new task and you add that to the sprint backlog, when you find a bug during the current sprint, you have to add that bug and estimate it's hours so that the time is accurately reflected on the burndown. To me, Bugs and Tasks are almost the same thing and should be treated the same.
Cheers
Jack
Re: Dealing with defects/bugs and capacity planning.
March 2, 2009 by Kane Mar (not verified), 1 year 2 weeks ago
Comment id: 2314
Hi Jack (et al),
Firstly, I'd like to say this is an interesting article that raises several interesting points. Some of these points are generally agreed upon in the wider scrum community and some are not. Rather than try and address all the relevant points here, I'd like to address just two of them below:
1. My personal recommendation for *customer* report bugs (ie. existing or legacy bugs that are in production) is that they should become a story in the product backlog and dealt with just like any other story (estimate in Story Points, prioritized by the PO, etc). The purpose of this is to make them visible to the Product Owner and force him/her to prioritize customer reported defects in relation to new functionality. This is consistent with Ken (Schwabers) Squirrel Burger story.
Known bugs found this sprint (for software in development) need be fixed before a Story can be considered "Done." And, should only be accepted by the PO once it's "Done."
2. In my experience, capacity planning is best done using "yesterdays weather" (http://c2.com/cgi/wiki?YesterdaysWeather) using story points. I would strongly recommend against using hours for capacity planning, mainly because there is no correlation between developer hours and software in production (http://jeffsutherland.com/scrum/2007/10/why-time-sheets-are-lame.html).
>My company is often working on many simultaneous projects and having to juggle resources.
I may be reading this incorrectly, so please forgive me if I've taken it the wrong way ... If by "resources" you mean "people", then you're not doing scrum. Scrum teams are by definition dedicated to a team.
Best regards,
Kane Mar (CST, CSC, CSP ... etc)
http://KaneMar.com | http://www.linkedin.com/in/kanemar
http://www.twitter.com/Kane_Mar | http://www.twitter.com/AgileCarnival
Bugs and capacity planning
March 2, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2315
Hi Kane,
Thanks for your contribution. I really appreciate this.
Personally I don't like converting Bugs to User stories. However your point is a valid one in that it could help with visibility with the Product Owners. In our organization, we are able to keep them separate and plan both user stories and bugs into a Sprint at the Sprint Planning meeting.
With respect to capacity planning. This is only done for the immediate sprint. And it's only there as a guide to see if you have enough resource time to complete the backlog items (inlcuding bugs etc) for the current Sprint. When you're Sprint planning you have to get down to hours and to track hours on the burndown so this needs to be as accurate as you can get it on any given day in a Sprint.
With respect to your last comment. I was wondering if someone would pick up on that. Technically you're right. Resources need to be dedicated. In our particular case resources are generally dedicated to a Sprint but they may be on a different Project next Sprint. It's just the nature of our business.
If you saw one of Jeff Sutherlands more recent video's .. he talks about rolling scrums .. part of his scaling scrum message .. is that developers may be working on multiple simultaneous sprints. I know it's hard to wrap ones head around this but it is possible. I wouldn't advocate this though.
Jack
>>If you saw one of Jeff
March 2, 2009 by Michael Dubakov (not verified), 1 year 2 weeks ago
Comment id: 2316
>>If you saw one of Jeff Sutherlands more recent video's .. he talks about rolling scrums .. part of his scaling scrum message .. is that developers may be working on multiple simultaneous sprints. I know it's hard to wrap ones head around this but it is possible. I wouldn't advocate this though.
It seems we are falling back to waterfall and multi-tasking...
Thinking
March 3, 2009 by Marble Host (not verified), 1 year 2 weeks ago
Comment id: 2319
This post got me me thinking about using a kanban system to manage various "projects" at the same time.
Our team would be working on a number of different projects/products at any given time and managing the throughput of them as a whole is sometimes difficult (due to lack of transparency.)
http://www.marblehost.com
Have you used kanban in a environment similar to that before /?
rolling sprints/multiple simultaneous projects
March 3, 2009 by jackMilunsky, 1 year 2 weeks ago
Comment id: 2320
This is really difficult to do. I would suggest only trying this in a very mature agile company. I still believe you get the best work from focused individuals. There's plenty data out there that proves multi-tasking is not good for productivity. But, depending on the type of projects, depending on the experience of the team and it's agile maturity you could do it. Kanban's pull system would definitely help with this.
Jack
Re: Bugs and capacity planning
March 13, 2009 by Kane Mar (not verified), 1 year 5 days ago
Comment id: 2362
Hi Jack,
>With respect to capacity planning. This is only done for the immediate sprint. And it's only
> there as a guide to see if you have enough resource time to complete the backlog items
> (inlcuding bugs etc) for the current Sprint.
Estimating in Story Points and using Yesterdays Weather will provide you with exactly this information without having to resort to capacity planning at the hourly level.
> When you're Sprint planning you have to get down to hours and to track hours on the
> burndown so this needs to be as accurate as you can get it on any given day in a Sprint.
Perhaps I don't fully understand ... why do you need to get to this level of detail? If you fully plan everyones time in a sprint, isn't that likely to lead to problems? If, for example, some piece of code takes 5 hours instead of 1 hour?
>If you saw one of Jeff Sutherlands more recent video's .. he talks about rolling scrums ..
> part of his scaling scrum message .. is that developers may be working on multiple
> simultaneous sprints. I know it's hard to wrap ones head around this but it is possible.
What you're referring to here is known as Scrum Type B and Type C. It's discussed in the white paper that served as a source of inspiration for scrum: "The New New Product Development Game" (Page 3, exhibit 1)
Jeff tried to introduce Type B and Type C directly into Scrum. Mostly notably through his blog posts in 2005 (here). This was debate back in 2006 and prompted Ken (Schwaber) to post his thoughts on the subject: "I've been following the threads about type N, A, B, C and advanced Scrum. Although these may represent the engineering, personnel, and product management practices that an organization adopts as a result of Scrum's inspect and adapt, they aren't Scrum."
His position has since been widely adopted throughout the Scrum trainer community, and over time Ken's original position appears to have solidified: "There is only one Scrum"
> I wouldn't advocate this though.
Neither would I! =)
Best regards,
Kane Mar
http://KaneMar.com | http://www.linkedin.com/in/kanemar
http://www.twitter.com/Kane_Mar | http://www.twitter.com/AgileCarnival
Estimating in Story Points
March 13, 2009 by jackMilunsky, 1 year 5 days ago
Comment id: 2364
Estimating in Story Points and using Yesterdays Weather will provide you with exactly this information without having to resort to capacity planning at the hourly level.
I agree that one should use yesterdays weather to determine how many user stories can be planned into a sprint. But once you have the User stories planned, you have to breakdown to the hour. How are you working with the burndown - in story points?
Personally if you don't do this breakdown, you're putting the team and project at risk. Breaking things down is fundamentally a planning and design task which you really need to do.
Thanks for pointing out the Type B and C scrum. I know it all to well. Appreciate you add that input.
jack
Post new comment