Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 41 ยท Scope, Time and Cost

Software Size and Cost Estimation Models

Learn how software projects estimate size and effort: lines of code, function points, story points, the basic COCOMO model, Putnam model, and the limits of each technique.

Estimating a software project is hard because the product is invisible and requirements shift. A common approach is to estimate size first (how big is it?), then convert size into effort (person-months) and duration, and finally into cost. This lesson covers the sizing techniques, the best-known cost model (COCOMO), and how to use them responsibly.

flowchart LR
    A[Requirements] --> B[Estimate size]
    B --> C[Convert to effort]
    C --> D[Derive duration and team]
    D --> E[Cost = effort x rate]

The classic estimation chain: size, effort, schedule, cost.

Size measures

Lines of code (LOC / KLOC)

Count (or predict) source lines. Easy to measure afterward, but language-dependent (ten lines of Python may equal a hundred of assembly), rewards verbose code, and is hard to predict from requirements. Define whether blank lines and comments count.

Function points (FP)

A function point measures functionality from the user's viewpoint, independent of language. You count five kinds of components and weight them by complexity:

  • External inputs: data coming in (forms).
  • External outputs: reports and messages going out.
  • External inquiries: lookups with immediate output.
  • Internal logical files: data the system maintains.
  • External interface files: data used from other systems.

Weighted counts give unadjusted function points, which can be adjusted by a value factor for general characteristics (performance, reuse, and so on). Because FP exists at requirements time, it can be estimated early.

Python Unadjusted function points

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Story points and other relative sizes

Agile teams estimate story points: a relative number for effort, complexity and uncertainty. A story twice the points is roughly twice the work. The team's velocity (points finished per sprint) converts points to time. They are not hours and not comparable between teams.

Other approaches

  • Use-case points from use cases.
  • Feature counts and screens/reports/modules counted in the product.
  • Wideband Delphi: experts estimate anonymously, discuss differences and re-estimate until they converge.
  • Planning poker: an agile version of Delphi.
  • Analogy with a comparable past project.

COCOMO: effort from size

The Constructive Cost Model (COCOMO), by Barry Boehm, predicts effort and schedule from size in thousands of lines of code (KLOC). The Basic COCOMO equations are:

  • Effort (person-months) = a x (KLOC)^b
  • Duration (months) = c x (Effort)^d

with coefficients depending on the project class:

Mode Description a b c d
Organic Small team, familiar, simple 2.4 1.05 2.5 0.38
Semi-detached Mixed experience, medium complexity 3.0 1.12 2.5 0.35
Embedded Tight constraints, complex hardware 3.6 1.20 2.5 0.32
Python Basic COCOMO

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the exponent above 1: bigger software costs more than proportionally per line (coordination overhead, a diseconomy of scale). Intermediate COCOMO multiplies by cost drivers (reliability, team capability, tools and so on); COCOMO II updates it for modern development, object-oriented languages and early-design estimates using function points.

From effort to cost

Python Effort to cost, with a range

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Putnam model

The Putnam (SLIM) model relates size, effort and time through a Rayleigh curve of staffing. Its notable result: compressing the schedule increases effort very sharply (effort varies as 1 over time to the fourth power in the classic formulation). This supports a point in Schedule Compression: beyond a limit, adding people to go faster costs far more than it saves.

Using models responsibly

  • Calibrate coefficients with your own project history.
  • Treat results as a range, not a promise; compare at least two methods.
  • Re-estimate as requirements firm up.
  • Remember that models estimate construction; add testing, management, training and deployment if the model does not.
  • Do not use size measures to judge individual developers.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which size measure is independent of programming language?

    Function points count user-visible functionality, not code.
  2. 2. In basic COCOMO, effort grows faster than size because...

    b > 1 gives a diseconomy of scale.
  3. 3. Story points measure...

    They are relative, team-specific units used with velocity.
  4. 4. Which is a good practice with estimation models?

    Calibration and ranges give honest, improvable estimates.

Summary

  • Estimate size (LOC, function points, story points), then effort, duration and cost.
  • Basic COCOMO: effort = a x KLOC^b; the mode sets the coefficients.
  • Function points can be counted early; story points support agile planning.
  • Compare methods, calibrate, give ranges and re-estimate.

Next: Network Diagrams