How many test cases are needed for 100% decision coverage in a given pseudo code?

Prepare for the ISTQB Certified Tester Foundation Level Exam. Use flashcards and multiple choice questions with hints and explanations to ensure success. Get ready for your certification!

To achieve 100% decision coverage, the goal is to ensure that every decision point in the code is evaluated to both true and false outcomes at least once. Decision coverage is focused on the branching statements that can lead to different control flows based on the evaluation of conditions.

In a typical scenario involving pseudo code, if the code contains multiple decision points, each decision point needs to be exercised in such a way that both possible outcomes are accounted for. If the pseudo code includes logical conditions that can branch into two or more paths, each of those paths must be tested with cases that lead to all possible branches being executed.

For example, if the pseudo code has a simple if-else block, two test cases would be necessary—one to cover the condition where the if statement evaluates to true and another for when it evaluates to false. When the pseudo code becomes more complex, incorporating additional conditions or nested decisions, the number of required test cases increases to ensure all branches are adequately tested.

In the context of this question, achieving 100% decision coverage with three test cases implies the presence of at least two decision points resulting in a total of four outcomes (since each point needs to be tested for both true and false). Therefore, three strategically crafted test cases

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy