Topic 09

Environments and Builds

Context

"It works on my machine" is a running joke in software for a reason: the same app genuinely behaves differently depending on where it runs. Teams deal with this by keeping several complete copies of their product alive at once — and knowing which copy you're testing, and which version of the code is on it, is a daily, practical QA concern. Miss it, and you'll report bugs that don't exist and miss ones that do.

What an Environment Is

An environment is a complete, running copy of the product: the code, plus the data it works on, plus the settings that tell it how to behave, plus its connections to outside services. Same code in two environments can still mean different data, different settings, different connections — and therefore different behavior. That's not a flaw; it's the design. Each copy exists so that a different kind of work can happen safely.

Think of a theater. The same play exists in the rehearsal room and on opening night — same script, same actors. But the rehearsal room has work lights, taped-out props, and an audience of one director, while opening night has the real set, the real orchestra, and a thousand paying guests. You'd never rehearse a risky new scene for the first time in front of the paying crowd. Software teams feel exactly the same way.

The Classic Ladder

Most teams keep three rungs. Development (everyone says dev) is each developer's own workspace — messy, changing minute to minute, where Omar tries things. Staging (also called test or QA environment) is the team's shared rehearsal copy — built to resemble production as closely as practical, filled with fake data, and it's where most of your testing happens. Production (prod) is the real thing: real travelers, real bookings, real money. The word alone should raise your pulse slightly — anything you do in production happens to real customers.

The environment ladder — three copies, three purposes
Dev — the workshop
a developer's own copy · messy on purpose · breaks in private
Staging — the rehearsal stage
shared · production-like · fake data · where you test
Production — opening night
real users · real money · handle with respect

Builds, Versions, and Deployment

Now the moving parts. A build is a packaged, runnable version of the code at one moment in time — think of it as a numbered snapshot: build 4.2.18 is a specific bundle that either contains Omar's Tuesday fix or doesn't. Deploying means installing a build into an environment. So the everyday sentence "the fix was deployed to staging in build 4.2.18" decodes as: this exact snapshot, containing the fix, is now running on the rehearsal copy.

Why testers care intensely: your test results are only meaningful relative to a build. Testing "the app" means nothing; testing "build 4.2.18 on staging" means everything. If you verify a fix on the wrong build — one from before the fix landed — you'll report the bug as still broken, the developer will insist it's fixed, and you'll both be right about different snapshots. Every experienced tester has lived that argument exactly once.

Why Environments Differ — and Why It Bites

Staging is built to resemble production, but the resemblance is never perfect. The data differs: staging has fake travelers and a handful of test properties; production has millions of real records with all the weirdness real life accumulates. The settings differ: features can be switched on in staging that are off in prod. And the outside connections differ — this one produces the most confusion, so here's the concrete version.

Fernway's payments run through Paylane. Real charges would be unacceptable in testing, so staging talks to Paylane's sandbox — a pretend version of the payment service that Paylane provides exactly for rehearsals: it accepts test cards and moves no real money. One Thursday, every payment on staging starts failing. Is checkout broken? You mention it to Omar; he checks — Paylane's sandbox itself is down for maintenance. Production, which talks to the real Paylane, is fine. Same Fernway code, different environment, different behavior — and the bug you almost reported wasn't a bug at all. The general lesson: "works on staging, breaks in prod" (and the reverse) is usually an environment difference, not a mystery, and the first debugging question is always "what's different between the two copies?"

The Two Questions That Start Every Investigation

All of this compresses into a habit you'll use daily from now on. Before investigating anything — a bug you found, a bug someone reported, a fix you're verifying — establish two facts first: which environment, and which build. A bug seen on staging build 4.2.18 might be already fixed in 4.2.19, absent in production, or caused by staging's sandbox connections. Until those two answers are pinned down, you don't yet know what you're looking at. Chapter 6 will bake both questions permanently into your bug report template; consider this their formal introduction.

Common Confusions
  • "Staging and production are identical." Close is the goal; identical is practically impossible — data, settings, and third-party connections always differ somewhat. Those differences are a standing source of both false alarms and real escapes.
  • "A build and a release are the same thing." A build is a numbered snapshot of the code; a release is the decision to put one in front of users. Many builds are made; few are released. Chapter 7 covers who makes that call and how.
  • "If it fails on staging, checkout is broken." Maybe — or staging's sandbox connection is down, or the test data expired, or the build is stale. Environment-caused failures are why "blocked" exists as a test status, as Chapter 7 will show.
  • "Testing in production is forbidden." It's a real, modern, deliberate practice — with guardrails like releasing to 1% of users first. Chapter 11 gives it a proper treatment; the rule for now is simpler: nothing careless happens in prod.
Why It Matters
  • "Which environment? Which build?" are the first two questions of every bug investigation — and the first two fields of every decent bug report. This page is where that reflex comes from.
  • Understanding environment differences saves you from the classic junior embarrassments: reporting a sandbox outage as a product bug, or verifying a fix on a build that doesn't contain it.
  • Environment vocabulary — dev, staging, prod, build, deploy, sandbox — is assumed in every standup you'll ever attend. This is the page where it stops being noise.

Knowledge Check

What is an environment?

  • A complete running copy of the product: code, data, settings, and connections
  • A numbered snapshot of the code at one moment in time
  • The physical computer a developer works on
  • A pretend version of a third-party service used for testing

Every payment on staging suddenly fails, while production is fine. What should you check before reporting a checkout bug?

  • Run the same payment test several more times on staging
  • Whether an environment difference — like Paylane's sandbox being down — explains it
  • File the bug immediately, since payments are high severity
  • Try the same payment on production to compare

Why do test results only have meaning relative to a specific build?

  • Because testers are only authorized to test certain builds
  • Because each build is a different snapshot — a fix exists in one and not another
  • Because builds expire after a few days and results become invalid
  • Because results from staging never apply to any other environment

What is Paylane's sandbox?

  • Fernway's shared rehearsal environment
  • A version of Paylane that processes real charges at a discount
  • A pretend version of the payment service, provided by Paylane for testing
  • A backup copy of Paylane's production servers

You got correct