Step 17 of 36 · Quality and test
Hardware-in-the-loop and automated test
Automated tests on real hardware catch regressions that host tests miss. A test rig is a product with an owner and a budget.
Firmware tested only by hand on someone's desk will regress. The answer is layers. Unit tests run on a computer with the hardware faked. Hardware-in-the-loop tests run real firmware on a real board, with a rig that drives the inputs and measures the outputs.
A rig that runs on every firmware change tells you within the hour that a commit broke charging or the radio. It also lets you inject faults that are hard to stage by hand: brownouts, sensor failures, lost connections.
Rigs cost boards, fixtures and engineering time, and they break. Give the rig an owner, a budget and spare hardware. The common failure is a rig built once by an enthusiast, then left to rot when that person moves on.
Try this week
- Ask how long it takes to learn that a firmware change broke a basic hardware function. Set a target.
- Name an owner for test rigs and reserve units for them in the next build allocation.
Signs you've got it
- Every firmware change runs automated tests on real hardware before release.
- A broken test rig is treated as a blocker, not as background noise.
Resources
- bookTest-Driven Development for Embedded C (opens in a new tab)James Grenning
- articleContinuous Integration for Embedded Systems (opens in a new tab)Tayyar Guzel
- articleTest Pyramid (opens in a new tab)Martin Fowler
- articleBuilding Better Firmware with Continuous Integration (opens in a new tab)François Baldassari