For the program given below: Draw the Control Flow Graph (CFG) Find its Complexi
ID: 3827284 • Letter: F
Question
For the program given below: Draw the Control Flow Graph (CFG) Find its Complexity (CC). How many test cases are required for each of: Statement testing Branch testing Path testing. Exhaustive testing assuming that the maximum number of records is 5. (Justify your answers). Give an example set for test cases of the branch testing. Program Q_4 A= 0; B =0; Read new_rec; {read a new record (X, Y)} Repeat While A> = 0 OR B> = 0 Do If (A 0 Then Print A, X Else Print B, Y End If Read new_rec; Until End - of -File End.Explanation / Answer
For Branch Coverage/Decision Coverage, make sure that every statement in the program has been executed at least once, and every decision in the program has taken all possible outcomes at least once.
For the given code, you need four conditions to check for statement no. 6
Two conditions to check for statement 7:
Two conditions for statement 15: