Skip to main content

Coco Code Coverage - Deeper Support for Qt for MCUs

Comments
Coco Code Coverage - Deeper Support for Qt for MCUs
6:11

Teams building embedded applications with Qt for MCUs have always faced a practical barrier to continuous code coverage: the setup overhead was simply too high:

  • Configuring toolchains manually

  • Writing custom routines to retrieve results from the device

  • Handling C++ and QML coverage through separate processes.

Each step added friction that made sustained coverage measurement impractical for most teams.

This release removes that barrier. Coco now integrates directly with Qt for MCUs 2.12.1., bringing the same coverage capabilities available on desktop to embedded targets, without the manual overhead that has historically made it difficult to sustain.

Why Embedded Code Coverage Has Been So Hard — Until Now

Most teams know that untested code is a liability, and in regulated industries (automotive, medical, industrial) standards like ISO 26262 and IEC 61508 make coverage a formal requirement, not a best practice.

The challenge has always been execution. Embedded environments vary widely in toolchain, memory constraints, and hardware interfaces.

Coverage tools designed for desktop development don't map cleanly onto these realities. The result is that many embedded teams measure coverage inconsistently, or only on simulators that don't fully reflect real hardware behaviour, which undermines the value of the measurement entirely.

Coco Code Coverage for Qt for MCUs: What's New in This Release

Coco now ships with pre-configured compiler profiles for Qt for MCUs supported toolchains, removing the need for manual toolchain setup. QML (Qt Quick Ultralite) code is instrumented automatically alongside C++. Execution reports are retrieved directly from connected target boards through DeviceLink, with no custom I/O code required.

In CoverageBrowser, new MCU-specific views provide device discovery, real-time debug output monitoring during test runs, and one-click import of execution reports from connected devices.

Screenshot 2026-02-26 at 16.48.46

CoverageBrowser's new QtMCU panel guides device connection and execution report import in a few clicks.

Unified C++ and QML Coverage, Visible in Real Time

One of the most significant practical improvements is the ability to merge C++ and QML coverage results into a single instrumentation database. Previously, getting a complete picture of an MCU application meant correlating two separate coverage processes. Now both appear together in CoverageBrowser, updated live as tests run, line by line, directly in the source code.

This matters because embedded applications built with Qt for MCUs are rarely purely C++ or purely QML. Business logic and UI code are intertwined, and a coverage gap in either layer is a risk. A unified view makes it straightforward to identify where that risk sits and act on it.

Screenshot 2026-02-26 at 16.51.02

QML source code with live coverage highlighting in CoverageBrowser. Green lines confirm tested paths; red lines identify gaps. The QtMCU console shows the test output directly alongside.

Screenshot 2026-02-26 at 16.51.30

Importing an execution report from a connected MCU target. Each test run accumulates into the instrumentation database, building a complete coverage picture over time.

Achieving 90%+ Coverage on Embedded: A Practical Testing Workflow

Reaching meaningful coverage levels on embedded targets is most effective with a layered approach:

  • Host-based unit tests validate core logic quickly, without requiring hardware in the loop.

  • Coco Test Engine generates test data automatically, including edge cases that are easy to overlook when writing tests by hand, reducing the manual effort required to reach high coverage levels.

On-device testing with Qt for MCUs then covers the full application on real hardware, with results feeding back into the same instrumentation database. Each layer is independently useful. Combined, they make 90%+ coverage across a complete embedded application a practical and measurable outcome, not just a target.

Coco and Qt for MCUs: A Complete Quality Story for Regulated Markets

Code coverage is one part of a broader quality argument that matters particularly in markets where low quality is not acceptable.

  • Qt for MCUs addresses how embedded applications are built  with performance, a rich component model, and QML for efficient UI development.

  • Coco addresses how they are verified. Together, they give teams in regulated industries a cohesive answer to both the development and the compliance side of embedded software quality.

This is especially relevant for teams that need to demonstrate test thoroughness to auditors or certification bodies. Coverage data produced by Coco can be incorporated directly into compliance documentation, making the path from development to certification measurably shorter.

Also in This Release: CRAP Metric, Python Support, and Faster Toolchain Setup

The Qt for MCUs integration is one part of this Coco release. The same version introduces the CRAP metric (Change Risk Anti-Patterns), which combines cyclomatic complexity analysis with coverage data to rank functions by risk, giving teams an objective basis for prioritising where to write new tests. Python coverage via coverage.py brings the same analysis capabilities to mixed-language codebases, with unified C++ and Python views in a single instrumentation database. The new cocosetup utility automates compiler wrapper configuration for toolchains not covered by Coco's default profiles, with built-in verification and support for CI pipelines.

CRAP metric

Read the full release blog for a complete overview
Read about the CRAP metric in documentation

Get Started

 

Stop measuring coverage on simulators. Start measuring it on real targets

Coco and Qt for MCUs 2.12.1 are available now. If you are building with Qt for MCUs, the integration is ready out of the box — no toolchain configuration, no custom IO, no separate QML process.

If you are new to Coco, a free trial gives you full access across all supported languages, platforms, and targets.

Start your free evaluation → 

Talk to us about your project →

Read more about Coco →

Get to know more

Read the safety certification whitepaper — How teams in regulated industries use Coco to build certification evidence

Explore the Qt for MCUs integration — Step-by-step documentation for the full embedded coverage workflow

Learn about Tool Qualification Kits — Pre-built qualification documentation for ISO 26262, DO-178C, IEC 62304, and EN 50128

Read Coco Release Notes - Coco v7.5.0

Comments

Subscribe to our blog

Try Qt 6.11 Now!

Download the latest release here: www.qt.io/download

Qt 6.11 is now available, with new features and improvements for application developers and device creators.

We're Hiring

Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.