What is the minimum percentage of decision coverage achieved by a single test case for a code containing an 'if' statement?

Study for the ISTQB Foundation Level Exam. Prepare with flashcards, multiple-choice questions, hints, and explanations. Get ready for your certification!

In the context of decision coverage, which measures whether each decision point in the code has been executed for both true and false outcomes, the minimum percentage of coverage achievable by a single test case for a code containing an 'if' statement is 50%. This is because an 'if' statement presents two outcomes: one when the condition is true and another when it is false.

When you execute a single test case that satisfies either the true or false condition, you will cover only one side of the decision. Therefore, the highest achievable decision coverage from that single test case would be 50%, indicating that only one of the two possible paths has been tested. To achieve 100% decision coverage, both outcomes of the 'if' statement would need to be exercised through either separate test cases or one test case designed to account for each possible outcome. Thus, understanding the mechanics of how decision coverage functions in relation to an 'if' statement clarifies why 50% is the minimum for a single test case.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy