Code coverage

Code coverage plays an important role as criterion for the decision to stop testing the code. Code coverage criteria are condition coverage, decision coverage, and modified condition/decision coverage. To measure code coverage, the source code has to be instrumented.


Code coverage measurement in TPT is indirectly possible by means of other tools like CTC++ and Gcov. For Simulink models you can use the Verification and Validation Toolbox (VV-Toolbox) or TargetLink. The results of the code coverage analysis can be integrated in the TPT report.

Measure the coverage of TargetLink production code

TPT supports the code coverage of TargetLink production code via TargetLink by dSPACE or CTC++ by Testwell.

Measure the coverage of Simulink models

TPT supports the coverage measurement of Simulink models via the tool Verification and Validation Toolbox (V&V-Toolbox) by Mathsworks.

In TPT you can choose TargetLink, CTC++ for TargetLink, or Simulink V&V as code coverage tools; or you write your own script.

Measure the coverage of C-code

TPT supports directly the coverage measurement by tools like CTC++ and Gcov that are responsible for the instrumentation and the measurement.

To observe the test coverage of C-code, you can use CTC++ or GNU gcov directly from within TPT.

Further coverage tools

TPT can work together with any other coverage tool. In this case, the configuration cannot be done in TPT and the results of the coverage will not appear in the TPT report.