Key takeaways
- An environment is a complete running copy of the system: application, database, configuration and connections to other services. Teams usually have development, test (QA), staging and production.
- Many "can't reproduce" bugs are really environment differences: a different version, configuration, data set or third-party service.
- Always know which environment and which build you're testing, and put both in every bug report. Never test with real customer data or real payments unless that's explicitly the plan.
What an environment is
An application isn't just code. To run, it needs servers, a database with data, configuration (settings, keys, feature flags) and connections to other services like payments, email or maps.
One complete set of all of these is an environment. Teams keep several, so they can build and test without risking what real users see.
The usual environments
| Environment | Also called | Purpose | Who uses it |
|---|---|---|---|
| Local / development | dev, local | A developer's own machine or a shared dev server; changes constantly | Developers |
| Test | QA, integration, SIT | Where testers test new features; updated often | Testers, developers |
| Staging | pre-production, pre-prod, UAT | A close copy of production for final checks before release | Testers, product owners, sometimes clients |
| Production | prod, live | The real system with real users and real data | Everyone; testers usually with care |
Names vary between companies. In your first week, ask for a list: name, URL, what's deployed there, and who can change it.
How code moves through them
- A developer builds and tests a change locally.
- The change is merged and automatically deployed to the test environment, often by a CI/CD pipeline.
- Testers test it there; bugs are fixed and redeployed.
- A release candidate goes to staging for regression testing and final checks.
- The same build is deployed to production, followed by a quick smoke test.
The key idea: the same build should move through the environments. If something is rebuilt or reconfigured along the way, what you tested isn't exactly what users get.
Why a bug appears in one environment and not another
| Difference | Example |
|---|---|
| Version | Test has build 4.2.1 with the fix; staging still has 4.2.0. |
| Configuration | A feature flag is on in test and off in production. |
| Data | Test has 50 products; production has 80,000, and search times out. |
| Third-party services | Test uses a payment sandbox that always approves; production rejects some cards. |
| Scale and infrastructure | Test runs on one server; production runs on twenty behind a load balancer. |
| Browser or device | "Works on my machine" is often a different browser version or a cached file. |
Checking what you're testing
- Find the build number. Many apps show it in the footer, an "About" page, or an endpoint like
/versionor/health. Ask developers where. - Confirm the fix is deployed before retesting a bug. Retesting the old build wastes time and leads to false "still broken" reports.
- Write it in every bug report: "Staging, build 4.2.1, Chrome 130, test account ana.qa+1@example.com."
Rules for testing safely
- Test data stays in test environments. Use test accounts, fake card numbers from the payment provider's sandbox, and made-up personal data. See SQL and test data for testers.
- Be careful in production. Some checks after a release are normal, such as smoke tests and monitoring. But creating orders, sending emails or changing data in production must be agreed and planned.
- Don't change shared environments without telling others. Resetting the test database in the middle of someone else's test run is a classic way to make enemies.
On 1 August 2012, Knight Capital, one of the largest US stock trading firms, deployed new trading software. According to the SEC's later order, the new code was installed on seven of its eight servers. Nobody noticed the eighth was missed, and no second person reviewed the deployment.
The eighth server still contained old, unused code. The new release reused a setting that had once switched that old code on. When markets opened, the eighth server ran it, and sent a flood of unintended orders.
In about 45 minutes, Knight's system sent more than 4 million orders while trying to fill just 212 customer orders. The firm lost more than $460 million and was later fined by the SEC.
Lesson: "deployed to production" must mean every part of production runs the same, verified version. Checking environment consistency is testing too, and so is a smoke test after every deployment.
Do
"Reproduced on staging, build 4.2.1 (from /version), Chrome 130, account qa.buyer3. Not reproducible on test (build 4.2.2), which may already contain the fix."
Don't
"Doesn't work on the server." Which server? Which build? The developer has to ask, and you have to answer, before anyone starts fixing it.
Check yourself
A bug is marked 'Fixed'. You retest on the test environment, and it's still there. Before you reopen it, what should you check?
Show answer
Check that the fix is actually deployed to the environment you're using: compare the build or version number with the one the developer says contains the fix. Also check caching (hard-reload, or try a private window), and that you're using the same data and account as the original report. If the right build is deployed and the bug is still there, reopen it with the build number and evidence.
