Chapter 18 of 32

COCOMO Model

In Software Size Estimation: LOC & Function Points we learned how to estimate how big a system will be. The manager's next question is: given that size, how many person-months of effort, how many calendar months, and how many people?

The most famous answer is COCOMO, the COnstructive COst MOdel, published by Barry Boehm in 1981 in Software Engineering Economics. Boehm fitted simple equations to data from 63 real projects at TRW. The original model is now called COCOMO 81; its modern successor is COCOMO II. Both appear in university exams and GATE-style questions, so this chapter covers the formulas, the official coefficients and fully worked numbers.

COCOMO is an algorithmic cost-estimation model that estimates software development effort (person-months) and development time (months) from the estimated size of the software in KLOC, adjusted by the type of project and, in its more detailed forms, by cost drivers.

A person-month (PM) is the work one person does in one month. 12 PM could be 1 person for 12 months or 4 people for 3 months (in theory; recall Brooks' Law from Software Project Management).


The Three Project Modes

Boehm observed that the same 30 KLOC can cost very different effort depending on the kind of project. COCOMO 81 classifies projects into three modes:

ModeCharacteristicsTypical examples
OrganicSmall, experienced team; familiar, well-understood problem; flexible requirements; little innovation. Typically up to about 50 KLOC.Payroll, inventory, simple business applications
Semi-detachedMedium size and complexity; team has mixed experience; some rigid requirements. Typically up to about 300 KLOC.Compilers, database systems, a new transaction-processing system
EmbeddedMust work within tight hardware, software, regulatory and operational constraints; requirements are rigid; often innovative. Any size.Air-traffic control, avionics, ATM network software, real-time control

The size ranges are only guides. The mode is decided mainly by how constrained and how novel the project is, not by size alone. A 20 KLOC flight-control system is still embedded.


Basic COCOMO

Basic COCOMO uses size and mode only:

Effort E = a × (KLOC)b person-months

Development time D = c × (E)d months

Average staff P = E / D persons

Productivity = LOC / E LOC per person-month

Modeabcd
Organic2.41.052.50.38
Semi-detached3.01.122.50.35
Embedded3.61.202.50.32

Two patterns are worth remembering, because they explain the model:

  • b > 1 (diseconomy of scale). Effort grows faster than size. Doubling the size of an organic project multiplies effort by 21.05 ≈ 2.07; for embedded, 21.20 ≈ 2.30. Bigger projects need more communication, integration and coordination per line.

  • d is around 0.32–0.38. Development time grows much more slowly than effort. You cannot compress a large project into a short schedule; extra effort is absorbed by a larger team, not by a proportionally longer schedule.

Worked Example 1: 32 KLOC in all three modes

A project is estimated at 32,000 LOC. Using Basic COCOMO, find effort, development time, average staff and productivity for each mode.

Organic:
  E = 2.4 × 32^1.05 = 2.4 × 38.05     ≈  91.3 PM
  D = 2.5 × 91.3^0.38                 ≈  13.9 months
  P = 91.3 / 13.9                     ≈   6.6 persons
  Productivity = 32000 / 91.3         ≈ 350 LOC/PM

Semi-detached:
  E = 3.0 × 32^1.12                   ≈ 145.5 PM
  D = 2.5 × 145.5^0.35                ≈  14.3 months
  P = 145.5 / 14.3                    ≈  10.2 persons
  Productivity = 32000 / 145.5        ≈ 220 LOC/PM

Embedded:
  E = 3.6 × 32^1.20                   ≈ 230.4 PM
  D = 2.5 × 230.4^0.32                ≈  14.3 months
  P = 230.4 / 14.3                    ≈  16.2 persons
  Productivity = 32000 / 230.4        ≈ 139 LOC/PM

Look at the pattern. The embedded version needs about 2.5 times the effort of the organic version, yet the calendar time is almost the same (about 14 months). The extra effort shows up as a team more than twice as large. This is a common exam observation: for the same size, development time is nearly independent of the mode.

You can reproduce these numbers with a short program:

modes = {
    "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),
}
kloc = 32
for name, (a, b, c, d) in modes.items():
    E = a * kloc ** b
    D = c * E ** d
    print(f"{name:14} E={E:6.1f} PM  D={D:5.1f} months  P={E/D:5.1f}")

Output:

organic        E=  91.3 PM  D= 13.9 months  P=  6.6
semi-detached  E= 145.5 PM  D= 14.3 months  P= 10.2
embedded       E= 230.4 PM  D= 14.3 months  P= 16.2

Effect of size (organic mode)

SizeEffort (PM)Time (months)Avg staff
10 KLOC26.98.73.1
32 KLOC91.313.96.6
50 KLOC145.916.68.8
100 KLOC302.121.913.8

Going from 10 to 100 KLOC (10×) multiplies effort by about 11.2 but time by only about 2.5.


Intermediate COCOMO

Basic COCOMO ignores everything except size and mode, so two 32 KLOC organic projects get the same estimate even if one has a brilliant team with good tools and the other has novices and a life-critical reliability requirement. Intermediate COCOMO fixes this with 15 cost drivers.

E = a × (KLOC)b × EAF

EAF (Effort Adjustment Factor) = product of the 15 cost-driver multipliers

D = c × (E)d (same c, d as Basic COCOMO)

The coefficient a changes from Basic COCOMO; the exponent b does not:

Modeabcd
Organic3.21.052.50.38
Semi-detached3.01.122.50.35
Embedded2.81.202.50.32

Why does embedded get a smaller a (2.8) here than in Basic COCOMO (3.6)? Because in the Intermediate model the extra difficulty of embedded projects is captured explicitly by cost drivers such as reliability, complexity and timing constraints, which usually push the EAF well above 1.

The 15 Cost Drivers

Each driver is rated on a scale from Very Low to Extra High. Nominal is always 1.00. A dash means that rating is not defined for that driver.

Cost driverVery LowLowNominalHighVery HighExtra High
Product attributes
RELY: required software reliability0.750.881.001.151.40–
DATA: database size–0.941.001.081.16–
CPLX: product complexity0.700.851.001.151.301.65
Computer (hardware) attributes
TIME: execution time constraint––1.001.111.301.66
STOR: main storage constraint––1.001.061.211.56
VIRT: virtual machine volatility–0.871.001.151.30–
TURN: computer turnaround time–0.871.001.071.15–
Personnel attributes
ACAP: analyst capability1.461.191.000.860.71–
AEXP: applications experience1.291.131.000.910.82–
PCAP: programmer capability1.421.171.000.860.70–
VEXP: virtual machine experience1.211.101.000.90––
LEXP: programming language experience1.141.071.000.95––
Project attributes
MODP: use of modern programming practices1.241.101.000.910.82–
TOOL: use of software tools1.241.101.000.910.83–
SCED: required development schedule1.231.081.001.041.10–

Read the table by direction:

  • Product and computer attributes: higher rating = harder project = multiplier above 1.

  • Personnel attributes and MODP/TOOL: higher rating = better people or practices = multiplier below 1.

  • SCED is special: both a compressed schedule (Very Low, 1.23) and a stretched schedule (Very High, 1.10) cost extra effort. Nominal is the cheapest.

Personnel drivers have the widest range: very low analyst capability (1.46) versus very high (0.71) is a factor of about 2. This is COCOMO's numerical way of saying "people matter most".

Worked Example 2: Intermediate COCOMO

An organic project is estimated at 20 KLOC. Reliability is High, product complexity is High, programmer capability is Low, and use of software tools is Very High. All other drivers are Nominal. Find effort, time and staff.

Step 1: Nominal effort
  E_nom = 3.2 × 20^1.05 = 3.2 × 23.23 ≈ 74.34 PM

Step 2: EAF
  RELY High       1.15
  CPLX High       1.15
  PCAP Low        1.17
  TOOL Very High  0.83
  others          1.00
  EAF = 1.15 × 1.15 × 1.17 × 0.83 ≈ 1.284

Step 3: Adjusted effort
  E = 74.34 × 1.284 ≈ 95.5 PM

Step 4: Time and staff
  D = 2.5 × 95.5^0.38 ≈ 14.1 months
  P = 95.5 / 14.1     ≈ 6.8 persons
  Productivity = 20000 / 95.5 ≈ 209 LOC/PM

The demanding reliability and complexity, plus weaker programmers, raise effort by about 28% over nominal, even after good tools pull it down a little.


Detailed (Complete) COCOMO

Detailed COCOMO adds two refinements on top of the Intermediate model:

  1. Phase-sensitive effort multipliers. A cost driver can have a different effect in different phases. For example, high programmer capability helps a lot during coding and unit testing but much less during requirements and product design.

  2. Three-level product hierarchy. Estimates are made at the module, subsystem and system levels, so drivers that vary between modules (such as complexity) are applied where they belong.

The effort is then distributed across phases (plans and requirements, product design, detailed design, code and unit test, integration and test). Exams usually only ask you to describe Detailed COCOMO, not compute it.


COCOMO II

COCOMO 81 was built for waterfall projects written from scratch in languages like FORTRAN and COBOL. By the 1990s, projects used reuse, GUI builders, object-oriented methods and iterative models like the Spiral Model. Boehm and colleagues at USC released COCOMO II (calibrated version: COCOMO II.2000) to reflect this.

Three Submodels

SubmodelWhen usedSize input
Application CompositionPrototyping, applications built from GUI builders and componentsObject points (application points): screens, reports, 3GL components
Early DesignAfter requirements, before the architecture is fixedFunction points or KSLOC; 7 effort multipliers
Post-ArchitectureAfter the architecture is designed, during developmentKSLOC (or FP converted to SLOC); 17 effort multipliers

The Post-Architecture Equations

PM = A × (Size)E × ∏ EMi

E = B + 0.01 × ∑ SFj (j = 1 to 5)

TDEV = C × (PMNS)F, where F = D + 0.2 × (E − B)

with A = 2.94, B = 0.91, C = 3.67, D = 0.28 (COCOMO II.2000)

Here Size is in KSLOC, EMi are the effort multipliers, and PMNS is the effort computed with a nominal schedule (SCED is handled separately as a percentage of the nominal schedule).

The big change is that the exponent is no longer fixed per mode. It is computed from five scale factors, each rated Very Low to Extra High:

Scale factorMeaningVery LowNominalExtra High
PRECPrecedentedness (have we built similar systems?)6.203.720.00
FLEXDevelopment flexibility5.073.040.00
RESLArchitecture / risk resolution7.074.240.00
TEAMTeam cohesion5.483.290.00
PMATProcess maturity (CMMI level)7.804.680.00

Worse ratings give larger scale factors, so a larger exponent and stronger diseconomy of scale. With every factor at Extra High, E = 0.91, so a very mature, cohesive team on a familiar product can even get slight economies of scale.

Worked Example 3: COCOMO II, all nominal

Estimate a 50 KSLOC project with all scale factors and effort multipliers nominal.

∑SF  = 3.72 + 3.04 + 4.24 + 3.29 + 4.68 = 18.97
E    = 0.91 + 0.01 × 18.97 = 1.0997
PM   = 2.94 × 50^1.0997 × 1.0 ≈ 217.1 person-months

F    = 0.28 + 0.2 × (1.0997 − 0.91) = 0.3179
TDEV = 3.67 × 217.1^0.3179 ≈ 20.3 months
Staff ≈ 217.1 / 20.3 ≈ 10.7 persons

Comparing the COCOMO Models

ModelInputsAccuracy / use
Basic COCOMO 81KLOC, modeQuick, rough, early estimate
Intermediate COCOMO 81KLOC, mode, 15 cost driversBetter; the most commonly examined
Detailed COCOMO 81As intermediate + phase-wise multipliers, module hierarchyMost detailed version of COCOMO 81
COCOMO IIObject points / FP / KSLOC, 5 scale factors, 7 or 17 EMsModern processes, reuse, iterative development

Limitations of COCOMO

  • It needs the size as input, and size is itself an estimate. Garbage in, garbage out.

  • The coefficients come from historical project data; organisations get better results by calibrating A (and sometimes the exponent) to their own past projects.

  • Driver ratings are subjective; two estimators may rate the same project differently.

  • COCOMO 81 assumes a waterfall-like life cycle and code written mostly from scratch.


Common Mistakes

  • Plugging LOC instead of KLOC. 32,000 LOC must be entered as 32.

  • Using Basic coefficients in an Intermediate question. Organic a is 2.4 in Basic but 3.2 in Intermediate; embedded a is 3.6 in Basic but 2.8 in Intermediate.

  • Adding cost drivers. The EAF is the product of the multipliers, not their sum.

  • Applying the EAF to development time. Multiply the effort by EAF, then compute D from the adjusted effort.

  • Computing staff as E × D. Average staff is E / D.

  • Assuming SCED Very High (more time) reduces effort. Both compressed and stretched schedules increase effort in COCOMO 81.


Exam and Interview Questions

Q1. Using Basic COCOMO, estimate effort, time and staff for a 50 KLOC organic project.

E = 2.4 × 501.05 ≈ 145.9 PM; D = 2.5 × 145.90.38 ≈ 16.6 months; P ≈ 145.9 / 16.6 ≈ 8.8 persons.

Q2. If the size of an embedded project doubles, by what factor does Basic COCOMO effort grow?

21.20 ≈ 2.30. (Organic: 21.05 ≈ 2.07; semi-detached: 21.12 ≈ 2.17.)

Q3. An embedded project of 10 KLOC has EAF = 1.2. Using Intermediate COCOMO, find effort and time.

E = 2.8 × 101.2 × 1.2 = 2.8 × 15.85 × 1.2 ≈ 53.3 PM; D = 2.5 × 53.30.32 ≈ 8.9 months; staff ≈ 6.

Q4. Which COCOMO 81 cost drivers have multipliers below 1 when rated High, and why?

The personnel drivers (ACAP, AEXP, PCAP, VEXP, LEXP) and the project drivers MODP and TOOL. Better people, more experience, better practices and better tools reduce the effort needed. SCED is the exception among project drivers: High (stretched schedule) gives 1.04.

Q5. Why does development time vary so little between modes for the same size?

D = 2.5 × Ed with d between 0.32 and 0.38. The more effort a mode needs, the smaller its d, so a higher E is mostly offset. The extra effort of harder projects is reflected in a larger team rather than a longer schedule.

Q6. What replaces the fixed "mode" exponent in COCOMO II?

The exponent E = 0.91 + 0.01 × ∑SF, computed from five scale factors: precedentedness, development flexibility, architecture/risk resolution, team cohesion and process maturity.


Summary

  • COCOMO (Boehm, 1981) turns size in KLOC into effort (PM), time (months) and staff.

  • Modes: organic, semi-detached, embedded, in increasing order of constraint and novelty.

  • Basic: E = a·KLOCb, D = 2.5·Ed, with (a, b, d) = (2.4, 1.05, 0.38), (3.0, 1.12, 0.35), (3.6, 1.20, 0.32).

  • Intermediate: E = a·KLOCb·EAF with a = 3.2, 3.0, 2.8 and EAF = product of 15 cost drivers.

  • b > 1 means diseconomy of scale; small d means time grows slowly and team size absorbs extra effort.

  • Detailed COCOMO adds phase-sensitive multipliers and a module/subsystem/system hierarchy.

  • COCOMO II: PM = 2.94·SizeE·∏EM, E = 0.91 + 0.01∑SF, TDEV = 3.67·PMF, F = 0.28 + 0.2(E − 0.91); submodels Application Composition, Early Design, Post-Architecture.

  • Next, Project Scheduling: Gantt Charts, PERT & CPM turns these totals into a task-by-task schedule.