CppDepend Test Code Coverage

Harness Test Coverage Data

Writing automatic tests is a central practice to increase code correctness. Knowing which part of the code is covered by automatic tests helps improving tests and consequently, it helps increasing code correctness.

CppDepend gathers code coverage data from Bullseyeâ„¢, Cobertura and Visual Studio Team Systemâ„¢. From this data, CppDepend infers some metrics on methods, types, namespaces and assemblies : PercentageCoverage, NbLinesOfCodeCovered, NbLinesOfCodeNotCovered.

These metrics can be used conjointly with others CppDepend features. For example you can know what code have been added or refactored since the last release and is not thoroughly covered by tests. You can write a CQLinq rule to continuously check that a set of classes is 100% covered. You can list which complex methods need more tests.

Another unique usage of code coverage data in CppDepend is viusalizing code coverage through the code metric view. See the metric view on the CppDepend code base:

  • Rectangle are methods of the code base.
  • Each rectangle area is proportional to the #lines of code of the method.
  • and the rectangle color is defined by the percentage coverage by tests of the method.

Coverage FAQ:

CppDepend offers a wide range of features. It is often described as a Swiss Army Knife for C and C++ developers.

Start Free Trial