← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Test Environment Parity

Testing Intermediate
debt(d7/e7/b7/t5)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). The detection_hints note automated=no and the tools listed (docker, github-actions, docker-compose) are infrastructure tools, not static analysers that flag mismatches. Version divergence between dev and production is only visible when you explicitly compare configurations or when a bug surfaces at runtime — there is no linter or compiler that catches 'PHP 8.1 in dev vs 8.3 in prod'.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix says 'run your test suite inside the same Docker image used for production', but achieving this in practice requires committing docker-compose files, aligning all developer machines, updating CI pipelines, and keeping versions in sync going forward. The common_mistakes list covers multiple independent environment dimensions (PHP version, MySQL strict mode, timezone, extension config) each requiring its own remediation across dev, CI, and production — this is a cross-cutting infrastructure change, not a single-file fix.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b7, leaning toward strong gravitational pull). applies_to covers both web and cli contexts, meaning every developer, every CI run, and every deployment pipeline is shaped by whether parity is maintained. An uncommitted or inconsistent docker-compose.yml means every new developer inherits drift, every PR risks environment-specific failures, and every future infrastructure decision must account for parity. The choice gravitationally pulls on all work streams.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap' (t5). The misconception field explicitly states that developers believe staging parity is sufficient, when in fact the highest-value parity is dev-to-production. This is a documented, widely-encountered gotcha (12-factor Factor VI) that most developers eventually learn the hard way, but it does not fully contradict a similar concept elsewhere — it is more of a prioritisation mistake than a contradictory behaviour.

About DEBT scoring →

Also Known As

dev prod parity environment consistency Docker dev environment 12-factor Factor VI

TL;DR

Dev, staging, and production must use identical PHP versions, MySQL versions, and OS configurations — divergence causes bugs that only appear in production.

Explanation

Environment parity (12-Factor App Factor VI): dev, CI, staging, and production use identical PHP version, extensions, database version and configuration, OS, timezone, and locale. Docker Compose committed to the repository ensures all developers use the same stack. PHP version matrix in CI tests against all supported versions. Common divergences that cause bugs: PHP 7.4 vs 8.3 behaviour differences, MySQL strict mode enabled in production but not dev, different timezone configurations.

Common Misconception

Staging environment parity is sufficient — the highest-value parity is between development and production; developer environment divergence from production causes the most bugs and is the most common source of 'works on my machine'.

Why It Matters

A bug that only appears in production because the developer runs PHP 8.1 while production runs 8.3 costs far more to find and fix than the effort of running identical versions in Docker Compose.

Common Mistakes

  • System PHP on developer machines diverging from production version
  • No committed docker-compose.yml — each developer's environment drifts over time
  • Different MySQL strict mode between environments — queries accepted in dev rejected in production
  • Wrong timezone in dev or CI — date calculation bugs that only appear in certain timezones

Code Examples

✗ Vulnerable
# Divergent environments — bugs appear only in production:
# Developer: PHP 8.1 (system PHP), MySQL 5.7, UTC timezone
# CI: PHP 8.2 (GitHub Actions default), MySQL 8.0, UTC
# Production: PHP 8.3, MySQL 8.0, Europe/London timezone
# Bug: MySQL 8.0 strict mode rejects query that 5.7 accepts
# Discovered: production deployment — emergency hotfix
✓ Fixed
# docker-compose.yml committed — identical for all developers:
services:
  php:
    image: php:8.3-fpm-alpine  # Same as production
    environment:
      APP_TIMEZONE: Europe/London  # Match production
  mysql:
    image: mysql:8.0  # Same version as production
    environment:
      MYSQL_STRICT_MODE: '1'  # Match production strict mode

# CI also uses mysql:8.0 and PHP 8.3 — identical stack

Added 16 Mar 2026
Edited 22 Mar 2026
Views 45
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 1 ping M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S 2 pings S 0 pings M 0 pings T 1 ping W 1 ping T 2 pings F 0 pings S 0 pings S 1 ping M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 2 pings S 0 pings M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Amazonbot 9 Perplexity 4 Ahrefs 4 Scrapy 4 Google 3 SEMrush 3 Unknown AI 2 ChatGPT 2 PetalBot 2 Claude 1 Meta AI 1
crawler 33 crawler_json 2
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: Medium
⚡ Quick Fix
Run your test suite inside the same Docker image used for production — differences between test and production environments are the #1 cause of 'works on my machine' bugs
📦 Applies To
any web cli
🔗 Prerequisites
🔍 Detection Hints
Tests running on PHP 8.1 while production is 8.3; MySQL version differences between dev and prod; different extension configurations
Auto-detectable: ✗ No docker github-actions docker-compose
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Medium ✗ Manual fix Fix: High Context: File Tests: Update


✓ schema.org compliant