Code Test Coverage Measure

From GM-RKB
Jump to navigation Jump to search

A Code Test Coverage Measure is a software system measure of the degree to which the source code (of a program) is executed when a particular test suite is run.



References

2022


2022

How is code coverage calculated?

Code coverage tools will use one or more criteria to determine how your code was exercised or not during the execution of your test suite. The common metrics that you might see mentioned in your coverage reports include:

      • Function coverage: how many of the functions defined have been called.
      • Statement coverage: how many of the statements in the program have been executed.
      • Branches coverage: how many of the branches of the control structures (if statements for instance) have been executed.
      • Condition coverage: how many of the boolean sub-expressions have been tested for a true and a false value.
      • Line coverage: how many of lines of source code have been tested.
    • These metrics are usually represented as the number of items actually tested, the items found in your code, and a coverage percentage (items tested / items found).

      These metrics are related, but distinct. ...