Planning in agile projects is done in small steps, and estimation is needed to decide what can be done in a given time.

Agile Planning

Agile planning is incremental. The team plans in two levels. The release plan is a rough view of what features will be in the next few releases, and the iteration plan is a detailed plan for the next sprint. In planning, the customer picks the user stories that have the highest value, and the team estimates the effort for each in story points. The speed at which the team finishes stories, called velocity, is measured in story points per sprint, and it is used to predict how much can be done in future sprints. Planning is repeated at the start of every iteration.

Definition: Velocity. The number of story points a team completes in an iteration, used to forecast how much work it can finish in later iterations.

Estimation Techniques

Estimates of effort, time and cost are always uncertain. Experience-based estimation relies on earlier similar projects, and expert judgement, such as the Delphi technique where experts estimate separately and then discuss, is common. Algorithmic models use a formula. In the Basic COCOMO model, the effort in person-months is E = a × (KLOC) to the power b, and the development time is T = c × E to the power d. For an organic project, a = 2.4, b = 1.05, c = 2.5 and d = 0.38. For a semi-detached project the values are 3.0, 1.12, 2.5 and 0.35, and for an embedded project they are 3.6, 1.20, 2.5 and 0.32. Function point analysis estimates the size from the functions the user sees, such as inputs, outputs, inquiries, files and interfaces. Planning poker is an agile technique in which team members estimate stories with cards.

Table 2.7: Basic COCOMO constants

Project type a b c d
Organic 2.4 1.05 2.5 0.38
Semi-detached 3.0 1.12 2.5 0.35
Embedded 3.6 1.20 2.5 0.32

Example 2.7: Basic COCOMO estimate

Problem: Estimate the effort and development time for an organic project of 32 KLOC.

Solution:

  1. E = 2.4 × 32 to the power 1.05 = 2.4 × 38.05 = 91.3 person-months.
  2. T = 2.5 × 91.3 to the power 0.38 = 2.5 × 5.55 = 13.9 months.
  3. Average staff = E / T = 6.6 persons.

Result: About 91 person-months of effort over about 14 months, which needs about 7 people.

kloc = 32
E = 2.4 * kloc ** 1.05
T = 2.5 * E ** 0.38
print(round(E, 1), round(T, 1), round(E / T, 1))
points, sprints = [20, 24, 22], 3
print("velocity", sum(points) / sprints)

Output

91.3 13.9 6.6
velocity 22.0

Common mistakes

  • Treating an estimate as a promise and ignoring its uncertainty.
  • Using the Basic COCOMO constants of the wrong project type.
  • Using story points as a measure of hours.

Key takeaways

  • Agile planning is incremental, with release and iteration plans.
  • Velocity is the story points completed per iteration.
  • Basic COCOMO: E = a (KLOC) to the power b, T = c E to the power d.
  • Function points measure size from the functions the user sees.

Practice questions

  1. What is velocity?
  2. Write the Basic COCOMO effort equation.
  3. Name two estimation techniques.

Answers to the practice questions

  1. The number of story points a team completes in an iteration.
  2. E = a × (KLOC) to the power b.
  3. COCOMO and function point analysis (also Delphi and planning poker).

Sources

  • Official BCA syllabus Software Engineering, course code 26BCA403DS03, Unit II