Case study 08

Testing & Quality Assurance

Production (HR module upgrade) + suites on staging/test databases
Testing & Quality Assurance — case study visual

The challenge

Upgrades to HR, payroll, stock and accounting modules on live databases, where one bad migration costs money and trust.

My approach: make the safe path the default

  1. Read-only analysis first.
  2. Verified backup: pg_dump -Fc plus a filestore archive and SHA-256 checksums, and a restore test.
  3. Rehearsal on a restored copy. The copy is hidden from the application (IS_TEMPLATE), its crons and outgoing services are neutralised, and its identifiers are regenerated.
  4. Explicit approval per phase. The scripts refuse to run on production without --approved, refuse to run while sessions are active, and refuse to run against the wrong database.
  5. Upgrade, then post-checks. Read-only SQL plus ORM-level verification, with a rollback plan.

Testing toolkit

  • TransactionCase unit tests, HttpCase controller tests and browser tours (including Arabic POS tours).
  • A security attack harness that runs against both the original and the fixed code.
  • A concurrency harness on throwaway databases.
  • Arabic RTL PDF checks of rendered reports.
  • Rehearsal scripts that time the upgrade and count ERROR/Traceback lines.

Verified results

SuiteResult
Field sales & custody stock217 / 217
HR policy engine166 → 179 tests across rehearsals
Multi-tenant platform79 / 79
Tenant-isolation attack harness27 / 27 (18 failures on original code)
ERP AI assistant (prototype)59 / 59 incl. browser tour
Transport ERP (11 modules)55 tests
  • Production: the HR module was upgraded after an identical rehearsal (40 tables compared, 0 errors).
  • Production: a multi-company merge was completed after two rehearsal rounds and a rollback test.

← Troubleshooting & Performance Engineering