---
title: "Functional versus structural testing; COCOMO for 200 KLOC"
subject: "Software Engineering"
chapter: 8
key: "semester_5/software_engineering:functional-vs-structural-cocomo2"
source: https://www.bctengineer.com/q/semester_5/software_engineering/functional-vs-structural-cocomo2
site: BCT Engineering
---

# Functional versus structural testing; COCOMO for 200 KLOC

Software Engineering · Chapter 8: Software Testing and cost Estimation

- Asked in: year not given, 5+3 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/functional-vs-structural-cocomo2
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-8

## Question

Differentiate functional and structural testing. For 200 KLOC, calculate effort per month, development time, average staffing and productivity rate considering COCOMO-2 for reference.

## Short answer

Functional testing checks behavior from specifications; structural testing checks internal code paths. For 200 KLOC with nominal COCOMO II factors, effort is about 997 person-months, development time about 33 months, average staffing about 30 persons, and productivity about 201 LOC per person-month.

## Answer

#### Functional versus structural testing

**Functional testing** (black-box) derives test cases from the specification and checks what the system does. **Structural testing** (white-box or glass-box) derives test cases from the internal code structure and checks how it does it.

| Point | Functional testing | Structural testing |
|---|---|---|
| Basis | Requirements/specification | Source code, control flow |
| Code knowledge | Not needed | Needed |
| Techniques | Equivalence partitioning, boundary values, decision tables | Statement, branch, path coverage, basis path |
| Measures | Requirements coverage | Code coverage |
| Finds | Missing functions, interface, performance errors | Logic errors, dead code, wrong conditions |
| Level | System, acceptance | Unit, component |
| Done by | Independent testers, users | Developers |
| Example | Login rejects a wrong password | Both branches of `if (pwd == stored)` run |

#### COCOMO II estimate for 200 KLOC

**COCOMO II (post-architecture model)** estimates effort as:

PM = A × Size^E × ∏EM

- A = 2.94 (calibration constant), Size in KSLOC
- E = B + 0.01 × ΣSF, with B = 0.91; SF are the five scale factors: precedentedness (PREC), development flexibility (FLEX), architecture/risk resolution (RESL), team cohesion (TEAM) and process maturity (PMAT)
- EM are 17 effort multipliers (product, platform, personnel, project)

Schedule: TDEV = C × PM^F, with C = 3.67 and F = D + 0.2 × (E − B), D = 0.28.

**Assumptions:** size = 200 KSLOC; all scale factors at their **nominal** ratings (PREC 3.72, FLEX 3.04, RESL 4.24, TEAM 3.29, PMAT 4.68); all effort multipliers nominal (= 1.0), so ∏EM = 1.

**Step 1: Exponent**
ΣSF = 3.72 + 3.04 + 4.24 + 3.29 + 4.68 = 18.97
E = 0.91 + 0.01 × 18.97 = 1.0997

**Step 2: Effort**
200^1.0997 = 339.19
PM = 2.94 × 339.19 × 1 = **997.2 person-months**

**Step 3: Development time**
F = 0.28 + 0.2 × (1.0997 − 0.91) = 0.3179
997.2^0.3179 = 8.983
TDEV = 3.67 × 8.983 = **33.0 months**

**Step 4: Average staffing**
Staff = PM / TDEV = 997.2 / 32.97 = 30.2 ≈ **30 persons**

**Step 5: Productivity**
P = Size / PM = 200,000 / 997.2 = **200.6 LOC per person-month** (≈ 0.2 KLOC/PM)

| Quantity | Result |
|---|---|
| Effort | ≈ 997 person-months |
| Development time | ≈ 33 months |
| Average staffing | ≈ 30 persons |
| Productivity | ≈ 201 LOC/PM |

Cross-check with basic COCOMO: 200 KLOC is above the usual organic range, so semi-detached mode (a = 3.0, b = 1.12, c = 2.5, d = 0.35) is suitable. It gives E = 3.0 × 200^1.12 = 1133.1 PM, D = 2.5 × 1133.1^0.35 = 29.3 months, about 39 persons and 176.5 LOC/PM, which is close to the COCOMO II result.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How does structural testing differ from functional testing?
   A. It derives tests from the code structure and measures code coverage
   B. It derives tests from the specification only
   C. It needs no code knowledge
   D. It is done only by end users
   Answer: A. Structural (white-box) testing uses the internal code and measures code coverage. Functional testing uses the specification. (Key point: Functional vs structural)

2. In the answer, with nominal scale factors summing to 18.97 and B = 0.91, what is E?
   A. 0.91
   B. 1.0997
   C. 1.897
   D. 2.94
   Answer: B. E = B + 0.01 x SF sum = 0.91 + 0.1897 = 1.0997. (Key point: COCOMO II exponent)

3. For 200 KSLOC with A = 2.94, E = 1.0997 and EM product 1, the effort is about ...
   A. 33 person-months
   B. 200 person-months
   C. 997 person-months
   D. 1133 person-months
   Answer: C. PM = 2.94 x 200^1.0997 = 2.94 x 339.19, about 997 person-months. (Key point: Effort result)

4. With effort 997 PM and development time about 33 months, average staffing is about ...
   A. 3 persons
   B. 30 persons
   C. 300 persons
   D. 1000 persons
   Answer: B. Staff = PM / TDEV = 997.2 / 32.97, about 30 persons. (Key point: Staffing)

## Related in Software Engineering

- [COCOMO for 49,200 lines of code](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Acocomo-49200) — Software Engineering, chapter 8
- [Why software development is complex; man-month myth](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Acomplex-development) — Software Engineering, chapter 1
- [Alpha versus beta testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aalpha-vs-beta) — Software Engineering, chapter 8

## Related in other subjects

- [Impounded reservoir, 6202 million L per month](https://www.bctengineer.com/question.md?key=semester_5%2Fwater_supply_engineering%3Aimpounded-reservoir-c69) — Water Supply Engineering, chapter 2, asked 2×
- [Impounded reservoir, 9688 million L per month](https://www.bctengineer.com/question.md?key=semester_5%2Fwater_supply_engineering%3Aimpounded-reservoir-j66) — Water Supply Engineering, chapter 2, asked 2×
- [Find X from cash flow diagram, 1% per month](https://www.bctengineer.com/question.md?key=semester_6%2Fengineering_economics%3Afind-x-cash-flow-monthly-interest) — Engineering Economics, chapter 2
- [Software testing time paradox](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-testing-paradox) — Instrumentation II, chapter 9
