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:
| Mode | Characteristics | Typical examples |
|---|---|---|
| Organic | Small, experienced team; familiar, well-understood problem; flexible requirements; little innovation. Typically up to about 50 KLOC. | Payroll, inventory, simple business applications |
| Semi-detached | Medium size and complexity; team has mixed experience; some rigid requirements. Typically up to about 300 KLOC. | Compilers, database systems, a new transaction-processing system |
| Embedded | Must 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
| Mode | 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 |
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/PMLook 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.2Effect of size (organic mode)
| Size | Effort (PM) | Time (months) | Avg staff |
|---|---|---|---|
| 10 KLOC | 26.9 | 8.7 | 3.1 |
| 32 KLOC | 91.3 | 13.9 | 6.6 |
| 50 KLOC | 145.9 | 16.6 | 8.8 |
| 100 KLOC | 302.1 | 21.9 | 13.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:
| Mode | a | b | c | d |
|---|---|---|---|---|
| Organic | 3.2 | 1.05 | 2.5 | 0.38 |
| Semi-detached | 3.0 | 1.12 | 2.5 | 0.35 |
| Embedded | 2.8 | 1.20 | 2.5 | 0.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 driver | Very Low | Low | Nominal | High | Very High | Extra High |
|---|---|---|---|---|---|---|
| Product attributes | ||||||
| RELY: required software reliability | 0.75 | 0.88 | 1.00 | 1.15 | 1.40 | – |
| DATA: database size | – | 0.94 | 1.00 | 1.08 | 1.16 | – |
| CPLX: product complexity | 0.70 | 0.85 | 1.00 | 1.15 | 1.30 | 1.65 |
| Computer (hardware) attributes | ||||||
| TIME: execution time constraint | – | – | 1.00 | 1.11 | 1.30 | 1.66 |
| STOR: main storage constraint | – | – | 1.00 | 1.06 | 1.21 | 1.56 |
| VIRT: virtual machine volatility | – | 0.87 | 1.00 | 1.15 | 1.30 | – |
| TURN: computer turnaround time | – | 0.87 | 1.00 | 1.07 | 1.15 | – |
| Personnel attributes | ||||||
| ACAP: analyst capability | 1.46 | 1.19 | 1.00 | 0.86 | 0.71 | – |
| AEXP: applications experience | 1.29 | 1.13 | 1.00 | 0.91 | 0.82 | – |
| PCAP: programmer capability | 1.42 | 1.17 | 1.00 | 0.86 | 0.70 | – |
| VEXP: virtual machine experience | 1.21 | 1.10 | 1.00 | 0.90 | – | – |
| LEXP: programming language experience | 1.14 | 1.07 | 1.00 | 0.95 | – | – |
| Project attributes | ||||||
| MODP: use of modern programming practices | 1.24 | 1.10 | 1.00 | 0.91 | 0.82 | – |
| TOOL: use of software tools | 1.24 | 1.10 | 1.00 | 0.91 | 0.83 | – |
| SCED: required development schedule | 1.23 | 1.08 | 1.00 | 1.04 | 1.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/PMThe 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:
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.
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
| Submodel | When used | Size input |
|---|---|---|
| Application Composition | Prototyping, applications built from GUI builders and components | Object points (application points): screens, reports, 3GL components |
| Early Design | After requirements, before the architecture is fixed | Function points or KSLOC; 7 effort multipliers |
| Post-Architecture | After the architecture is designed, during development | KSLOC (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 factor | Meaning | Very Low | Nominal | Extra High |
|---|---|---|---|---|
| PREC | Precedentedness (have we built similar systems?) | 6.20 | 3.72 | 0.00 |
| FLEX | Development flexibility | 5.07 | 3.04 | 0.00 |
| RESL | Architecture / risk resolution | 7.07 | 4.24 | 0.00 |
| TEAM | Team cohesion | 5.48 | 3.29 | 0.00 |
| PMAT | Process maturity (CMMI level) | 7.80 | 4.68 | 0.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 personsComparing the COCOMO Models
| Model | Inputs | Accuracy / use |
|---|---|---|
| Basic COCOMO 81 | KLOC, mode | Quick, rough, early estimate |
| Intermediate COCOMO 81 | KLOC, mode, 15 cost drivers | Better; the most commonly examined |
| Detailed COCOMO 81 | As intermediate + phase-wise multipliers, module hierarchy | Most detailed version of COCOMO 81 |
| COCOMO II | Object points / FP / KSLOC, 5 scale factors, 7 or 17 EMs | Modern 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.