Considerations for Targets

Code Coverage can be measured for desktop applications as well as embedded software or drivers. Depending on the target, you use a certain (cross) compiler. Testwell CTC++ provides different run time libraries for writing coverage data and several ways to cope with limited memory.

Compiler Configuration

Testwell CTC++ interacts with the compilation process and needs to know the compiler and linker command and their options. Several compiler configurations are delivered in the core package (depending on the operating system).

The compiler configuration is stored in a configuration file, the default one is ctc.ini in the Testwell CTC++ directory.

For cross-compilers, Verifysoft provides many additional configurations.

Runtime Library

The Testwell CTC++ runtime library is linked to the test executable. It writes out the counter data during test execution.

For desktop applications on host systems, the runtime is delivered platform specifically (Windows, Linux, macOS). For embedded targets, the runtime is delivered as C code and can be adapted to the possibilities of the target.

It is also possible to use Testwell CTC++ without the runtime: In the BITCOV setup, the counter data remain in an array in main memory and are read from there externally.

Coping with limited memory

For embedded targets, memory for the test executable and for the counter data is often restricted.

Testwell CTC++ provides the following ways to control the size of the program:
  • The instrumentation mode (function, decision or multicondition) determines the number of probes added to the code, and hence its size. It can be reduced if memory is low.
  • With partial instrumentation on file level, only small parts of the code can be instrumented in several iterations. The coverage can be combined for reporting.
  • BITCOV omits the runtime layer.

For the counter array size, BITCOV with a bit array is the optimal choice: Instead of counting, only the information if a measure point was hit or not is stored in single bits.