How do you test a real-time deadline rather than only average performance?
Answer
Define the triggering event, completion point, maximum deadline and allowed jitter, then measure worst-case behaviour under representative concurrent load, interrupt activity, memory pressure and peripheral traffic. Use hardware timestamps or suitable tracing, report distributions and worst cases, and fail on missed deadlines even when the average remains excellent.
Strong answer includes
- measures end-to-end worst-case latency
- loads competing resources and interrupts
- distinguishes a hard deadline from an average target
Practical example
A control loop averages 2ms response time against a 5ms hard deadline, so it looks fine on a dashboard. Under a stress test with simultaneous CAN traffic bursts and a competing lower-priority task, the worst-case latency spikes to 7ms once every few thousand cycles, which a pure average-based test would never have caught but a worst-case latency histogram immediately flags.