Difference between revisions of "Technical topic: Code Coverage"

From TASTE
Jump to: navigation, search
(Created page with "== The need == Critical systems must be heavily tested. As part of the usual validation phase, it is important to ensure that tests exist to cover all the instructions and br...")
 
m (1 revision imported)
 
(No difference)

Latest revision as of 21:01, 4 August 2017

The need

Critical systems must be heavily tested. As part of the usual validation phase, it is important to ensure that tests exist to cover all the instructions and branches in the code. To achieve this one tool is to measure the code coverage at runtime. TASTE offers facilities to do that.


How to do it

Edit the deployment view and double click on your partition to view the properties. Select "Enable coverage" as shown on the picture below:

Coverage 1.png

Then build your system, and run it like this (assuming your partition name is "demo_coverage"):


   $ cd binary.c/binaries
   $ taste-collect-coverage ./demo_coverage


It will run the binary for 10 seconds, process all gcov data and open a browser with all coverage data:

Coverage 2.png