Case study 08
Testing & Quality Assurance

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
- Read-only analysis first.
- Verified backup:
pg_dump -Fcplus a filestore archive and SHA-256 checksums, and a restore test. - 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. - 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. - Upgrade, then post-checks. Read-only SQL plus ORM-level verification, with a rollback plan.
Testing toolkit
TransactionCaseunit tests,HttpCasecontroller 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
| Suite | Result |
|---|---|
| Field sales & custody stock | 217 / 217 |
| HR policy engine | 166 → 179 tests across rehearsals |
| Multi-tenant platform | 79 / 79 |
| Tenant-isolation attack harness | 27 / 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.