Test Levels
Classification of test types by purpose and scope (unit, integration, system, acceptance) to structure test strategies and responsibilities.
Classification
- ComplexityMedium
- Impact areaTechnical
- Decision typeDesign
- Organizational maturityIntermediate
Technical context
Principles & goals
Use cases & scenarios
Compromises
- Overfocusing one level while neglecting others
- Insufficient test data and environment specifications
- Increased CI times due to lack of parallelization
- Keep tests fast and deterministic at unit level
- Isolate integration and E2E tests in dedicated environments
- Use test data management and mocking for stability
I/O & resources
- Requirements and acceptance criteria
- Test environments and test data
- CI/CD integration and test frameworks
- Test reports and failure feedback
- Regression protection via automated suites
- Release criteria based on test results
Description
Test Levels describes the hierarchy of tests (unit, integration, system, acceptance) for systematic software quality assurance. It defines purpose, scope and responsibilities at each level and guides test strategy, automation effort and fault localization. It also supports prioritization and allocation of testing resources.
✔Benefits
- Improved fault localization through clear responsibility boundaries
- More efficient testing strategy and resource usage
- Scalable automation paths per level
✖Limitations
- Overspecifying levels can increase effort
- Flaky tests at integration or E2E level are hard to debug
- Not all faults are visible at unit level
Trade-offs
Metrics
- Average test runtime
Average duration of full test runs in the CI pipeline.
- Fault localization time
Time from fault occurrence to identification of the affected component.
- Test coverage ratio
Proportion of source code covered by automated tests.
Examples & implementations
Unit testing in Microservice A
A set of fast unit tests to secure service logic and DTO transformations.
Integration tests for payment processing
Runs against simulated payment gateways to validate end-to-end integrations.
Acceptance test for web checkout
Business-driven scenarios validate checkout flows with realistic test data.
Implementation steps
Analyze existing test coverage and identify gaps
Define goals per test level (e.g. runtime, coverage)
Automate prioritized tests and integrate into CI
Monitor test metrics and continuously improve
⚠️ Technical debt & bottlenecks
Technical debt
- Slow, non-parallel test pipelines
- Missing or unreliable test data knowledge
- High legacy test maintenance burden
Known bottlenecks
Misuse examples
- E2E tests for UI details that change frequently
- Using mocks at incorrect integration boundaries
- Using unit tests as a substitute for integration validation
Typical traps
- Unclear responsibilities for test types
- Neglecting maintenance of outdated tests
- Overcomplicated test data preparation
Required skills
Architectural drivers
Constraints
- • Limited CI resources
- • Legacy code without tests
- • Restricted access to external integrations during tests