For a successful project management, it is crucial to evaluate the development quality to analyze the deviation and make the necessary corrections before project delivery. This evaluation should not be only for code source but also for test scripts.
Especially for an embedded software project, the test procedure is the major phase to assign and signalize all bad or conflict behavior. The code coverage is considered as the most used tool to evaluate the test step and ensure its credibility.
This tool, mostly used for unit test, is based on measuring code parts tested. Metrics vary among different criteria:
- Statement Coverage: (Line Coverage or C0)
Each line of code must be checked and executed. It allows checking what is expected but it cannot test the unexpected behavior.
- Function Coverage:
Each function or procedure in the programs must be invoked. It is useful during preliminary testing to assure at least some coverage in all areas of the software.
- Call Coverage:
All call’s function must tested and executed. This metrics could avoid bugs that commonly occur in interfaces between modules.
- State coverage:
Ensure that maximum of program’s outputs are checked by a test. State coverage considers all outputs which are available to the test as variables, but it does not consider outputs to files, network sockets, or other types of I/O.
- Decision Coverage: (Branch coverage or C1)
Each condition expressions should be tested at least once with TRUE value and another with FALSE value. The entire condition expression is considered regardless of sub-conditions coverage (with logical operators or not).
This metric ensure that no branches lead to any conflict on system behavior and it eliminate problems that occur with statement coverage testing.
More about code coverage metrics and coverage tools will be presented soon in another article.
Author- Safa Achour