Saturday, May 21, 2011

Velocity, handle with care


You have to drive this road, it's full of impediments:


this is your truck, it's loaded with technical debt, you have no choice other than bring it with you:


would you swap your truck with this car ?

obviously not. You don't need more horsepower, you need to clean up and "tune" your road (process) and get rid of technical debt first.

In Agile, Velocity is supposed to help teams in being more predictable. 
Velocity measures how many units of estimation are completed in a given interval of time.
Units of estimation can be ideal time, story points, whatever.
Story points are the typical choice so it is pretty common that velocity is expressed as story points per iteration.
The idea is that looking at past average velocity it’s easy to “predict” the number of story points that the team will complete in each iteration.
Unfortunately things are not that simple.
Here are some thoughts and remarks about velocity and why you should not rely too much on it.
First ask yourself these questions:
“are we going in the right direction? how much value are we really delivering?”
This implies knowing the product vision (we all do, don’t we?) and constantly verifying that our results are aligned with that vision and valued by customers (let’s assume that we know how to measure value, unfortunately this is yet another tricky issue).
Being fast but producing functionality that is not valuable to the user is waste.
Velocity can never be constant due to inevitable fluctuations:
- Incomplete/Rejected stories (a sprint could also fail completely leading to a zero velocity)
- Wrong task/user story estimations. Over or underestimating means that sprint velocity can be significantly different than expected. (estimation is yet another tricky issue, more about this in another post)
- Dependencies (i.e. having to wait for other tasks to complete). Dependencies should in general be avoided, but this is not always feasible.
- Impediments. i.e. server failures, missing/malfunctioning tools, …
- Changes to the process that could cause temporary rundowns
- Unplanned bug fixing activities (i.e. to address blocking/urgent defects)
- People added to or removed from the team
- People being sick, on vacation, etc.
Average velocity is supposed to balance these variations. However events like a failed sprint can impact it very badly.
Velocity figures can be biased in many ways:
- people working overtime
- taking short-cuts, i.e. adding technical debt
- stories not really “done”
People cannot work overtime forever, technical debt will eventually slow down development etc.

A quick note about acceleration: it has been suggested  (i.e. metric acceleration) that teams should constantly improve/increase their velocity. I don't buy this. If you keep accelerating the end result is invariably a painful crash. BTW  sustainable pace is one of the 12 original Agile principles. I would forget about acceleration.
However, velocity can increase in discrete steps. This happens as a result of process improvement initiatives and actions usually agreed upon during Retrospectives. The following figure shows what happens in these cases:
 

In general you should look beyond velocity and focus on the tuning and optimizing your process (BTW "see the whole" is one of the key Lean Principles). 
Velocity should never be a target, people change their behavior when they know they are measured. That’s a recipe for gaming. i.e. you assign more story points to each story et voilĂ  you are instantaneously faster It’s even worse if you try to measure individual velocity (a definite no-no).
Setting velocity targets can generate additional bad behaviors like increasing effort spent on estimating. People wants to be extra-sure that estimates are correct so that velocity is calculated correctly. This is a stupid waste of time and money.
*there is a simple way to avoid all these troubles with velocity: if you can, just avoid estimating stories ...

Final thoughts
Velocity does not imply effectiveness: being very fast but not doing the right things and/or not adding business value is worthless.
Remove impediments, tune-up your process, get rid of technical debt. Focus on these goals and ignore velocity. After you have done that, than you could try to look at velocity figures (but check *).
And remember once again: sustainable pace is one of the key agile principles.





memorable quotes from xp2011


I have been at XP2011 in Madrid and it's been a great conference.

Here I am listing some of the great quotes I heard at sessions I attended (I already twitted some of them @mgaewsj ):
Help people jobs suck less B Marick about the role of Agile (managers)

In which world would this work ? alas in which universe would this make sense? E Derby about questioning (stupid) corporate policies, rules, manager’s decisions, etc.

Optimize for Business Value is fantasy D J Anderson

Multitasking is a fact of life D J Anderson about context switching, limiting WIP

Just pick a number and see D J Anderson about finding optimal WIP limits

Don’t call them user stories D J Anderson about differentiating requirements/work item types based on their source and destination (Strategic Product Requirement, Sales Requirement, etc.)

Servant Leader = Saint with Budget Authority B Marick about the role of managers in an Agile organization

Let the customer do estimation, he cannot be worse than a manager D J Anderson about avoiding spending (wasting) time estimating

Product Owner is a boundary object B Marick about the PO role in between business and the development team

A PO is better than a requirements document: he can talk B Marick

Legacy is not just code, it’s a mindset GeePaw Hill 

Sometimes the best thing you can do is help people quit JB Rainsberger about coaching in problematic organizations

One day people will laugh about this … Why not now? R Davies about coaching in large (difficult) organizations/difficult transitions

Testers have the most evil minds in the universe L Keogh

When you have specs you stop thinking L Keogh

Resources are Fixed cost items in a high cost country K Vilkki about how corporations “value” people resources

How should managers learn to manage? treat employees like volunteers M Poppendieck

Backlog items == rocks in the asteroids game: break them one at a time L Keogh

Bugs are scenarios we didn’t write down => we didn’t know we didn’t know L Keogh

Pushing = guessing, use pulling to avoid this L Keogh

Metrics should have an expiration date A Dhondt

Enterprise Kanban is just Kanban in SOA D J Anderson about scaling kanban

BBC Worldwide got the Kanban “flu” M Senapathi about the successful transition to Kanban at BBC Worldwide

Let’s keep agile weird B Marick about avoiding Agile being swallowed by mainstream corporate culture

Deep Legacy = Permanent Emergency GeePaw Hill

Switch from "I typed more code" to "I helped the team most" GeePaw Hill about pairing sessions

Detail is the opposite of Value J Brodwall about writing user stories and scenarios

In BDD e ATDD we test our understanding, not the code L Keogh

Conversations are the most important thing in BDD, tools are killing this  L Keogh

Testers are problem finders, not problem solvers L Keogh

Requirements are product design decisions that software team doesn’t participate M Poppendieck

A good stage-gate process allows feedback loops M Poppendieck

Stage-gate process should not keep you from going everywhere, just keep learning M Poppendieck

Busy does not imply getting things done M Poppendieck about having people work at full capacity (no slack time)

Being two months late on a big project is much more costly than letting people have slack time (and be available if needed) M Poppendieck

Assume you got it wrong L Keogh about looking for feedback (not validation) about your BDD scenarios

Users stories focus just on users, scenarios include many different views for each different stakeholder L Keogh about BDD scenarios vs User stories

Real Options are the hearth of BDD L Keogh

Focus on similarities J Eckstein about dealing with cultural issues when managing large distributed teams