Reference no: EM133218133
Compare the terms path coverage and line coverage and list the main differences between these coverage metrics.
Information
Path coverage is a metric that assesses how well a test suite exercises the code under test. The idea behind path coverage is that, in order to thoroughly test a piece of code, all of the different ways that the code can be executed should be covered by the test suite.
To assess path coverage, all of the different paths through the code are considered, and it is checked to see if the test suite exercises all of those paths. If the test suite does not exercise all of the different paths, then the path coverage is said to be incomplete.
Line coverage is a metric that assesses which lines of code have been executed by the test suite. Line coverage is a less comprehensive metric than path coverage, as it does not take into account the different ways that the code can be executed.
To assess line coverage, all of the lines of code in the program are considered, and it is checked to see if the test suite exercises all of those lines. If the test suite does not exercise all of the lines, then the line coverage is said to be incomplete.
In general, a test suite with high path coverage is likely to also have high line coverage. However, it is possible to have high line coverage without high path coverage, if the test suite focuses on executing individual lines of code rather than exercising the different ways that the code can be executed.