Coverage & Traceability
Compute statement and branch coverage over pseudocode, and audit traceability matrices for uncovered requirements and orphan test cases.
Coverage calculations
1 leer x 2 si x > 10: 3 imprimir "alto" 4 imprimir "fin"
Test case: x = 5.
What statement and branch coverage does this single test case achieve?
1 leer a, b 2 si a > 0 y b > 0: 3 msg = "ambos positivos" 4 si no: 5 msg = "no ambos" 6 si a > b: 7 msg = msg + ", a mayor" 8 imprimir msg
Test cases: {a=3, b=2} and {a=-1, b=4}.
What statement and branch coverage do these two test cases achieve together?
1 leer n 2 si n >= 0: 3 resultado = "válido" 4 si n > 100: 5 resultado = "demasiado grande" 6 imprimir resultado
Test case: n = 150.
What statement and branch coverage does this single test case achieve?
Traceability audits
Check every item with a problem: requirements with no test case, or test cases that cover no requirement.
| TC1 | TC2 | TC3 | TC4 | |
|---|---|---|---|---|
| R1 | ✓ | |||
| R2 | ✓ | ✓ | ||
| R3 |
Check every item with a problem: requirements with no test case, or test cases that cover no requirement.
| TC1 | TC2 | TC3 | TC4 | |
|---|---|---|---|---|
| R1 | ✓ | |||
| R2 | ✓ | |||
| R3 | ✓ | ✓ | ||
| R4 |
Check every item with a problem: requirements with no test case, or test cases that cover no requirement.
| TC1 | TC2 | TC3 | TC4 | TC5 | TC6 | TC7 | |
|---|---|---|---|---|---|---|---|
| R1 | ✓ | ✓ | ✓ | ||||
| R2 | ✓ | ||||||
| R3 | ✓ | ||||||
| R4 | ✓ | ||||||
| R5 | |||||||
| R6 |