Another question came up about estimation of budget and time plan estimates for a project. In my answer, I stated that the ground knowledge for time estimate was experience. Does anyone knows a more rational mean to get an estimate the duration of a programming task?
Academically-speaking, there are several approaches to forming an estimate. The actual model used probably combines one or more of these approaches.
- Expert judgement - Ask someone with experience.
- Regression - Compare future work to past work. Here, you need to have actual durations from past work. Usually this is a mathematical model of some type.
- Case-based Regression - Find something similar that has a known duration and adjust for differences.
- Analogy - Characterize the project by attributes from similar projects.
The important thing to remember is that it is impossible to derive an exact value; Steve McConnell covers this very, very well in his book "Software Estimating: Demystifying the Black Art." Your estimates will get more and more accurate the closer you get to completion as unknowns become "knowns."
Steve McConnel has a great book called "Software Estimating: Demystifying the Black Art." It's great. I read one chapter; he talks about multiple techniques you can use.
One is "decomposition." If your task is to code 10 widget classes, and historically it took you 2 hours to code one widget class, 2 * 10 = 20 hours estimated time.
That, along with more traditional estimates (like analogous estimating -- estimating based on similarity to a known task, three-point estimating -- using best/worst/average case estimates, etc.) should suffice you.
That, and a good ol' dose of experience.
When you are estimating, you are trying to predict the future. There is no fail-safe way to do this. A controlled method that is iterative, performed by several "experts", using multiple approaches--e.g., historical values, parametrics, top down, bottom up--validated by a rigorous simulation will produce the most credible results. Unless you cook the books, you will not meet your target with zero variance. You will finish some in less time, and others in more time. Capture those results and use them in your analysis for the next estimation, but do not chase those numbers.