What does decision coverage ensure in white-box testing?

Study for the EC-Council Certified Ethical Hacker (CEH) v13 Exam. Utilize flashcards and multiple-choice questions with helpful hints and detailed explanations. Excel in your exam preparation!

Multiple Choice

What does decision coverage ensure in white-box testing?

Explanation:
Decision coverage in white-box testing ensures that for every decision point in the code (such as an if, while, or for condition), the possible outcomes of that decision are exercised in testing. In practice, you need test cases that drive the condition to true at least once and to false at least once. For a simple if (x > 0) test, you’d use one case where x > 0 and another where x <= 0. For a compound condition like A && B, you’d test the scenario where the whole expression is true (A and B both true) and a scenario where it’s false (A is false or B is false). This focus helps uncover errors in the branching logic. It isn’t about comments, loop counts, or syntax correctness.

Decision coverage in white-box testing ensures that for every decision point in the code (such as an if, while, or for condition), the possible outcomes of that decision are exercised in testing. In practice, you need test cases that drive the condition to true at least once and to false at least once. For a simple if (x > 0) test, you’d use one case where x > 0 and another where x <= 0. For a compound condition like A && B, you’d test the scenario where the whole expression is true (A and B both true) and a scenario where it’s false (A is false or B is false). This focus helps uncover errors in the branching logic. It isn’t about comments, loop counts, or syntax correctness.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy