Home / Insights / Architecture and Modernization
Architecture and Modernization
Using AI to Reverse-Engineer Legacy Applications: From Screens and Code to a Modernisation Plan
Many modernisation projects stall because nobody fully understands the old system. AI can read code, screens and data to produce documentation, business rules, tests and first drafts of new UI. This guide shows what works, what does not and how to verify the results.
TopicsArchitecture and ModernizationAI and Machine LearningWeb and SaaS Development
Key takeaways
- The hardest part of modernising legacy software is understanding what it does; AI can accelerate that understanding substantially.
- Useful applications include summarising code, mapping dependencies, extracting business rules, generating characterisation tests and drafting UI from screenshots.
- AI output is a hypothesis to verify, not documentation of record: confirm rules with domain experts and tests against the running system.
- Reverse engineering must respect ownership and licences; only analyse systems you own or are authorised to modify.
- Combine AI analysis with incremental modernisation patterns so the old system keeps working while the new one takes over.
On this page
Many organisations depend on applications built a decade or more ago. The original developers have left, documentation is missing or wrong, and business rules live only in code and in the heads of long-serving staff. Modernisation projects often stall at the first step: understanding what the system actually does.
AI tools can now read large codebases, interpret screens and summarise data structures. Used carefully, they shorten the discovery phase of modernisation dramatically. This guide covers practical uses and safeguards. Our guide to taking over a codebase covers the wider handover process.
Where AI helps
| Task | What AI does | Verification needed |
|---|---|---|
| — | — | — |
| Code summarisation | Explains modules, functions and data flows in plain language | Review by engineers; spot-check against behaviour |
| Dependency mapping | Identifies calls between modules, services and databases | Compare with runtime tracing |
| Business rule extraction | Finds conditions, calculations and validations embedded in code | Confirm with domain experts and test cases |
| Data model explanation | Describes tables, relationships and cryptic column names | Validate with sample data and owners |
| Characterisation tests | Generates tests that capture current behaviour | Run against the existing system; review edge cases |
| UI reconstruction | Drafts modern screens from screenshots or recordings | Design review; accessibility and usability checks |
| Code translation | Converts code from old languages or frameworks to new ones | Full testing; architecture review |
The pattern is consistent: AI drafts, people and tests confirm.
A practical process
- Authorise and secure: confirm you own the system or have rights to analyse and modify it; set up an isolated environment and approved AI tools.
- Inventory: repositories, databases, interfaces, scheduled jobs, configuration and users.
- Summarise: use AI to produce module-level summaries and a dependency map; engineers review and correct.
- Extract rules: focus on high-value areas such as pricing, eligibility and calculations; list each rule with the code location and confirm with domain experts.
- Capture behaviour: generate characterisation tests and record real transactions so the new system can be compared with the old.
- Design the target: use the recovered knowledge to define the new architecture, data model and UI.
- Modernise incrementally: replace parts behind stable interfaces while the old system continues to run, reconciling outputs.
Example: recovering pricing rules
A hypothetical distributor’s order system calculates prices through a 4,000-line stored procedure with special cases added over 15 years. An AI assistant reads the procedure and produces a list of 37 candidate rules — volume tiers, customer-specific overrides, regional surcharges, promotional exceptions — each linked to the lines of code.
Sales operations confirm 31 rules, correct four and identify two as obsolete. The team writes test cases for each confirmed rule using historical orders, then implements a new pricing service. For three months, both systems price every order and differences are investigated before switching over. AI cut the analysis from weeks to days; the verification steps made the result trustworthy.
Generating UI from screenshots and recordings
Screen-to-code tools can turn screenshots of an old application into modern UI drafts. Used well, they speed up the start of a redesign:
- Capture real usage: record key journeys with real users, not just static screens, to understand which fields and actions matter.
- Generate with your design system: constrain output to your components and tokens so drafts are consistent and maintainable.
- Redesign, do not copy: legacy screens often encode workarounds; use research to simplify flows rather than replicating every field.
- Check accessibility: generated layouts frequently miss labels, focus order and contrast requirements.
- Wire to real APIs: generated UI is only a shell until it is connected to services and tested.
Measuring progress in a modernisation
| Measure | What it shows |
|---|---|
| — | — |
| Share of modules documented and reviewed | Understanding of the old system |
| Business rules confirmed with experts | Confidence that behaviour is captured |
| Characterisation test coverage of critical flows | Safety net for change |
| Share of traffic or functions served by the new system | Progress of replacement |
| Reconciliation differences between old and new outputs | Correctness during parallel running |
Report these alongside delivery milestones so stakeholders see risk falling, not just features moving.
Limits and risks
- Hallucinated understanding: AI may describe code confidently but wrongly, especially with dynamic behaviour, configuration-driven logic or missing files.
- Context limits: very large codebases must be analysed in pieces; cross-cutting behaviour can be missed.
- Translation pitfalls: line-by-line code translation preserves old design problems and introduces subtle bugs.
- Security and confidentiality: source code, data and screenshots may contain secrets or personal data; use approved tools and redact sensitive data.
- Intellectual property: reverse engineering third-party software may breach licences or law. Limit analysis to systems you own or are licensed to modify.
Tools and approaches
Teams combine general-purpose AI coding assistants for summarisation and code questions, static analysis tools for reliable dependency and call graphs, runtime tracing to see real behaviour, and screenshot-to-UI generators for drafting new interfaces. Deterministic tools provide facts; AI turns them into explanations and drafts.
Frequently asked questions
Can AI automatically convert our legacy system to a modern stack?
It can translate code and draft components, but a working, maintainable system still needs architecture decisions, testing and engineering. Treat automated translation as a starting point at most.
How accurate are AI-generated explanations of code?
Often useful but not reliable enough to accept without review. Verify important conclusions with tests, runtime evidence and domain experts.
Is it legal to reverse-engineer an application with AI?
For systems you own or are licensed to modify, generally yes. For third-party software, check licences and law; this article is not legal advice.
Where should we start?
With the part of the system that blocks modernisation most — often the business rules nobody can explain.
Sources and methodology
Facts in this article were checked against the sources below on 6 November 2026. Directory data (ratings, review counts, rate bands and team sizes) changes over time and is shown as published on the date accessed. Illustrative examples are labelled as such and are not quotes.
- Martin Fowler: Original Strangler Fig Application (29 June 2004) — accessed 6 November 2026. Incremental replacement of legacy systems
Related reading
Continue your research
Stuck with an application nobody fully understands?
Share what you know about the system. We will help you use AI-assisted analysis to document it, recover the rules and plan a safe modernisation.
