About

Practice Exam: Test Completion Criteria

Theory: How to Approach These

This practice exam follows the professor’s style for test completion criteria (suggested time: 25 minutes). It combines a Category 2 calculation with a Category 3 slope question. Review these before attempting it:

The exam question. You are responsible for testing a program of 25,000 statements. After code inspections, about 4 errors per 100 statements are expected to remain. The objective is to detect 98% of the coding and logic-design (CLD) errors and 95% of the design errors. Past projects show the following detection rates:

Test levelCLD errors foundDesign errors found
Module test65%0%
Function test30%60%
System test3%35%

During system testing, the total number of bugs found at the end of each week was:

Week0123456
Total bugs found04085120135142146

State explicitly your assumption(s).


Practice Exam Solutions

Exercise Q1a

Calculate the expected total number of errors.

Show solution ↓
Solution

Assumption: CLD errors are 40% and design errors 60% of all errors (industry study). The error rate of 4 per 100 statements applies uniformly to the whole program.

There are 25,000/100=25025{,}000 / 100 = 250 groups of 100 statements, each with about 4 errors:

25,000×4100=1,000\frac{25{,}000 \times 4}{100} = 1{,}000

Expected total: 1,000 errors.

Exercise Q1b

Calculate the expected number of CLD errors and design errors.

Show solution ↓
Solution

Using the 40/60 assumption:

CLD=0.40×1,000=400Design=0.60×1,000=600\text{CLD} = 0.40 \times 1{,}000 = 400 \qquad \text{Design} = 0.60 \times 1{,}000 = 600

CLD errors: 400; design errors: 600. Check: 400+600=1,000400 + 600 = 1{,}000 ✓

Exercise Q1c

Calculate the goal (number of errors to detect) for CLD errors and for design errors.

Show solution ↓
Solution

The goals are set below 100% because finding every error is unattainable:

CLD goal=0.98×400=392Design goal=0.95×600=570\text{CLD goal} = 0.98 \times 400 = 392 \qquad \text{Design goal} = 0.95 \times 600 = 570

CLD goal: 392 errors; design goal: 570 errors.

Exercise Q1d

Calculate the test completion criterion for the module test, the function test and the system test.

Show solution ↓
Solution

Each detection rate is a percentage of the total of its own kind of error (400 CLD, 600 design), not of 1,000 and not of the goals.

Test levelCalculationCriterion
Module test0.65×400+0.00×600=260+00.65 \times 400 + 0.00 \times 600 = 260 + 0260 errors
Function test0.30×400+0.60×600=120+3600.30 \times 400 + 0.60 \times 600 = 120 + 360480 errors
System test0.03×400+0.35×600=12+2100.03 \times 400 + 0.35 \times 600 = 12 + 210222 errors

The module test finds no design errors because it examines one unit at a time and is too low-level to see design mistakes.

Check: the CLD rates add to 65+30+3=98%65 + 30 + 3 = 98\% and the design rates to 0+60+35=95%0 + 60 + 35 = 95\%, matching the goals; and 260+480+222=962=392+570260 + 480 + 222 = 962 = 392 + 570 ✓

So: stop the module test after 260 errors have been found (and repaired), the function test after 480, and the system test after 222. These targets count errors found, not test cases run.

Exercise Q1e

Using the weekly data, calculate the slope for each week and the change in slope. When should system testing stop? Which category of test completion criteria is this?

Show solution ↓
Solution

The data are cumulative totals, so each slope is this week’s total minus last week’s (one-week intervals):

Week123456
Slope SiS_i4045351574
Change Si−Si−1S_i - S_{i-1}–+5−10−20−8−3

The greatest drop is S4−S3=15−35=−20S_4 - S_3 = 15 - 35 = -20. Stop system testing at the end of week 4.

This is Category 3: the bug-finding trend (slope of the bug curve) of the current project. It needs no past data; the stop at week 4 marks diminishing returns, not proof that no bugs remain.