We can achieve complete statement coverage but still miss bugs because:

  1. The failure occurs only if you reach a statement taking the TRUE branch of an IF statement, and you got to the statement with a test that passed through the FALSE branch.

  2. The failure depends on the program's inability to handle specific data values, rather than on the program's flow of control.

  3. Both A and B

  4. We are not required to test code that customers are unlikely to execute.


Correct Option: C

AI Explanation

To answer this question, we need to understand what statement coverage is and why it may not be sufficient to identify all bugs.

Statement coverage is a metric used in software testing to measure the percentage of statements in a program that have been executed during testing. The goal of achieving complete statement coverage is to ensure that every statement in the code has been executed at least once.

Option A states that even with complete statement coverage, bugs may still be missed if the failure occurs only when a specific condition is met. For example, if there is an IF statement in the code and the failure occurs only when the TRUE branch of the IF statement is executed, but the test cases used for coverage only pass through the FALSE branch, then the bug may be missed.

Option B states that the failure may depend on the program's inability to handle specific data values. This means that even if all statements are covered, bugs may still be missed if the failure occurs due to the program not handling certain data values correctly. For example, if the program crashes or produces incorrect results when a specific input value is provided, but the test cases used for coverage do not include that specific value, then the bug may be missed.

Option C correctly states that both Option A and Option B are valid reasons why bugs may be missed even with complete statement coverage. Both the failure occurring only when specific conditions are met and the program's inability to handle specific data values can result in bugs being missed.

Option D is incorrect because it suggests that not testing code that customers are unlikely to execute is a reason why bugs may be missed. While it is true that testing code that is more likely to be executed by customers is generally prioritized, it does not directly relate to the question of achieving complete statement coverage and missing bugs.

Therefore, the correct answer is Option C. Both Option A and Option B are valid reasons why bugs may be missed even with complete statement coverage.

Find more quizzes: