AI Analysis
Using AI to Understand Legacy Platforms
Where AI-assisted analysis helps when modernising older systems, and where senior engineering judgement still matters.
Legacy platforms are rarely difficult because the code is old. They are difficult because the organisation no longer has a clear, shared understanding of how the system works.
The most important business rules may live in stored procedures, batch jobs, old framework conventions, integration glue, or code written by people who have moved on. Documentation is often incomplete. Tests may exist in some areas and be absent in others. The system still runs the business, but changing it safely has become slow and uncertain.
AI-assisted analysis can help with this discovery problem. It can shorten the time required to map a codebase, summarise unfamiliar modules, trace dependencies, and identify repeated patterns. Used well, it gives teams a faster path from "nobody understands this" to "we know enough to make the next decision."
Used poorly, it can create polished summaries that hide uncertainty. Legacy modernisation still needs experienced engineering judgement.
Start With Understanding, Not Rewriting
The first mistake in many legacy programmes is treating the replacement as the goal. The real goal is usually more specific: reduce operational risk, improve delivery speed, unblock product change, lower dependency exposure, or make the system easier to support.
AI should be used first to understand the current platform, not to generate replacement code.
A useful investigation looks for:
- The main domains and business workflows in the system.
- The code paths that change most often.
- The data structures and integrations that constrain change.
- The modules with high complexity, weak tests, or unclear ownership.
- The operational dependencies that are not obvious from the application code alone.
This helps teams decide where modernisation will create value and where the existing system should simply be stabilised.
Where AI Helps
AI is useful when the discovery task is broad, repetitive, and context-heavy. Legacy platforms often contain thousands of files, inconsistent naming, old abstractions, and historical design choices that are hard to decode manually.
AI-assisted tooling can help by:
- Summarising modules and explaining likely responsibilities.
- Grouping related files into business capabilities.
- Tracing call paths across controllers, services, data access layers, jobs, and scripts.
- Identifying repeated implementation patterns or duplicated logic.
- Highlighting framework conventions that are no longer familiar to the current team.
- Producing first-pass documentation for review by engineers and domain experts.
This does not remove the need for human review. It changes where the human effort goes. Instead of spending days just finding the right files, engineers can spend more time validating behaviour, checking assumptions, and deciding what should happen next.
The Behaviour Matters More Than the Syntax
Legacy systems often encode business behaviour in surprising places. A generated summary of a class or function may be helpful, but it is not enough.
The more valuable question is: what behaviour does this system protect?
For example, a claims platform, billing system, booking engine, or logistics workflow may include years of edge cases that are not written down anywhere else. The code is not just implementation detail. It may be the most complete record of the business rules.
AI can help expose those rules, but the output should be treated as a hypothesis. Important behaviour still needs to be checked against production data, logs, tests, domain experts, and observed system usage.
Use AI to Build a Map
The best early output from AI-assisted legacy analysis is a map of the platform.
That map should show the main application boundaries, core workflows, integration points, data stores, scheduled jobs, security boundaries, and areas where change is risky. It should also make uncertainty visible. A useful map says "this is known", "this is inferred", and "this needs validation."
This kind of map supports better decisions:
- Which parts of the system should be left alone?
- Which parts need tests before any change is attempted?
- Which workflows are good candidates for incremental extraction?
- Which dependencies need replacement before larger modernisation can happen?
- Which areas require domain expert review?
Without a map, teams often choose modernisation targets based on frustration rather than evidence.
Be Careful With Generated Code
AI can generate code quickly. That is not the same as preserving behaviour.
In legacy modernisation, the risk is not usually that new code cannot be written. The risk is that new code misses an old edge case, changes a financial calculation, breaks an integration contract, or removes behaviour that nobody remembered was important.
Before generated code is used in a modernisation path, teams need controls such as:
- Characterisation tests around existing behaviour.
- Golden data sets for critical workflows.
- Integration tests for external system contracts.
- Human review by engineers who understand the target architecture.
- Incremental rollout paths with observability and rollback options.
AI-generated code can be useful, but it should sit inside a disciplined engineering process.
Modernisation Is a Sequencing Problem
AI can help identify candidates for refactoring or extraction, but it cannot decide the business sequence by itself.
The best modernisation path depends on product priorities, operational risk, team capacity, compliance requirements, customer impact, and commercial timing. A technically messy component may not be the right first target if it rarely changes and has low operational exposure. A smaller integration may matter more if it blocks every release.
This is where senior judgement matters. The output of AI analysis should feed a roadmap, not replace one.
A practical sequence usually distinguishes:
- Immediate risk reduction.
- Test coverage and observability improvements.
- Incremental extraction of high-change workflows.
- Dependency upgrades or replacements.
- Longer-term architecture changes.
The goal is to make each step reduce risk or increase optionality.
What Good Looks Like
A good AI-assisted legacy investigation should leave the organisation with a clearer view of the system than it had before.
It should produce:
- A readable map of the platform and its dependencies.
- Summaries of the main business workflows.
- A view of complexity, coupling, and change hotspots.
- A list of assumptions that need human validation.
- A practical sequence for stabilisation, refactoring, or incremental replacement.
The most useful outcome is not a claim that AI understands the platform. It is a better shared understanding among the people responsible for changing it.
Legacy systems are not modernised by summaries alone. They are modernised by turning uncertainty into evidence, evidence into decisions, and decisions into carefully sequenced change.
Back to blog posts