To estimate software project metrics using LOC, Function Point (FP), and the COCOMO model.
The simplest size metric — counts the number of source code lines (excluding comments/blank lines).
- Advantage: Easy to measure
- Limitation: Language-dependent; doesn't reflect complexity or quality
Measures software functionality delivered to the user, independent of programming language.
Five Function Types:
| Component | Simple | Average | Complex |
|---|---|---|---|
| External Inputs (EI) | 3 | 4 | 6 |
| External Outputs (EO) | 4 | 5 | 7 |
| External Inquiries (EQ) | 3 | 4 | 6 |
| Internal Logical Files (ILF) | 7 | 10 | 15 |
| External Interface Files (EIF) | 5 | 7 | 10 |
UFP = Σ (Count × Weight)
AFP = UFP × VAF (Value Adjustment Factor, typically 0.65–1.35)
Basic COCOMO Formulas:
| Metric | Formula |
|---|---|
| Effort (Person-Months) | E = a × (KLOC)^b |
| Duration (Months) | D = 2.5 × (E)^0.38 |
| Team Size | S = E / D |
COCOMO Modes:
| Mode | Type of Project | a |
b |
|---|---|---|---|
| Organic | Small, familiar, simple | 2.4 | 1.05 |
| Semi-detached | Medium, mixed experience | 3.0 | 1.12 |
| Embedded | Complex, tight constraints | 3.6 | 1.20 |
- Define the scope of the software project.
- LOC Estimation: List all modules and estimate lines per module; sum and convert to KLOC (÷ 1000).
- Function Point: Count inputs, outputs, inquiries, ILF, EIF.
- Assign complexity weights (Simple/Average/Complex) to each component.
- Calculate UFP = Sum of (Count × Weight).
- Apply VAF to get Adjusted FP (AFP).
- COCOMO: Identify project type (Organic/Semi-detached/Embedded).
- Calculate Effort (Person-Months) =
a × (KLOC)^b. - Calculate Duration (Months) =
2.5 × (Effort)^0.38. - Calculate Team Size =
Effort / Duration.
Project: Student Management System
| Module | Estimated LOC |
|---|---|
| Login / Authentication | 500 |
| Student Records Management | 2,000 |
| Report Generation | 1,500 |
| Admin Panel | 3,000 |
| Notification System | 1,000 |
| Total | 8,000 LOC = 8 KLOC |
Given: KLOC = 8, Mode = Organic (a = 2.4, b = 1.05)
Effort = 2.4 × (8)^1.05
= 2.4 × 9.43
≈ 22.6 Person-Months
Duration = 2.5 × (22.6)^0.38
= 2.5 × 3.58
≈ 8.95 ≈ 9 Months
Team Size = 22.6 / 9 ≈ 3 People
| Metric | Value |
|---|---|
| Project Size | 8 KLOC |
| COCOMO Mode | Organic |
| Estimated Effort | 22.6 Person-Months |
| Development Duration | ~9 Months |
| Team Size | ~3 People |
| Component | Count | Weight (Avg) | FP Score |
|---|---|---|---|
| External Inputs (EI) | 5 | 4 | 20 |
| External Outputs (EO) | 3 | 5 | 15 |
| External Inquiries (EQ) | 4 | 4 | 16 |
| Internal Logical Files (ILF) | 2 | 10 | 20 |
| External Interface Files (EIF) | 0 | 7 | 0 |
| UFP | 71 |
VAF = 1.0 (neutral)
AFP = UFP × VAF = 71 × 1.0 = 71 Function Points
| Technique | Estimate |
|---|---|
| COCOMO (LOC-based) | 22.6 Person-Months |
| Function Point (FP-based, at 8 PM/100 FP) | ~5.7 Person-Months |
Note: FP-based productivity rate varies by organization.