Question: Cyclomatic Complexity & Independent Path Testing Directions: Compute the Cyclomatic Complexity for the following program segment. For the code: 1) find a set of independent
Cyclomatic Complexity & Independent Path Testing Directions: Compute the Cyclomatic Complexity for the following program segment. For the code: 1) find a set of independent paths, and 2) generate a set of test cases that ensure that each of the independent paths is executed. Note: The line numbers to the left of each line specify the node of the flow graph to which the statement belongs. 1: WHILE (not End of File) 2: Read Record; 2: IF (Record.F1 == 0) 3: Total += Record.F1; Counter++; ELSE IF (Record.F2 == 0) Print Total, Counter: 5: Counter = 0; ELSE 6: Total = Record.F2; 7: END IF 8: END IF 8 Print "END Record" 9 END WHILE 9 Print Counter 3: 4: 4: 5 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
