Glossary · Automation software engineering and architecture
Component test
Also known as: Module test
German: Komponententest
In software engineering, a component test is a test of an individual software component or module in isolation from the rest of the system, checking that it behaves according to its specification, with other components replaced by stubs, mocks or simulations where needed.
- Software engineering
In one sentence
A component test checks a single software component in isolation against its specification, with dependencies replaced by stubs or mocks.
Example
The component test of a valve function block simulates missing end-position feedback and checks that the block raises a fault after the configured timeout.
How it applies
- Engineering: Component tests are the fastest and cheapest way to find defects in logic. For PLC code, frameworks exist that run tests on a virtual or real controller with simulated inputs.
- Quality: Component tests should cover normal behavior, boundary values and error cases, and run automatically in Continuous integration (CI). Their results, together with Code coverage, are part of verification evidence.
- Documentation: A test specification derived from the component's interface documentation keeps the two consistent. Where tests reveal behavior that users rely on, such as timeouts or default values, the documentation team should check that it is described in the library documentation.
Component test vs. integration test
A component test isolates one component. An Integration test checks how several components work together, including their interfaces and timing. Terminology varies: some teams use 'unit test' for the smallest units and 'component test' for larger building blocks. Define the levels used in the project's test strategy.