Refactoring 40,000 lines of inherited code
The only developer had left and no documentation remained. We reconstructed a map of the system and made changes safe to ship.
- Client
- B2B SaaS, 7-year-old product
- Industry
- Business software
- Year
- 2026
- Duration
- 3 weeks
The product made money, but every change broke something elsewhere. The team was afraid to ship and did so once every two months.
What we did
and why we did it that way.
A map of the system
We went through the repository and the commit history and turned it into a dependency diagram and a list of risk areas.
A safety net
We wrote characterisation tests against the current behaviour—including two “bugs” that customers had come to rely on.
Dependency updates
We closed 23 known vulnerabilities in libraries that had not been updated for four years.
CI and releases
We stood up a pipeline with tests. A release stopped being an event and became a 12-minute operation.
What changed
and what we measured it with.
How it went
day by day and week by week.
- Week 1
Reconnaissance
Map of the system, risk areas, migration plan.
- Week 2
Tests
Characterisation tests for the critical scenarios.
- Week 3
CI and handover
Pipeline, dependency updates, a walkthrough with the team.
How it looks
in schematics.
These are screen schematics. We do not publish client interfaces without permission
A similar problem
on your side?
Describe it in the brief. In working hours we come back with an estimate of time and cost within two hours.