Friday, February 22, 2008

Calculating team velocity

Why is it that agile methods use timeboxes containing broadly similar sets of activities - as opposed to phases favoured by more traditional methods, which contain different types of activity in each phase through the lifecycle? A key reason is that stakeholders in the project get quicker and more effective feedback on the progress and direction of the project. As a consequence planners can judge more accurately the effectiveness of the project and what it is likely to achieve over its full duration. One of the most useful metrics planners get from each timebox is the velocity of the team. Scrum projects usually use the velocity from previous sprints to forecast their likely progress - a technique often referred to as "yesterday's weather" since it effectively assumes the next period will be broadly the same as the previous. In this article we discuss what velocity is, how to calculate it in xProcess, and how to go beyond "yesterday's weather" by calculating and using simple productivity for improved forecasting.

Velocity is defined as the amount of required work delivered per time period. In the Scrum process for example, required work is called the Backlog, and its component parts, the Backlog Items, are individually sized and prioritised. The size of an item is not the same as the effort required to complete it, though size and effort are related and may - once the velocity of the team is known - be derived one from the other (see here for further discussion of size and effort). The size of backlog items is usually estimated in a team-specific measure called points (sometimes called Story Points, Feature Points or, if related to the amount of work a team member could carry out in a full uninterrupted day, Ideal Days). The size estimates therefore really only give a relative size for the backlog items. However once a timebox has been completed - in Scrum timeboxes are called Sprints - the team has a measure of how many points they were able to complete and so have the first reading for velocity in Points per Sprint.

When using xProcess for Scrum you can see the velocity of completed Sprints from the burndown chart. For example in the Sprint shown below you can see that a total of 91 points were completed, giving the team a velocity of 91 points per sprint.

Using the principle of yesterday's weather it might be natural for the team to commit to a similarly sized set of backlog items in the next sprint. Before doing so they might be wise to look at all the history on the project. Here are the burndown charts for the previous two months, first Sprint 02 and then Sprint 01...
As we can see from the respective velocities of 40 points per sprint and 73 points per sprint, velocity is not always constant and, if we look at the reasons behind this, we may be able to forecast the velocity for the next sprint more effectively. Why did Sprint 02 for example do so badly?

Well one clue is in the dates for this Sprint. This won't be the only team to have discovered their productivity was lower between mid-December and mid-January! All the team were on holiday for at least some of the Sprint, and when they were in they probably discovered someone they needed to speak to was away, or that there were other activities they had to attend to which were not related to the sprint backlog. Another factor was that this sprint had a number of items that had been worked on but not completed at the end of the sprint. Since they are not finished they cannot be counted in the size of work "done". Backlog items like this do not necessarily get done in the following sprint since other priorities may be introduced to the team at that point. However if they are carried forward (as they were in this case), there will be considerably less work left to complete in the following sprint. This at least partially explains why Sprint 03 was such a productive one.

So what velocity should the team predict for Sprint 04? This is where other information from xProcess comes in very handy in the planning process. xProcess allows team members to record when they were working on overhead tasks (like management meetings, email and admin, training courses and office parties) as opposed to backlog items themselves. xProcess also give us information about the amount of time spent on backlog items that were not completed in the sprint.

The key metrics we want to derive in order to better predict the next sprint are these:
  • simple productivity (size of work done in points per ideal person-day)
  • overhead percentage (what proportion of people's time is applied to non-backlog-item tasks)
  • availability (when are people available to the project)
We'll leave discussion of overhead tasks and availability to another occasion, though they can be set simply in xProcess. The simple productivity measure of Size/Effort can be calculated automatically by xProcess. I say simple productivity measure since, as Putnam and Myers point out, it is more complex to derive a true process productivity for a project, taking into account that size and effort do not follow a linear relationship when the duration under consideration varies. This non-linearity can be broadly discounted however if the duration of the sprint does not vary. (One of the reasons why agile methods recommend fixed durations for timeboxes is to ensure that feedback from one timebox is applicable to the next.)

Simple productivity for a given period (a sprint for example or the whole project) takes into account all the non-overhead tasks booked to during the period. It also takes into account tasks which were incomplete at the start and end of the period. Once the simple productivity factor has been calculated for previous sprint (or for the project so far), the value can be use to set new effort estimates based on size using the Set effort to match size UI Action described in a previous article.

The simple productivity currently being used on this project is 1.0 - in other words a backlog item estimated as size 1 will be scheduled with an estimated required effort of 1.0 ideal person-days. Using this factor the current state of the burndown chart for Sprint 04 is as shown below.


However using the history from the previous 3 sprints, xProcess can calculate the actual productivity in points per ideal person-day. In this case it was found to be 0.91 - in other words historically a task of size 1 has taken on average about 8.8 person-hours to complete. Using the Set effort to match size action, we can quickly adjust the estimates of all the open tasks in the project to reflect this factor. Once all this is applied (see burndown chart below), the state of Sprint 04 now reflects the true situation that certain tasks are at higher risk of not completing.

Post a Comment