Testing embedded software: simulators, benches and real hardware
Test device software in steps: on a laptop, on a bench with the real chip and a fake world, then on the real device. Cause faults on purpose and cut power mid-update.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a flight simulator for a gadget. The pilot sits in a real cockpit with real controls, but the sky is fake. Nobody risks a real plane, and the trainer can make a storm whenever it likes.
Leo has built the Daily List lamp, a small desk light with one button. It glows green when no task is due and amber when one is. It pairs with the phone app over a short-range wireless link. It has no screen. Its code is : software that lives inside a device and does one job there.
Tom must test it. A laptop alone is not enough, because the real chip has its own timing and its own wires. But a real room with real clocks and batteries is slow and hard to control.
So the team tests in steps. In a , the lamp's real code runs on an ordinary computer, with a fake lamp and a fake button around it.
On a , the real chip is wired to a computer that pretends to be the button, the battery and the clock. This is a : the real hardware runs while a computer fakes the world around it.
On the bench, Tom can cause trouble on purpose. A stuck button. A battery reading that jumps. A lost wireless message. This is : causing a fault on purpose to see how the system copes.
Leo also sends new code to the lamp over the air, which means over a wireless link and not a cable. If the power fails halfway, the lamp might never start again. Tom tests that too.
The picture has limits. A simulator is only as good as its model of the sky. A fake world can miss things the real world does.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
The lamp's no-screen design is an example, not a requirement of embedded software. Use safe isolated training rigs and simulated fault inputs; do not risk people, equipment or an occupied home to demonstrate a failure.
PLAIN WORDS · 1 in this section
- demonstrate
- show clearly
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Testing device software step by step, from a laptop to a bench to the real thing.
- Run code on a laptop
- Wire the chip to a bench
- Inject a fault
- Try the real device
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The flight simulator cockpit | The real chip on a test bench |
| The fake sky | The simulated world around the chip |
| A storm made on demand | An injected fault |
| The real flight | The trial on the real device |
WHERE THIS PICTURE STOPS
- A simulator is only as good as its model of the sky. A fake world can miss real effects.
- A pilot trainer repeats a storm exactly. Real hardware has noise that a bench may not copy.
- A trainer is not a real flight. The real device is still the last step.
- Fault injection can occur in unit tests as well as hardware rigs; two slots alone do not guarantee safe updates.
HOOK
Fake the world, keep the chip, cause the storm.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
Climb in steps: the lamp's code on a computer, the real chip on a bench, then the lamp itself.
| In the trick | What it stands for |
|---|---|
| Computer | the real code runs on an ordinary computer, with a fake lamp and a fake button |
| Bench | the real chip is wired to a computer that pretends to be the button, the battery and the clock |
| Lamp | the real device is the last step |
Fault injection can occur in unit tests as well as hardware rigs; two slots alone do not guarantee safe updates.
TELL A FRIEND
A flight simulator keeps the real controls and fakes the sky. A keeps the real chip and fakes the world.
OFTEN MIXED UP WITH Games, connected devices and embedded software: an overview. The overview shows why devices are different. This lesson shows the steps that test them.
Sources & standards — 4 sources
- Market practice
SIL and PIL Simulations — R2026b ↗ — MathWorks · Actual R2026b introduction/workflow/comparison/interface sections reviewed. SIL compiles actual generated code on host; PIL runs target code or equivalent instruction-set simulation and need not be real time; neither alone proves real I/O/environment behaviour.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
What Is Hardware-in-the-Loop (HIL)? ↗ — MathWorks · Actual real-I/O/real-time plant workflow and MIL/SIL/PIL comparison sections reviewed; exact closed-loop source image privately examined. Model fidelity and chosen signals constrain evidence. Product source artwork remains link-only without an applicable public grant.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
A/B system updates ↗ — Android Open Source Project · Actual AOSP introduction, partition and bootloader sections reviewed: legacy A/B is explicitly distinguished from Virtual A/B. Bootable, successful and active attributes, fallback and current-slot protection are implementation details. The two-copy toy model does not guarantee every real device.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
ETSI EN 303 645 V3.1.3 (2024-09) Cyber Security for Consumer Internet of Things: Baseline Requirements ↗ — ETSI · Actual V3.1.3, September 2024, front matter/scope and selected §5.3 update / §5.9 outage-reconnection passages reviewed. Consumer-IoT baseline; applicability conditions and shall/should matter. ETSI TS 103 701 is the assessment companion. PDF p2 restricts reproduction/modification; source figures link-only.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
PRACTISE AND KEEP
Sources for this topic — 4 sources
- Market practice
SIL and PIL Simulations — R2026b ↗ — MathWorks · Actual R2026b introduction/workflow/comparison/interface sections reviewed. SIL compiles actual generated code on host; PIL runs target code or equivalent instruction-set simulation and need not be real time; neither alone proves real I/O/environment behaviour.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
What Is Hardware-in-the-Loop (HIL)? ↗ — MathWorks · Actual real-I/O/real-time plant workflow and MIL/SIL/PIL comparison sections reviewed; exact closed-loop source image privately examined. Model fidelity and chosen signals constrain evidence. Product source artwork remains link-only without an applicable public grant.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
A/B system updates ↗ — Android Open Source Project · Actual AOSP introduction, partition and bootloader sections reviewed: legacy A/B is explicitly distinguished from Virtual A/B. Bootable, successful and active attributes, fallback and current-slot protection are implementation details. The two-copy toy model does not guarantee every real device.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
ETSI EN 303 645 V3.1.3 (2024-09) Cyber Security for Consumer Internet of Things: Baseline Requirements ↗ — ETSI · Actual V3.1.3, September 2024, front matter/scope and selected §5.3 update / §5.9 outage-reconnection passages reviewed. Consumer-IoT baseline; applicability conditions and shall/should matter. ETSI TS 103 701 is the assessment companion. PDF p2 restricts reproduction/modification; source figures link-only.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.