CAN / ECU Testing
Automating CAN-based ECU tests with AI agents
The part of the job that doesn't show up in the test plan
Ask an engineer to describe a CAN test and they'll usually describe the assertion: "send the heartbeat, confirm the gateway responds." What they won't mention, because it's assumed, is everything that has to happen around that assertion for the result to mean anything. The adapter has to be attached and the interface acquired before a single bit goes on the bus. The message that gets sent has to be exactly the one that was approved for that test, not a hand-edited variant left over from debugging yesterday. Someone has to watch the response: not glance at a scope trace after the fact, but actually gate the next step on what came back. And when the run ends, the interface has to be released cleanly, or the next person's test inherits a bus in an unknown state.
None of that is optional, and none of it is really "testing" in the sense the test plan describes. It's procedure. And on most benches, that procedure lives in a person's hands: whoever is free that day attaches the adapter, hand-crafts or replays raw frames from a DBC one test at a time, watches signals in a scope tool and calls pass or fail by eye, then writes up what happened afterward, often from memory or a screenshot taken after the fact.
Where that breaks down
This works fine for one test, on one bench, done once. It breaks down exactly where CAN and ECU testing actually gets expensive: repetition. A regression suite that has to run against every new gateway build. A heartbeat-timeout check that has to be repeated across a dozen ECU variants. An overnight endurance run that nobody wants to sit and watch. Each of those needs the same bounded lifecycle done exactly the same way every time, without a person re-deriving the steps from memory.
What an agent-driven workflow changes
An AI agent that treats the CAN interface as a bounded resource, rather than a general-purpose shell, can carry that lifecycle end to end. It acquires the interface as an operation with a defined start and end, not a background state someone forgets to tear down. It encodes and sends only the approved message from the DBC, at the required cycle time, not an ad hoc frame typed into a terminal. Instead of a fixed sleep-and-hope wait, it gates the next step on a decoded signal condition, so the sequence only advances once the gateway or ECU has actually responded the way the test expects. And it packages the run as a single reviewable artifact: the raw trace, the decoded signals, and the verdict together, instead of a person's after-the-fact writeup.
That's the same shape of test a bench engineer already runs by hand: attach, send, watch, release, just carried out as a bounded, repeatable procedure instead of a manual one. A missing-heartbeat check becomes: acquire the interface, run the periodic send, capture the gateway's reaction, stop transmission, release the interface clean. Nothing about the test logic changes; what changes is that the lifecycle around it no longer depends on someone remembering every step in the right order.
Decode is not optional
A CAN test that never gets past raw arbitration IDs and hex payloads isn't really testing a requirement. It's testing that bytes moved. Real acceptance criteria are almost always phrased in terms of a decoded signal: "charge-ready goes high," "commanded and measured pressure stay within tolerance," "the gateway drops zero frames during the allowlist test." Gating on a decoded signal, using the same DBC the test was written against, means the agent's notion of "passed" matches the engineer's notion of "passed", not a proxy for it.
What this looks like end to end
Put together, that lifecycle covers the practical surface of CAN and ECU work: classic CAN and CAN FD over SocketCAN, DBC-based decode and encode, XCP-on-CAN for calibration and measurement, and UDS over CAN or DoIP for diagnostic exchanges. The point isn't a longer feature list. It's that the same acquire-send-gate-release shape applies whether the test is a five-minute smoke check or a five-hour endurance run, and whether a person is at the bench to watch it or not.
CAN / ECU Testing: Automate CAN-based ECU testing without losing the engineer in the loop
See how this workflow can be automated →