Skip to content
BoKSA

Testing Fundamentals

Testing Fundamentals

Use this page to revise the vocabulary behind testing firmware.

Why automated tests exist

They catch regressions, document behaviour, and make refactoring safer. On devices you also have hardware tests that a PC unit test cannot replace.

The test pyramid

Unit tests isolate a function (often on the host with hardware mocked). Integration tests cover several modules or a bus. End-to-end / hardware-in-the-loop runs on (or against) real I/O. Put most effort at the bottom of the pyramid.

Writing a test

Arrange-act-assert. Names describe behaviour. Coverage is a signal, not a guarantee. Flaky tests that depend on timing or wifi without control waste trust.

Starting Points

Key Points

  • You can explain why automated tests matter: regressions, documentation, safe refactoring.
  • You can distinguish unit, integration, and hardware/E2E tests for an embedded project.
  • You can structure a test using arrange-act-assert.
  • You can explain what coverage measures and why high coverage is not enough.
  • You can explain why some behaviour must be tested on hardware.