QuestionQ27

VerifiedWhite-Box Test Techniques

Consider the pseudocode below:

Question Image

Which option supplies a set of test cases that attains 100% decision coverage for this code fragment using the fewest test cases?

Assume that, in each option, the three numbers in parentheses are the inputs for one test case: the first is variable a, the second is variable b, and the third is variable c.

Explanation

The test set must include an execution where both comparisons are true, causing the assignment to execute, and executions that make each comparison false. The three cases in option C provide the true/true, true/false, and false/true combinations for a > b and b > c, covering both outcomes of the comparisons and the overall IF decision.

Community Discussion

No comments yet. Be the first to start the discussion!