Definition
A system test is a test that runs the complete system in a stated configuration and environment, and checks its externally visible behavior against the system’s requirements. For a device, the system is the hardware, the exact build of its software, the other devices it communicates with, the workload it serves and the faults it meets. The test observes the system only through its external interfaces, as a user would. It follows integration testing §10.2, which checks components in groups, and precedes acceptance testing, in which the customer judges the system.
The idea
Components that pass their unit and integration tests can still fail together on the real device. Firmware, the program built into a device, often runs straight from flash memory §6.6, the memory that keeps its content without power. On many microcontrollers §6.1, small computers on one chip, the processor cannot fetch instructions from flash while a page of it, a block of often a few KiB, is being erased. The processor waits until the erase finishes, which can take tens of milliseconds or more. A storage component that erases a page and a radio component that must answer within a fixed time can each be correct, and their integration test on a host computer can pass, while the real device misses radio deadlines whenever an erase coincides with traffic. Only a test of the complete, configured system brings the real erase time, the real radio timing and the real workload together.
A system test is like a test drive: the whole car, on a chosen road, in chosen weather. It answers whether this car, configured this way, does what it must under these conditions. It does not answer whether the car copes with ice if the drive took place in summer. The picture stops at one point. A car looks the same in every drive, while two builds of the same firmware with different settings are two different systems. A system test result is therefore always about a declared configuration.
How it works
Fix and record the configuration. Hardware: board model and revision, chip, clock source, attached peripherals (devices such as sensors connected to the chip) and power source. Firmware: the exact source version, the build options, and the compiler with its version. Peers and environment: the other devices and their software versions, the distances and the radio environment.
Fix the starting state, for example a freshly erased device, or one whose storage is nearly full or already worn by many erases.
Define the workload: which operations, in which order, with which sizes, at which rate, and for how long.
Define the admitted faults and how they are produced: resets, power cuts, lost or corrupted packets, radio interference. Producing faults on purpose during a test is called fault injection §10.28.
Define the observations and the oracle: what is observed (replies, data read back after a restart, logs) and the rule that decides whether a run passed.
Run, repeat and record every run, including the failed and the aborted ones.
State the result for the recorded configuration only.
Setups that look alike test different systems:
a firmware build running on a simulated board on a host computer;
a real board whose radio partner is simulated, an instance of hardware-in-the-loop testing §10.36, in which real hardware runs against simulated surroundings;
a real board talking over the air to a real peer.
Only the last includes the real radio link. An end-to-end test drives one complete user-level operation from its start to its final effect. A system test is usually end-to-end, but a test whose path includes a simulated part is not end-to-end.
Worked example
A device receives a 12-byte configuration object over a wireless link in two writes of 6 bytes each (). The device checks the object, stores it in flash memory and switches to it. A first system test sends the object, waits for the device’s reply “accepted”, and passes when the reply arrives. The test runs 10 times on one board, within one power-on session, with the board powered from a laboratory supply. All 10 runs pass.
What this result covers:
Effects checked. The oracle saw a reply. It did not check that the stored bytes equal the 12 bytes sent, nor that the device uses the new configuration after a restart. A stronger oracle restarts the device after the reply, reads the active configuration and compares all 12 bytes with the bytes sent.
Faults admitted. The laboratory supply never drops, so the runs include no power cut and no brownout, a dip in the supply voltage. A power cut between the two 6-byte writes, or during the flash write, was never tested.
Independent observations. The 10 runs share one board, one boot and one state of the flash. They are 10 observations of one experimental unit §11.3, the thing about which a conclusion is drawn, not 10 devices.
Even if the 10 runs were independent trials with one fixed failure probability , 10 passes out of 10 would say little. A one-sided 95% upper confidence bound for is the value at which 10 passes in a row have probability 0.05: , so and . The test shows, at best, that the failure probability is below about 26%. The rule of three §18.5.8, which gives as the approximate bound after passes and no failures, gives a similar , that is, 30%.
Stated precisely
A system test result has the form: with hardware , firmware build , peers and environment , starting state , workload and admitted faults , the oracle accepted of runs.
The result supports a claim about a configuration that differs in any of , , , , or only through a separate argument that the difference cannot change the outcome, or through tests of that configuration. It supports only the properties that checks. The count supports a statistical statement only if the runs were arranged to be independent, for example by starting each from a fresh state, and a statement about devices in general needs several devices.
Limits and common mistakes
A broad test can have a weak oracle. A status light that blinks after boot shows that the firmware started. It does not show that the stored configuration is right, that it survives a restart or that a client can still connect, unless the requirement ties the light to exactly those conditions.
A system test covers one configuration. Another board revision, another compiler version or other build options make another system.
Workloads applied from outside seldom reach rare internal states, such as a full memory or a failure in the middle of a write. Fault injection and unit tests §10.1, which run one component alone with chosen inputs, reach those states directly.
A laboratory is kinder than the field: steady power, short distances, a quiet radio environment, fresh flash. A result carries over to the field only for the conditions the test included.
System tests are slow, and a failure is hard to locate, because any component may be at fault. Logs and the results of lower-level tests narrow it down.
A system test is not an acceptance test. The system test checks the written requirements. An acceptance test checks whether the system serves its users, which can fail even when every written requirement is met. The two checks are often called verification, asking whether the system was built right, and validation, asking whether the right system was built.
Questions answered
Which hardware, firmware, workload, and fault conditions define the tested system?
The tested system is defined by a written record of everything that ran and everything it was exposed to, and a result applies only to that record. The record states:
hardware: board model and revision, chip, clock source, power source and attached peripherals, and which of these were real and which simulated;
firmware: the exact source version, the build options, the compiler and its version, and the stored state at the start, such as freshly erased or nearly full flash;
peers and environment: the other devices and their software, the distances and the radio conditions;
workload: the operations, their order, sizes and rate, and the duration of the run;
fault conditions: which faults were injected, such as resets, power cuts at stated points, lost or corrupted packets and interference, and also which faults were excluded, such as power loss when the device ran from a laboratory supply.
The record also states the oracle, meaning which effects were actually checked: a reply, the stored bytes, or the state after a restart. A claim about any other hardware, firmware, workload or fault condition needs a test of that condition, or an argument that the difference cannot change the outcome.
Related entries: Integration test (§10.2), Test oracle (§10.5), Hardware-in-the-loop testing (§10.36), Experimental unit (§11.3), Fault injection (§10.28).