Exam CTFL All QuestionsBrowse all questions from this exam
Question 54

The flow graph below shows the logic of a program for which 100% statement coverage and 100% decision coverage is required on exit from component testing.

The following test cases have been run:

Test Case 1 covering path P,Q,R,U

Test Case 2 covering path P,Q,S,V

Test Case 3 covering path P,Q,S,W,X

Test case 4 covering path P,Q,S,W,Y

Refer to the exhibit -

    Correct Answer: D

    The given test cases have the following coverage: Test Case 1 covers P, Q, R, U. Test Case 2 covers P, Q, S, V. Test Case 3 covers P, Q, S, W, X. Test Case 4 covers P, Q, S, W, Y. Observing the flow graph, we see that node T is never reached in the given test cases. Since not all statements (nodes) are executed, statement coverage is less than 100%. For decision coverage, not all possible true/false outcomes of the decisions have been tested. For example, the decision R leading to T (true outcome) hasn't been covered, and neither has the decision W leading to X (true outcome). Therefore, decision coverage is also less than 100%. Consequently, both statement coverage and decision coverage are less than 100%.

Discussion
FrerikOption: D

D because the statement T is not touched

laraerfOption: A

Not sure D