AdaCore: Build Software that Matters
I Stock 2159775570
Dec 01, 2026

MC/DC in Rust Native and on QNX

When writing high-integrity software to the highest levels of functional safety, you often need to demonstrate that your test cases cover your source code to a sufficient degree. Measuring code coverage does exactly that, and GNAT Dynamic Analysis Suite (DAS) helps with that, on your development host and on your deployment target. In this example, we will use QNX on a Raspberry Pi as the target environment.

Modified Condition Decision Coverage is a code coverage technique often required for the highest level of coverage: DO-178C DAL A and ISO 26262 ASIL D. Technically, MC/DC is not required for ISO 26262 ASIL D, but projects often strive to achieve it to increase confidence in their test suites.

GNAT Pro for Rust has supported MC/DC since the 26 release (first released at the end of 2025). The MC/DC capability is not available in upstream Rust just yet; AdaCore is working with the Rust project to make it available in the upstream compiler.

Often, achieving full MC/DC is difficult in a single continuous test run; instead, you need to combine multiple different test runs. Some of these may be on the development host, some may be on the cross-compiled target. For this reason, GNAT DAS allows a project to combine evidence from different runs on the target with evidence from runs on a test host.

We can visualize MC/DC coverage with a simple example, such as:

pub fn may_start(guard_closed: bool, start_pressed: bool, auto_requested: bool) -> bool {
    if guard_closed && (start_pressed || auto_requested) {
        true
    } else {
        false
    }
}

To demonstrate MC/DC coverage, we need to show that each condition in the decision (guard_closed, start_pressed, and auto_requested) can independently affect the decision's outcome while holding all other conditions fixed. This means we need to cover the following truth table:

Test Caseguard_closedstart_pressedauto_requestedResultShows MC/DC for
1falsetruefalsefalseguard_closed (vs 2)
2truetruefalsetruestart_pressed (vs 3)
3truefalsefalsefalseauto_requested (vs 4)
4truefalsetruetrueauto_requested (vs 3)


If a test suite does not cover the entire truth table, then you will get a report much like the following:

https://www.adacore.com/uploads/Screenshot-2026-11-30-at-17.19.54.png

In this case, rows 1 and 2 were executed on the Linux host, and rows 3 and 4 were ‘planned’ to run on the QNX target.

We can copy the binary to the target, run it, and then copy the raw coverage files back and process them. If we then look at the coverage from the target, then we see the opposite result:

https://www.adacore.com/uploads/Screenshot-2026-11-30-at-17.22.59.png

However, when we combine the host and target files together, we are all green.

https://www.adacore.com/uploads/Screenshot-2026-11-30-at-17.24.15.png

Summary

Code coverage is important to make sure your test cases cover all of your source code. This is especially important if high levels of functional safety are required. AdaCore has Rust code coverage available today for both host and target environments, and we expect it to be merged into the upstream compiler in the near future.

FAQs

If you target DO-178C DAL A, then yes. If you target DAL B or ISO 26262 ASIL D, then it is not technically required, but still a good idea

No. AdaCore is a strong contributor to open-source projects, and we are working to make code coverage technology available as open source. GNAT DAS, however, is the part that processes the data and provides the report. This solution is qualified and available only from AdaCore.

Yes. Reach out to your AdaCore sales representative and they can set you up with everything that you need for this.

Author

Mark Hermeling

Headshot
Head of Technical Marketing, AdaCore

Mark has over 25 years’ experience in software development tools for high-integrity, secure, embedded and real-time systems across automotive, aerospace, defence and industrial domains. As Head of Technical Marketing at AdaCore, he links technical capabilities to business value and is a regular author and speaker on on topics ranging from the software development lifecycle, DevSecOps to formal methods and software verification.

Blog_

Latest Blog Posts