Consider the following statements: i.100% statement coverage guarantees 100% branch coverage. ii.100% branch coverage guarantees 100% statement coverage. iii.100% branch coverage guarantees 100% decision coverage. iv.100% decision coverage guarantees 100% branch coverage. v.100% statement coverage guarantees 100% decision coverage.

  1. A. ii is True; i, iii, iv & v are False

  2. B. i & v are True; ii, iii & iv are False

  3. C. ii & iii are True; i, iv & v are False

  4. D. ii, iii & iv are True; i & v are False


Correct Option: D

AI Explanation

To answer this question, we need to understand the concepts of statement coverage, branch coverage, and decision coverage.

Statement coverage refers to the percentage of statements in the code that have been executed during testing. It measures how many statements have been covered by the test cases.

Branch coverage refers to the percentage of branches in the code that have been executed during testing. It measures how many branches have been covered by the test cases.

Decision coverage refers to the percentage of decision outcomes in the code that have been executed during testing. A decision outcome is a Boolean expression that results in a true or false value. It measures how many decision outcomes have been covered by the test cases.

Now let's go through each statement to determine its correctness:

i. 100% statement coverage guarantees 100% branch coverage. This statement is false. While achieving 100% statement coverage does cover all the branches, it does not guarantee that all the branches have been covered.

ii. 100% branch coverage guarantees 100% statement coverage. This statement is false. Achieving 100% branch coverage means that all the branches have been covered, but it does not guarantee that all the statements have been covered.

iii. 100% branch coverage guarantees 100% decision coverage. This statement is true. Achieving 100% branch coverage ensures that all the decision outcomes have been covered, as each branch represents a decision outcome.

iv. 100% decision coverage guarantees 100% branch coverage. This statement is true. Achieving 100% decision coverage ensures that all the branches have been covered, as each decision outcome corresponds to a branch.

v. 100% statement coverage guarantees 100% decision coverage. This statement is false. Achieving 100% statement coverage does not guarantee that all the decision outcomes have been covered.

Based on the explanations above, the correct answer is:

D. ii, iii & iv are True; i & v are False

Find more quizzes: