Testing and validation guides

Test ECUs before they reach a vehicle: the X-in-the-loop levels, restbus simulation from a DBC, automatic checks on recordings, fault injection, and CAPL next to its Python equivalents.

5 guides Read them in this order

  1. HIL, SIL, MIL and PIL testing explained for ECU and CAN engineers What model-in-the-loop, software-in-the-loop, processor-in-the-loop and hardware-in-the-loop testing each check, what a HIL bench is made of, where CAN and the DBC come in, and how the levels fit together in a test strategy. 10 min read Beginner Guide
  2. CAPL for Python and C engineers: the patterns, side by side with python-can A practical introduction to CAPL, the event-driven language of Vector CANoe and CANalyzer, for engineers who know Python or C. Message handlers, timers, sending frames, DBC signals and test cases, each next to its python-can and cantools equivalent. 10 min read Beginner Tutorial
  3. Restbus simulation from a DBC with python-can and cantools How to simulate every other ECU on a CAN bus from a DBC file: cycle times from GenMsgCycleTime, signal values you can change during a test, live counters and CRCs, and silencing one ECU to test timeouts. A tested Python restbus in about 60 lines. 11 min read Intermediate Guide
  4. Automated CAN signal checks against a DBC: cycle time, range, counters and CRCs Turn a CAN recording and a DBC into automatic test results. Check cycle times and timeouts, frame lengths, signal ranges, alive counters, CRCs and unknown IDs with a tested Python checker, then run it as a pytest test in CI. 10 min read Intermediate Tutorial
  5. CAN fault injection: what to inject and how to check the ECU's reaction How to test an ECU's reaction to communication faults: missing messages, frozen counters, wrong CRCs, invalid values, wrong lengths, slow senders, error frames and wiring faults. With a tested Python fault injector and a check that each injected fault is detected. 11 min read Advanced Guide

Other topics