Code Test Coverage Measure
(Redirected from Code coverage)
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.
- Context:
- It can be calculated by a Code Test Coverage Analysis Task.
- …
- Example(s):
- 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.
- …
- See: Source Code, Computer Program, Test Suite, Software Bug, Software Testing.
References
2022
- (Wikipedia, 2022) ⇒ https://en.wikipedia.org/wiki/code_coverage Retrieved:2022-10-12.
- In computer science, test coverage is a percentage measure of the degree to which the source code of a program is executed when a particular test suite is run. A program with high test coverage has more of its source code executed during testing, which suggests it has a lower chance of containing undetected software bugs compared to a program with low test coverage. Many different metrics can be used to calculate test coverage. Some of the most basic are the percentage of program subroutines and the percentage of program statements called during execution of the test suite.
Test coverage was among the first methods invented for systematic software testing. The first published reference was by Miller and Maloney in Communications of the ACM, in 1963.
- In computer science, test coverage is a percentage measure of the degree to which the source code of a program is executed when a particular test suite is run. A program with high test coverage has more of its source code executed during testing, which suggests it has a lower chance of containing undetected software bugs compared to a program with low test coverage. Many different metrics can be used to calculate test coverage. Some of the most basic are the percentage of program subroutines and the percentage of program statements called during execution of the test suite.
2022
- https://www.atlassian.com/continuous-delivery/software-testing/code-coverage
- QUOTE: ... Code coverage is a metric that can help you understand how much of your source is tested. It's a very useful metric that can help you assess the quality of your test suite, and we will see here how you can get started with your projects.
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. ...