When every fix breaks another part, the problem is coupling without tests: parts of the system depend on each other in undocumented ways. The way out is writing tests for current behavior in critical areas, separating responsibilities gradually and releasing with a rollback path.
A simple change to the shipping calculation. Released on Friday. On Monday, the commissions report is wrong and invoicing fails for one type of customer. Nobody touched those parts, but they broke. If that’s routine, your system has become fragile.
Why it happens
- Duplicated code. The same rule is copied in several places, and only one copy was changed.
- Everything depends on everything. A function used by twenty screens changes and affects them all.
- No automated tests. The only way to know something broke is a user complaining.
- The database as integration. Several parts read and write the same tables, each in its own way.
How to make the system safe to change
- Characterization tests. Before changing anything, we record what the system does today in critical areas: calculations, invoicing, finance. These tests warn when something changes unintentionally.
- Release pipeline. Every change passes the tests before reaching production.
- Gradual refactoring. Duplicated rules become one; tightly coupled parts are separated over time.
- Releases with a rollback path. If something goes wrong, reverting takes minutes.
Does this mean a rewrite?
No. In most cases the system becomes stable with tests and targeted refactoring. When a module is too tangled to be worth it, it gets replaced, but one at a time. See rewrite or modernize.
Frequently asked questions
Can you add tests to an old system?
Yes. We start with tests for current behavior in the most critical areas, without changing the code first.
Does this slow down day-to-day fixes?
A little at first. Then it speeds things up, because every change becomes safe and rework stops.
How long until the system is stable?
Critical areas are usually protected within the first weeks. The rest follows in stages.
Afraid to touch your system?
We add tests to the critical areas and a release pipeline with rollback, so every change is safe.
Step-by-step modernization: fixed-price assessment