Back to the glossary

Embedded and systems

Test environment

The test environment comprises everything besides the device under test that a test needs: hardware, software, network, tools, configuration and test data.

Also known as: test infrastructure, staging environment

What it includes

  • Hardware: computers, test benches, measurement equipment, power supplies
  • Software: operating system, runtimes, databases, dependent services
  • Tools: test framework, drivers, simulations
  • Configuration: settings, certificates, feature flags
  • Test data: defined starting data for reproducible results

Reproducibility is everything

A test that passes on a developer’s laptop and fails in the pipeline costs time and trust. The most common cause is a difference in environment. What helps:

  • Describe environments as code, for example with containers or configuration files
  • Pin versions of tools and dependencies
  • Set up test data fresh before each run instead of reusing it
  • Record the state of the environment in the test report

Several stages

Many teams have a chain of environments: local on the developer’s machine, in CI, a production-like staging environment and, for hardware, the lab test bench. The closer to production, the more meaningful the results, but also the scarcer and more expensive the environment.