AI generated unit testing with Claude code and Cantata
Closing the Loop: AI Unit Testing Meets Qualified Coverage
AI unit testing is changing how safety-critical software teams build their test suites. For teams working under ISO 26262, EN 50128, IEC 61508, or IEC 62304, unit-test development has always been the most time-consuming part of the lifecycle. In fact, writing test harnesses by hand, generating stubs, achieving MC/DC coverage, and maintaining the suite as code evolves can consume 30–50% of a project’s effort.
That equation now changes. Version 26.04 of Cantata introduces a direct integration with Claude Code — Anthropic’s AI coding assistant. Together, they operate in a closed feedback loop with Cantata’s test execution engine. As a result, an autonomous cycle produces qualified tests, runs them, measures coverage, and iterates until the safety-mandated coverage target is met.
The Five-Step Automated Cycle
- Analyze — Claude Code inspects the source code under test. It identifies functions, parameters, control flow, and boundary conditions.
- Generate — Next, it creates Cantata-compatible test cases targeting each control path and boundary value.
- Execute — Cantata then compiles the generated tests against the target toolchain. The tests run on host or on target hardware.
- Measure — Cantata reports the achieved statement, branch, and MC/DC coverage. It feeds the result back to the AI.
- Repeat — Finally, Claude Code identifies coverage gaps and generates additional tests to close them. The loop iterates until the required threshold is reached.
Why AI Unit Testing Needs Qualified Tools
This is not “AI generates code and humans hope it works.” Cantata remains the qualified verification authority. Every test is compiled, executed, and measured by a tool already certified for:
- ISO 26262 ASIL D
- EN 50128 SIL 4
- IEC 61508 SIL 3
- IEC 62304 Class C
- DO-178C DAL A
In other words, the AI accelerates the generation step. The safety-qualified tool still owns the verification step. That distinction is what makes AI unit testing acceptable for safety-critical projects — not just a productivity hack, but a qualified workflow.
Watch the Demonstration
QA Systems’ Adam Mackay walks through the integration live. The session includes a real-time generation cycle on representative C/C++ code.
Why This Matters for Safety-Critical Teams
Three concrete benefits for engineering managers responsible for ISO 26262, EN 50128, IEC 61508, IEC 62304, or DO-178C projects:
- Closes the productivity gap without compromising rigor. AI-generated tests are still executed and measured by a qualified tool. The audit trail and traceability matrix that Cantata produces remain valid — only the time-to-coverage shortens.
- Targets MC/DC directly. The hardest coverage criterion to achieve manually — Modified Condition / Decision Coverage required at SIL 4 / ASIL D / DAL A — becomes a feedback signal for the AI to target additional test cases. The loop only stops when the required coverage is achieved.
- Reduces re-work after refactoring. When source code changes, the cycle re-runs automatically. The AI proposes updated tests; Cantata validates them. The team’s review effort drops from “rewrite the test suite” to “approve the diff.”
Live Webinar — 10th of June
To see this integration in depth, with live Q&A on how it fits into your existing CI/CD pipeline, join the upcoming Sightsys webinar:
C/C++ Test Automation with Claude Code and Cantata
Tuesday, 10th of June
Presented live by Adam Mackay, QA Systems
Topics covered:
- Cantata 26.04 architecture and the Claude Code integration layer
- Live demonstration on a representative embedded C/C++ codebase
- How qualified evidence is preserved through the AI-assisted workflow
- Integration with existing CI/CD pipelines (Jenkins, GitLab CI, Azure DevOps)
- Q&A with Adam — bring your specific project questions
Register here [insert your Rav Messer registration link] — limited seats, recording available to all registrants.
Further Reading
QA Systems’ detailed write-up of the integration architecture and a worked example: C/C++ Test Automation with Claude Code and Cantata — qa-systems.com.
Talk to Sightsys
If you’re considering AI-assisted test generation for your safety-critical project — or wondering how Cantata 26.04 would slot into your existing toolchain — contact the Sightsys team for a tailored demonstration on your codebase.
Sightsys — your local Israeli partner for safety-critical embedded development tools, qualification kits, and engineering support.
www.sightsys.co.il ·
ohad@sightsys.co.il ·
rinat@sightsys.co.il
Tags: #AI #tools #automation #C #CPP #UnitTesting #FunctionalSafety #Embedded #Claude #CodeCoverage #ISO26262 #SoftwareQuality