Embedded and systems
Software-in-the-loop (SiL)
In software-in-the-loop testing, the production code of an embedded system runs on a PC or server and is tested against a simulated environment, with no target hardware involved.
Also known as: SIL testing
How does SiL work?
The source code that will later run on the microcontroller is compiled for the development machine. Hardware-related layers such as drivers or register access are replaced with stubs or an abstraction layer. A simulation supplies the input data and evaluates how the software responds.
Advantages
- Fast and cheap: tests run in seconds, in parallel and without a test bench.
- Ideal for CI: SiL tests fit into any build pipeline and give developers quick feedback.
- Easy to debug: breakpoints, logging and code coverage measurement work as they do for ordinary software.
Limitations
SiL checks the logic, not the timing on the real hardware. Interrupt timing, memory constraints or compiler differences go undetected. That is why SiL and hardware-in-the-loop complement each other: SiL for breadth, HiL for closeness to the hardware.