QuestionQ37

VerifiedWhite-Box Test Techniques

Consider the following code fragment:

Question Image

How many test cases are required for lines 26–37 to achieve 100% modified condition/decision coverage?

Explanation

The decision contains three atomic conditions combined with AND. To demonstrate that each condition independently affects the decision result, use one test where all three conditions are true and three further tests where exactly one condition is false at a time while the other two remain true. This achieves 100% modified condition/decision coverage with four test cases.

Community Discussion

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