What should watchdog testing prove?
Answer
Prove the watchdog detects the intended hangs within the required time, cannot be accidentally serviced by an unhealthy task, and drives the device to a controlled recovery path. Inject blocked loops, deadlocks and scheduler starvation; verify reset reason, persistent-state integrity, rate limiting for reset loops, diagnostics and any escalation to a safe mode.
Strong answer includes
- injects realistic hangs rather than merely waiting
- verifies reset cause and persistent data
- covers repeated-reset containment
Practical example
A watchdog test suite only verifies that the device resets after the main loop is stopped with a debugger breakpoint. It misses a real bug where a task deadlocks on a mutex but a lower-priority interrupt still services the watchdog periodically, keeping the device alive in a hung state indefinitely. A better test would deadlock the actual mutex used in production code and confirm no other path can service the watchdog while that task is stuck.