Code coverage is a white box testing measure used to describe the degree to which the source code of a program has been tested. Coverage analysis is used to assure quality of your set of tests, not the quality of the actual product. Coverage analysis requires access to test program source code and often requires recompiling it with special commands. Before releasing, we strive for more than 75% coverage of statements, branches, or conditions.
There are many tools available in the market to help calculate code coverage but it needs specialized skills to analyze the results of code coverage. Code coverage analysis is the process of:
- Finding areas of a program not exercised by a set of test cases,
- Creating additional test cases to increase coverage and
- Determining a quantitative measure of code coverage, which is an indirect measure of quality.
An example of what code coverage statistics mean is that if there is a method with 100 lines of code and only 60 of these lines are actually executed when tests are being run, then the method is considered to have code coverage of 60 percent. This requires an expert testing brains to improve code coverage and strive to test more functionality