Consider this code:
PROCEDURE: PATH-COUNTER
WHILE NOT End-Of-File
READ NEXT RECORD
IF FIELD > 7 THEN
PUT IN BIG-NUMBER BIN
ELSE IF FIELD > 3 THEN
PUT IN MID-NUMBER BIN
ELSE
PUT IN SMALL-NUMBER BIN
END IF
END WHILE
A Basis Path is a unique path through a process, not counting iterations. Basis Paths are the atomic components of real-world paths.
The four basis paths are:
- 1 - 10
- 1 - 2 - 3 - 8 - 9 - 1 - 10
- 1 - 2 - 4 - 5 - 7 - 8 - 9 - 1 - 10
- 1 - 2 - 4 - 6 - 7 - 8 - 9 - 1 - 10
Test the four Basis Paths:
- No records (path a).
- F > 7 (path b).
- F between 3 and 7 (path c).
- F < 3 (path d).
NOTE: this only gives the number of basis paths - which does not consider loops. Boundary testing is required in addition to path testing, to test the three boundaries: F > 7, F < 3, and the loop counter for the number of remaining records. |