Slide 1

Code Coverage
Dynamic Analysis

Code coverage: Objective measurement of code executed by your tests

The Cantata code coverage check capabilities can be integrated with Cantata tests or any external test driver. This feature provides an objective measurement of test execution completeness, making it an ideal supplement to requirements-based and robustness tests. Cantata code coverage makes it easy to:

What is Code Coverage and why is important?

Code coverage check is a crucial dynamic analysis technique that measures the extent to which code has been executed by tests. Individual constructs, also known as syntax elements, can be used to identify the logic structure within the code. Measuring the coverage of these constructs helps to determine the effectiveness of testing, and identify gaps in requirements-driven and robustness-driven testing approaches.

In order to comply with international software safety standards, coverage analysis is required. Higher safety levels require more rigorous coverage metrics to be achieved. By using structural code coverage tools, organizations can ensure that their code meets safety standards and minimize the risk of software-related incidents.

A code coverage tool is a software program that analyzes the extent to which a codebase has been exercised during testing. It determines the percentage of code statements, branches, functions, or lines that have been executed by the test suite. Code coverage tools are essential for measuring the quality and thoroughness of software testing. They can help identify areas of code that require additional testing, and assist developers in ensuring that their codebase is well-tested and free of defects.

Code coverage tools can be integrated with development environments such as Eclipse and Visual Studio. Using a code coverage tool is essential for ensuring that software meets safety and quality standards. In industries such as aerospace, automotive, and medical devices, compliance with safety standards such as DO-178C, ISO 26262, and IEC 62304 requires code coverage analysis. By using a code coverage tool, organizations can ensure that their software meets safety standards, minimize the risk of software-related incidents, and improve the overall quality and reliability of their software products.

“Using coverage helped us to really think about whether certain functions and blocks were needed. We confirmed great confidence in our software as everything had been tested to 100% decision coverage"

Rolf Keller, Software Engineer,

“Cantata automatically generates test reports that prove what has been tested and how extensive the test coverage was for each test case”

Johnny Johansson, Global Validation & Verification Tools Manager, SAAB

Cantata Code Coverage Capabilities


To measure code coverage, Cantata uses specific metrics and standard-specific Rule Sets to perform integrated checks and ensure required code coverage check levels are met.

  • Function Entry Points
  • Function Call-Returns
  • Basic Blocks
  • Statements
  • Decisions (branches)
  • Loops
  • Relational Operators
  • Boolean Operators
  • Conditions
  • MC/DC (Unique-cause and Masking variants)


“Build Variant Coverage is a powerful tool that analyzes source code executed across multiple build variants. Using pre-compiled defines (#defines), Cantata can easily differentiate between different build variants. With Cantata Coverage Viewer, you can view aggregated data for multiple build variants of the same source code.


Cantata Diagnostics offers complete project code-tree coverage, enabling you to drill down to individual code constructs within each line of code. This helps you pinpoint gaps and direct your test efforts more efficiently.

Our automatic test case coverage optimization tool helps with test case vector selection from large data sets and reduces regression testing overhead. With Cantata Diagnostics, you can optimize your testing process and achieve more accurate results.


Cantata provides unparalleled filtering of code coverage data by selection of:

  • Coverage Metrics
  • Projects
  • Test Cases
  • Inheritance Contexts
  • User-defined Contexts
  • Build Variants
  • Coverage Files

Cantata, as a code coverage tool, can also trace code coverage throughout the execution of individual test cases.


In addition to the powerful diagnostics of code coverage check results within the Eclipse® GUI, Cantata generates flexible user configurable reports in XML, HTML and safety standards certification ready ASCII and HTML text reports.

Build Variant Coverage reports aggregate coverage data across all defines, which is suitable as certification evidence for all build variants of the source code.

Reports and certification evidence embed the integrated checks on the achievement of the required coverage metric targets.

How does Cantata Code Coverage Work

Cantata Coverage enables code coverage analysis using instrumentation through its GUI or CLI.

This generates coverage data that can be used for graphical diagnosis and certification purposes. The tool seamlessly integrates with Cantata tests and other test frameworks, allowing you to measure execution from multiple sources.

The coverage analysis is further simplified with customizable Rule Sets that automate code instrumentation, data reporting, and coverage checking, making it compliant with various software safety standards.