All estimates need a minimum, a likely and a maximum. What if everything goes right, the developer has the right skills, the environment is perfect and the momentum is great? Minimum estimate to develop a functionality is rarely used, but is always good to have, if only just to justify the likely. Maximum is when everything gets delayed, the worst case. Likely is ultimately the developers’ estimate.
The formula to use, to calculate the average of these estimates, should be weighted toward the maximum. (Minimum + likely + 4*maximum) / 6 gives the planned estimate for each of the stories. This formula will represent the development effort for the project.
Not all stories are straightforward. Some may be simple, while others quite can be vague. Each story should be assessed for risks and adjusted using the above weighting to accommodate these risks. For instance, if the risk is high for a story, then the formula could multiply the maximum estimate by 6 rather than 4 and the number could be 2 for relatively low risk stories.
How to assess the risks and adjust the estimates, is an essay by itself, and is beyond the scope of this one. The above estimation process only takes into account the development activity. Quality assurance, business analysis, project management, as well as other activities associated with software projects, not to mention infrastructure requirements and software licenses, all affect the cost of a project and should be carefully considered.