CoverageMeter
Code Coverage Measurement for C/C++

  CoverageMeter - Code Coverage Tool for C/C++

CoverageMeter is a complete code coverage tool chain available under Linux or Microsoft Windows®. It analyzes the performance of a software validation and permits to measure the performance and optimizes the testing process of a C or C++ applications:

CoverageMeter can be uses for every testing steps and methodologies (unit tests, automatic tests, manual white box tests, black box tests, etc…), and permits to collect and merge the execution reports together.

CoverageMeter is a test coverage analyzer for C or C++ programs. It is composed of 4 tools:

  1. CoverageScanner, which analyzes, instruments and generates the C/C++ application.
  2. CoverageBrowser, which displays and manages the results of the coverage analysis.
  3. Execution Agent, a small free tool which is dedicated to manual tests and specially for black box interactive tests.
  4. An optional Microsoft® Visual Studio® 2005 & 2008 Add-In which permits to generate code coverage configurations from every C/C++ projects created by Microsoft®Visual Studio®.

index_all001.gif
Figure 1: Code Coverage Toolchain for C/C++ Overview

  CoverageScanner - Instrumentation during the Generation

CoverageScannerinstruments your source code during the compilation and generates an instrumented program, shared library or plugin. The instrumented program keeps track of the code instructions that were executed while the program was running (execution count or hit only are supported) and produces an execution report (csexe file) upon program termination. In order to get the best quality of code coverage metrics, CoverageScanner instruments not only on the function and statement level but also on the decision and condition level. Optionally, it is possible to insert in this report the test name and its execution status (passed or failed) using a batch script or directly in the application itself. This permits to integrate in a test framework (CppUnit, CxxTest, …) the generation of the code coverage information for each test item.



CoverageScanner is a command line tool which substitutes the compiler. Principally, it inserts instrumentation instructions into the preprocessed source code and calls up the native compiler. (GNU gcc or g++, Microsoft® Visuali Studio® 6.0, .NET, Express or Embedded C++ compiler, Intel® C++ compiler, …, or any other tool suite) A database (.csmes file), which contains the list of instrumentations and a copy of the instrumented source code, is generated at the same time. CoverageScanner is configurable via a profile and can be adapted to most compilers present on the market.



After the generation, the program can be run as usual and produces an execution report on exit. (.csexe file)

New CoverageScanner supports now TrollTech Qt library.

  CoverageBrowser - View, Analysis and Management of Code Coverage Result

The execution report can be analyzed and managed using CoverageBrowser.

It is a graphical interface which enables the user to browse and manage the execution reports. It therefore enables the user to find untested code portions, dead code and inefficient tests.

Overview of features:


index_all002.gif
Figure 2: CoverageBrowser: Code Coverage Screenshot