Technical topic: Code Coverage

Jump to: navigation, search

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