67.5k views
3 votes
Which of the following descriptions of statement coverage is CORRECT?

A. Statement coverage is a measure of the number of lines of source code exercised by tests
B. Statement coverage is a measure of the proportion of executable statements in the source code exercised by tests
C. Statement coverage is a measure of the percentage of lines of source code (without comments) exercised by tests
D. Statement coverage is a measure of the number of executable statements in the source code exercised by tests

User Arxoft
by
8.7k points

1 Answer

5 votes

Final answer:

Statement coverage accurately measures the proportion of executable statements in the source code that are exercised by tests, to ensure all parts of the code are effectively tested.

Step-by-step explanation:

When discussing statement coverage, the accurate description is that it is a measure of the proportion of executable statements in the source code exercised by tests. This means that statement coverage checks how many of the possible executable statements in a program's code are actually executed when the tests are run, aiming to identify which parts of the code have been tested and which parts have not. This form of coverage is one of the ways to determine the effectiveness of the test cases in identifying potential errors.

Thus, the correct description among the given options is B. Statement coverage is a measure of the proportion of executable statements in the source code exercised by tests.

User David Feurle
by
7.3k points