If estimation is harmful… then, what’s not?

Or leaner Agile – part II
(Part I is here)

During conversations with a couple of co-workers about estimation (after writing this), we were all reminded of strange situations where estimation went haywire. Here’s an example. I was with a small team at a potential client and we had been creating a proposal for a fairly simple project. We intuitively felt that it would take the four of us about 3 months to get done and our high-level estimates validated this guess. However, the project-management team wanted us to break things down into a more granular level, to ensure nothing was missed and so on. Which was fine, and so we did. When we re-estimated the smaller, lower-level tasks, we ended up with a total of 8 months for the same team. No one could really argue with that, the cards were all laid out on the table. We didn’t get the project, a competitor came in and did the project in about four months.

I’ve heard several war-stories that talk of how people break things down, analyze them to death, and then estimate for worst-case scenarios. Then they pad the estimates, sometimes at all levels – at the task-level, at the story-level, and at the project-level. This simply bloats the estimates to a bizarre level. In the case where the estimation is being done by an external vendor, they often risk losing the work. When this is done by an internal, and often captive group, the customer is left with little choice. They budget for the bloated estimate, get the money approved, and end up spending it. After all, no one ever got in a fight with Mr. Parkinson, and won.

We also talked about times where teams spent more time breaking things down and estimating them than they spent to actually implement the darn thing. All fun stuff.

These stories make me think of Heisenberg’s uncertaintly principle – the very act of trying to measure something seems to change it. Obviously this doesn’t quite fit what we’re talking about here, but still… I’ve seen people break things down into minute tasks – and then when they begin to assign time-based estimates to them, they still go with fairly large units of time. Maybe half-day units or sometimes a couple of hours. And then, next thing you know, 2 or 3 simple tasks take up an entire day…

Of course, in certain situations, there is no option – you just have to break things down and make your best guess. This is especially true for vendors bidding for projects. When you’re not in this situation, however, there really is little benefit of taking this approach. Collaborate with your customer instead – do high-level estimates for baseline sizing, get a team together and get your hands dirty, then make claims about when you might be done. This will definitely work better – and will allow the customer to be more involved in the whole process – and they’ll be able to give feedback about what they really want, based on their involvement with the evolving software. In other words, keep it simple – just use your velocity to determine when you might be done. If I have 700 points of work (high-level estimate), and after four iterations I’m doing about 60 points an iteration – I think I’ll be done in another 8 iterations! Quite simple!

And by all means, revise your high-level estimates ever so often if you so wish to do so. Every time something changes or a risk becomes a reality or scope changes or your architecture group changes direction – take another pass at the sizing exercise – and derive a new answer. Just keep it quick and simple, your answer will probably be close enough to the answer you’ll get with more detailed (and more painful and more expensive) analysis.

The trick to this, of course, is to step away from time-based estimation. When people think of time-based estimates, they begin to practice defensive-estimation – and pad estimates “just to be safe”. This is done almost unconsciously, and also quite casually, so much so that it seems perfectly natural. And it adds up. So, by using story points instead, one can easily side-step this issue. The theory is that although the end goal still is to answer the question “what will it take (in terms of time, resources, money)?”, using story-points splits the answer into two parts. The what, and the how much. Story points address the what – by only focusing on the relative complexity of the work. It also has other advantages. The second part of the answer manifests itself after a few iterations – you divide the total number of estimated story points by the team velocity to get an approximate duration. Again, pretty straight-forward.

P.S. – Finally, buffers have their place, since a system with no slack can’t cope with change. However, that is a topic for a different post.
(Part I is here)

Estimation considered harmful

Or leaner Agile – Part I
(Part II is here)

This is a rather long post on a topic that has sparked many arguments whenever anyone – colleagues or friends – brought it up. It is about applying a key concept of Lean to, what some may consider, a rather extreme degree. And I’ll admit this – the title is a little misleading, and deliberately a bit inflammatory. Anyway, here goes…

The what

I want you, dear readers, to walk with me. Walk with me and follow along as I travel the path of an imaginary project that we, as forward thinking Web 2.0 visionaries, take from an idea stage through to construction. And during this journey, I want to show you what place estimation as a practice ought to occupy in the ideal software development life-cycle.

So, first we need an idea. Hmmm, a quick look around tells us that a mobile social-networking website would be cool – it would be just the thing to get easily funded, and hopefully, bought by Google in short order. Having satisfied ourselves that this is a solid business plan (the VCs are happy with it), and that it’s (clearly) bound to work, it is now time to get started on getting the thing built.

Now, what features should the site have? Since we are the founders, we brainstorm among ourselves, and since we’re hip, we even ask a couple of potential users to participate. At the end of the day, and after a long and grueling session of arguing about what’s useful to teenagers and what isn’t, we have a nice, shiny list of stories. Again, since we’re hip, we decide to call it our Master Story List.

The how much

OK, how much money are we going to need? And when can we launch the first release? Certainly, our friendly VCs will ask us such questions. Hmmm… time to call in the cavalry. Through our connections, we hire the best developers we can find. We also hire a couple of QA folks. Since we plan to play the role of the business-analysts ourselves, we have a full quorum. We’re ready to do some estimation. We don’t really know too much about the system, at least none of the specific details, and nor do we know exactly how certain things are going to be implemented. What we do know, is at a high-level – what we want built and what each feature might look like. With this input, and with the years of software development experience that the development team has, we assign story-points to each requirement on our Master Story List. After another couple of days of intense sessions (discussing and arguing about what each feature is, how it relates to the market and to other features, and how it might be implemented and so on) we finish our first cut of the sizing exercise. Our story-points have a simple scale (lets ignore unknowns for now) – 10, 20, 40, and 80 – where a 20 was a small story, 40 a medium, and 80 a large. A 10 was assigned to really simple stories. When we added everything up, we had a total of 13,340 story points.

Wheee! We’re done estimating! At least for now. Again, from all the experience that we have as a group, and from our best guess of how things might go on this particular project, we think we can get 600 story points done every couple of weeks. The full project now appears to be about a year in length. We also want to do multiple releases so we can release something quicker. So we pick the features that we think we absolutely need for the initial launch, and it turns out to be about half the overall set. We therefore plan for a six month initial release, followed by several shorter releases. We’re ready to go!

By the way, when we spent those few days locked inside the conference room discussing features and so on, we also derived a list of questions, assumptions, and risks. We’re going to use that list as a starting point for our project-long risk-management activities. We’ve got all of it written down (in a nice Excel spreadsheet, no less) and the plan is to update and monitor everything on a weekly basis.

Go! Wait! Iteration planning

So – we’re ready to start! We bite off a bunch of work that we think we can get done in the first couple of weeks – and the developers go at it. How exciting! Now, we’ve read books on Agile software development, and some of them recommend that at the iteration planning session, we should re-estimate those stories that are planned for that iteration. They say that this detailed, more granular, task-level estimation is a key part of the iteration planning meeting (IPM), or sprint planning meeting. Much of the literature also says that we do this second level of estimation in real units of time (as opposed to the story-points we used earlier) – so that we can plan iterations better, and track progress better.

We think about this – and question the value of this effort. We already know what needs to be built – for this sprint and for the release. More accurate estimates will not change the amount of work, much less reduce it. So we decide to save the half-day or the whole day that the team might spend discussing design and implementation details to get at the more accurate estimates (wow, that’s some oxymoron, huh?) All that stuff changes the minute someone writes the first bunch of code, anyway. So we decide to let the code, and hence the software, speak for itself. We let the developers do what they do best – we know they’ll use good software development practices to ensure high quality. The QA folks are here to test the application as well. The actual working system is what matters, anyway!

We do, however, ask the development team to break things down into manageable chunks of work – in other words, they task each story out. This is useful to them, because it helps them think through things, and keeps them focused throughout the implementation of each story.

Keeping it simple

In making the decision of not bothering with more detailed estimates, we also thought of this – there are only two things that we can play with – scope, and schedule. Quality has to be high – that’s non-negotiable. We’ve hired good people – they’re enthusiastic about the project, and they care about their craft. We’re sitting in the room with them, and helping move things along whenever they’re blocked on things. If we want to get done quicker, the only option we have is to pull stuff out of the release plan. If we want all the stuff that we had decided on, no matter if things take longer than we hoped – the only option we have is to delay the release. It’s that simple.

Remember the old days, before this whole Agile thing, when people thought that the way to control the complexity of building software was to freeze requirements before starting work? That didn’t work so well, did it? Today, another delusion persists in the minds of many managers – that of being able to predict the date of completion with accuracy. Just like the weather (the most powerful supercomputers can’t predict weather with any accuracy more than a few days out, and they often get it wrong anyway), software is too complex to think that by controlling a couple of variables, one can control the trend-line. Even that control doesn’t have predictable results – by de-scoping a complex story (whatever complex might mean to you), is there a quantifiable way to say how much time was saved? Or by re-factoring a gnarly area of code, can you tell how much efficiency was gained?

Why do we still persist in trying to adjust for velocity, drag, complexity, performance, estimates, re-estimates, actuals, rate of scope increase, etc.? Why do we expect that by running massaged numbers we can produce the date? After all, what software team ever announced a date that they actually met? These days, many companies just stick the number of the year at the end of the name of their product – Office 2007, Windows 2003, Pocket PC 2006. They’ve given up the charade – they’re now saying they’ll just deliver it sometime in the year. Just keep your fingers crossed.

So now what?

So then the question becomes, if the software development is going “slow” (in other words, estimates turned out to be just that – estimates), when will we be done? And can we do anything to speed things up? The answer to when comes from the story-points we’d assigned to every story coupled with the data we gathered over the past several iterations. If it appears we’ve been getting done only 450 points each time, then, hmm… we’re going about 25% slower than originally “planned” and realistically, our six month release is looking more like an eight month release. Again, fairly simple math gave us the answer. The second question is also fairly simple – and in fact, it has nothing to do with estimation at all. It is a quintessential question about software development – how can we deliver faster? We can’t answer that – maybe no one can. Doing things right, hiring smart people, these things help. For now, we either accept a delivery in about 8 months time, or we trim scope.

The thing to note, also, is that if we’d spent the time to do detailed estimation (at the task level for each story in the sprint) – we’d have lost another half-day to a day every iteration, and we’d still have no real change in the outcome. Sure we’d have data as to how accurate (or entirely off) our development team was with their estimates, but that would be about it… it wouldn’t change the amount of time they’d have taken. And we’d be short about 5 to 10 percent of the time to actually build the software. Oh boy, we sure made a good decision of not going even slower!

Some books on Agile also talk about how important the planning meeting is… what with the estimation effort, and the communication that goes on during it. If you’ve been following along, we just thought through why detailed estimation is a wasted effort. Now lets talk about the communication aspect.. The theory is that this meeting allows developers to find out what other developers are working on, and also gain understanding about the other areas of functionality. All this as the business analysts drone on about how this feature or that. Didn’t we catch sight of those two QA people dozing off? And that developer? Some of the other BAs looked pretty bored too… the reality is that long meetings are not good forums for anything, much less exchanging information about something as complex as software. When developers are curious about someone else’s code, they bother each other, and talk about it at a whiteboard – our whiteboards are always filled with the remains of all these technical discussions… squiggles that only mean something to the techies.

Re-estimation

The literature also points us to another advantage of detailed estimation and re-estimation. The idea is that if we keep careful notes (and numbers) about what and how the team originally estimated each type of story, then if certain estimates were consistently off, we could go back and fix those types of estimates across the project. Thereby, we’d improve the accuracy of the end date quickly and easily. This makes several assumptions – the biggest one is that the original estimates were all consistently inconsistent. Ouch, now we’re in the land of mirrors. Not only were they consistently off, but they were consistently off for the same reason – a leap of faith, really, given all the variables.

Now, I’ll admit, I don’t see any reason not to try and “fix” incorrect estimates, especially after you know more about the system. It’s just that you don’t need the whole detailed estimation waste-of-time for this (or actuals for that matter – they’re evil also and I’ll talk about them another day). Any good development team will realize that certain estimates were made on an assumption that was wrong (or whatever), and will provide information that will enable management to go back and correct for such things. This is just a normal and an everyday software development activity – you make an assumption and move ahead, when things change, you go back and adjust. Normal communication habits are all that one needs. Some people say developers are not capable of doing this – they only care about writing code. They say they’re geeks and don’t know how to communicate, and don’t know what’s important to management. I’ve even heard that you can’t trust developers to raise visibility of such things cause it’s like admitting a mistake or something. Oh boy – if you have such developers, your project is doomed no matter how good the estimates are.

However, like I said, there is value in going back and correcting your plan based on more information or a risk being realized. Again, this should happen automatically, every day! This is also a happy side-effect of the regular risk-management sessions we talked about earlier. Finally, just like quality, risk-management is everyone’s problem.

Further planning

One more question that invariably gets asked when this topic is being discussed: OK, so if I go with this approach, then how do I know how much functionality to plan for in a given sprint or iteration? I have two answers – the first is to simply use yesterday’s weather – if you got done 500 points last sprint, try the same thing this time. If half your team is going to be gone on vacation, try shooting for 250 points. Again, simple and as effective as anything else.

The other answer is that iterations are evil, they add no value, they’re considered harmful, and should not be done. But that’s fodder for another post.

Anyway…

So this is my pitch about why detailed (or task-based) estimation is in general a waste of time and resources, and is a contributing factor of a lowered velocity (the 5 to 10 percent we talked about, depending on how much time is spent every iteration, more thanks to the interrupted flow) . It also adds an unexciting element to the software development process that adds no value to the actual deliverable.

So, do I believe that all teams ought to abandon low-level (or detailed, or task-level) estimates? No – I believe this is an advanced technique – and can only be applied effectively if all the players in the development team truly grok software development. It assumes that all players are equally enthused by the art of building software, and are engaged in the iterative process of development that is Agile. If your team is just starting, or you have team members that aren’t experienced using Agile techniques, and especially if you have a project manager that doesn’t fundamentally understand agile and/or lean software development, then you’re most definitely better off doing things the traditional way – and estimating at the task-level.

For others, here’s a way to trim some muda off your process. Flame away.
(Part II is here)