Independent learning for embedded-systems engineersHardware · Firmware · Software
TEA-109CORE EMBEDDED SYSTEMS TOPICFOUNDATION

Verification, debugging and test automation

Build confidence across code, electronics and physical behaviour: verify requirements, preserve diagnostic evidence and automate tests without hiding the system under test.

After this module, you should be able to:

  • Choose the right test level for each engineering claim
  • Design embedded software for controllability and observability
  • Debug anomalies without losing evidence
  • Build reliable host, target and hardware-in-the-loop automation
01 / STRATEGY

Verification asks whether evidence supports a defined claim.

Testing is one verification method. Analysis, inspection, review and demonstration may be more effective for particular requirements. The method should be chosen from the claim, risk, failure modes and the level at which behaviour becomes observable.

CLAIMWhat must be shown?Requirement, interface rule, timing bound, risk control or architectural property
METHODWhere is it best examined?Review, analysis, unit, component, target, integration, HIL or system test
EVIDENCEWhat proves the conclusion?Controlled inputs, objective outputs, configuration, trace and acceptance decision
Debugging and verification have different purposes.Debugging explores why observed behaviour is wrong. Verification is controlled and repeatable evidence that specified behaviour is correct. A useful debug experiment is not automatically a verification test.
02 / TEST LEVELS

Place each test where it gives the clearest answer.

LevelBest suited toLimitations to remember
Static verificationStandards, data flow, control flow, interfaces, complexity and defect patterns.Cannot demonstrate dynamic timing or physical behaviour.
Host unit testAlgorithms, state machines, conversions, boundary values and error logic.Compiler, word size, concurrency and hardware behaviour may differ.
Target component testDrivers, memory layout, interrupts, peripherals and target-specific behaviour.Fixtures and instrumentation can alter timing or load.
Software integration testTasks, queues, components, protocols, start-up and recovery sequences.Simulated hardware models may omit physical faults.
Hardware-in-the-loopReal firmware with controlled sensor, load, network and fault stimuli.Model fidelity, calibration and fixture control need evidence.
System testEnd-to-end behaviour, physical performance, user interaction and safe response.Root cause is harder to isolate and edge cases may be expensive to reproduce.

Use many fast tests close to the code, but retain enough target and system testing to address compiler, processor, timing, electronics and physical behaviour. Trace each safety or security control to a method that can actually challenge it.

03 / AUTOMATION

Automation needs control of both product and test system.

  1. Identify the configuration. Record source revision, build options, toolchain, binary hash, board revision, calibration and fixture version.
  2. Control preconditions. Reset state, clear retained data where required, stabilise supplies and verify instruments.
  3. Stimulate through defined interfaces. Use public APIs and electrical interfaces; reserve internal hooks for justified diagnostic tests.
  4. Measure independently. Observe physical outputs, buses and timing rather than accepting the product’s own report alone.
  5. Apply objective oracles. Include tolerances, time windows, permitted intermediate states and unambiguous pass/fail rules.
  6. Preserve artefacts. Store logs, traces, waveforms, versions and failure context automatically.
  7. Detect test-system faults. Distinguish product failure, fixture failure, infrastructure failure and inconclusive execution.

Worked example: communication-loss safe response

A HIL rig must show that a controller removes drive within 250 ms after loss of valid host messages.

Load known buildEnter active stateCut message streamTimestamp final valid frameMeasure output energyConfirm fault record

The acceptance point is measured electrically, not from a firmware log that shares the same clock and logic as the function under test. The rig repeats the test around timeout boundaries and under maximum background load, then retains bus capture, output waveform and product configuration with the result.

04 / DEBUGGING

Preserve the symptom before changing the system.

Reproducible observation

Exact configuration, preconditions, stimulus, timing, symptom and occurrence rate.

Time-correlated evidence

Software events, bus traffic, electrical signals and physical outputs on a common timeline.

Competing hypotheses

Predicted evidence for plausible causes and one controlled experiment at a time.

Root-cause record

Trigger, underlying defect, propagation path and explanation of all material observations.

Correction verification

A test that fails before the fix, passes after it and covers neighbouring conditions.

Regression placement

The fastest trustworthy automated level that will prevent recurrence.

Common failure patterns

Test through the debugger

Single-stepping, halted peripherals or altered optimisation removes the timing-dependent fault.

Pass by product log

The same defective software both performs the function and declares that it succeeded.

Flaky test tolerance

Intermittent automation failures are retried away until genuine timing defects are normalised.

Coverage as confidence

Executed lines are counted without showing that requirements, boundaries and failure modes were challenged.

05 / REFERENCES

Further learning

KEY TAKEAWAY

Trust evidence that is controlled, independent and repeatable.

Strong embedded verification combines the right test level, known configurations, objective observations and automation that preserves rather than obscures diagnostic evidence.