Test environment

A test environment is a deployment of a system set aside for testing, separate from the one real users reach. It has its own data, its own configuration and often its own version of the software, so that a test can put the system into states nobody would want a customer to encounter.

The longer version

Most teams run several, arranged as a chain that the same build moves along. Development is local and resembles nothing in particular. A shared test or QA environment is where a build goes to be exercised, and it is unstable on purpose, because it holds whatever is being worked on. Staging is the rehearsal and is meant to be indistinguishable from production apart from its data. Production serves real users.

Each step along that chain trades freedom for realism. The early environments can be reset, seeded with impossible data and broken without consequence, which is what makes destructive testing possible at all. The later ones cannot, and their value comes from resembling the real system closely enough that a pass predicts behaviour there.

What makes an environment useful is that its differences from production are known and deliberate. A test environment on a different database version, behind no CDN, with a fake payment provider is perfectly workable as long as the team knows those are the gaps. The same environment becomes dangerous when nobody can list them, because then a passing test is evidence about a system nobody has described.

Drift is the standing threat. Environments are configured once and then maintained by whoever last needed something from them, so a runtime falls a version behind, a feature flag stays on, a seeded account keeps permissions that production revoked. None of it is visible from a green test run, which is why teams that rely on these environments deploy to them through the same automated pipeline that deploys to production.

Common questions

What is the difference between a test environment and a staging environment?

A staging environment is one particular test environment: the last one before production, built to mirror it as closely as possible. Earlier test environments are deliberately less realistic and more disposable, so that they can be reset, seeded with unusual data and broken without anybody noticing.

How many environments does a team need?

As many as there are distinct jobs to do, which for most teams is three or four: local development, a shared environment where builds are exercised, a production-like rehearsal, and production itself. Adding more has a real cost, because every environment is another configuration that can silently drift.

Can a test environment use production data?

Copying real data into an environment with weaker access controls extends every privacy obligation to it, so the standard answer is anonymised or synthetic data. The accepted cost is that synthetic data does not contain the unusual records that cause the hardest bugs.

Bug reports that arrive ready to triage.

Collect replay, console, network and browser context with the Free plan.

<script src="…/widget.js" data-key="pb_pub_…">