Legacy Modernization with GenAI: Field Notes
In the enterprise world, "modernization" promises a lot and says very little. Let me make it concrete: there are applications past their tenth birthday, whose documentation retired together with the teams that wrote it, and which still make money. The question: does GenAI actually help here?
I've tried it on more than one enterprise project in the field. My answer: yes — but not where you expect.
Where it genuinely helps
1. Code archaeology. The first weeks of legacy modernization are spent reading code. LLMs are extraordinary here: ask "what does this 800-line stored procedure do?" and you get a human-level summary in half an hour. Is it sometimes wrong? Yes. But even a flawed summary is a starting point that saves weeks compared to reading from scratch.
2. Characterization tests. The golden rule of modernization: record the behavior before you change the behavior. Having GenAI draft the test harnesses that capture what the code actually does turns the most boring, most critical part of the project from weeks into days.
3. Mechanical transformation. Framework upgrades, API signature changes, translating language idioms — when the rule is clear, the model is fast and consistent. Across thousands of repetitive file changes it drops below the human error rate.
Where it fails
1. Implicit business rules. That odd if block was a customer's special request from 2014, and the only person who knew it has left the company. The model cannot know context that isn't visible in the code — only institutional memory can surface it. Give GenAI the authority to say "this rule looks redundant, deleting it," and you'll pay the invoice in production.
2. System boundaries. "Convert this module to a microservice" produces beautiful code — but a microservice cut along the wrong boundary is a more expensive problem than the monolith was. Drawing domain boundaries is still the architect's job; the model fills in whatever boundary you draw.
3. Unmeasured optimism. Model-generated code looks like it works. Without characterization tests, "it works" is the most expensive sentence in modernization.
The discipline that makes the difference
On the projects that succeeded, the pattern was always the same:
- Inventory first — what exists, what's used, what's dead.
- Tests before touches — not a single line changes before behavior is recorded.
- AI proposes, the pipeline verifies — every AI output goes through review and CI as if a human wrote it. No exceptions.
- Small slices — strangler pattern; no big bang.
Notice there is nothing AI-specific in that list. That's the secret: GenAI accelerates a disciplined modernization process; an undisciplined one it merely crashes faster.
Closing
GenAI is not the hero of modernization; it's an excellent lever. Put solid ground under the lever — tests, boundaries, review — and you gain weeks. Skip it, and you trade old technical debt for new debt, produced at higher speed.
I'll keep writing about what works in the field. Let the work speak.