Which of the following statements is NOT correct?

  1. A minimal test set that achieves 100% LCSAJ coverage will also achieve 100% branch coverage.

  2. A minimal test set that achieves 100% path coverage will also achieve 100% statement coverage.

  3. A minimal test set that achieves 100% path coverage will generally detect more faults than one that achieves 100% statement coverage.

  4. A minimal test set that achieves 100% statement coverage will generally detect more faults than one that achieves 100% branch coverage.


Correct Option: D

AI Explanation

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

LCSAJ (Linear Code Sequence and Jump) coverage is a metric that measures the coverage of code sequences and branches in a program.

Branch coverage measures the coverage of each branch in a program, ensuring that both the true and false branches of each decision point are executed at least once.

Path coverage measures the coverage of all possible paths through a program, ensuring that every possible combination of branches and decisions is executed at least once.

Statement coverage measures the coverage of each individual statement in a program, ensuring that every statement is executed at least once.

Now let's go through each option to understand why it is correct or incorrect:

Option A) A minimal test set that achieves 100% LCSAJ coverage will also achieve 100% branch coverage. This option is correct because achieving 100% LCSAJ coverage implies that all branches in the program have been executed, hence achieving 100% branch coverage.

Option B) A minimal test set that achieves 100% path coverage will also achieve 100% statement coverage. This option is correct because achieving 100% path coverage implies that all possible combinations of branches and decisions have been executed, hence achieving 100% statement coverage.

Option C) A minimal test set that achieves 100% path coverage will generally detect more faults than one that achieves 100% statement coverage. This option is correct because achieving 100% path coverage ensures that all possible paths through a program have been executed, making it more likely to detect faults that occur on specific paths.

Option D) A minimal test set that achieves 100% statement coverage will generally detect more faults than one that achieves 100% branch coverage. This option is NOT correct. Achieving 100% statement coverage only ensures that every statement in the program has been executed at least once. It does not guarantee coverage of all branches or paths, which are often more critical for fault detection. Hence, achieving 100% branch coverage (which covers all decisions and branches) is generally more effective in fault detection than achieving 100% statement coverage.

Therefore, the correct answer is D.

Find more quizzes: