Logiciel Solutions Contact Us
Success Stories Tech News Investors Contact Us
whitepaper
8 min read

Legacy Modernization with AI: A Strategy Guide.

AI now reads legacy code fast enough to change the cost of modernization, yet the same tools still get code translation wrong more often than right. In a peer-reviewed study, LLMs produced correct translations only 2.1% to 47.3% of the time, while Google reported that LLMs generated 74.45% of the code changes in 39 narrow internal migrations.

Gartner predicts more than 70% of mainframe exit projects started in 2026 will fail to deliver intended benefits because buyers overestimate generative AI. This guide maps AI to Gartner's seven modernization options, explains how to verify AI output, and sequences the work.

Its evidence is vendor documentation, GAO reports, Gartner forecasts and a small body of research on code migration, not a survey of enterprise modernization outcomes.

In depth

AI Speeds Up Understanding Legacy Code And Still Struggles To Translate It.

01

Comprehension is where AI is strongest today.

Before LLMs, teams spent months tracing copybooks and JCL by hand and interviewing retiring developers. IBM now says watsonx Code Assistant for Z uses AI agents to explain mainframe code and document business logic in COBOL and PL/I applications. AWS Transform for mainframe generates documentation for large codebases with a chat interface for querying it, and Google's Mainframe Assessment Tool uses Gemini to produce summaries, technical specifications and business rules from COBOL, JCL and HLASM source. For Java, .NET and C++ projects, GitHub Copilot modernization analyzes code, configuration and dependencies and produces modernization plans. This output still reads like a new analyst's notes, so each extracted rule needs a business owner to confirm it. Documentation pays back on every option, including the ones where no code is ever translated.

In shortincluding the ones where no code is ever translated
02

Translation accuracy is the weak point.

In the ICSE 2024 study "Lost in Translation", Pan et al. found LLMs produced correct code translations only 2.1% to 47.3% of the time across real projects and benchmarks, and identified 15 categories of translation bugs in 1,700 code samples. Two findings match what modernization teams report: choosing target data types that preserve source behavior is hard, and mapping or reimplementing equivalent APIs introduces bugs. Legacy code adds its own traps. COBOL packed decimal fields round and truncate differently from Java defaults, EBCDIC sort order differs from ASCII, REDEFINES clauses and GO TO flows carry implicit state, and JCL step order holds rules outside program code. Translated code that compiles and reads well can still be wrong.

In shortTranslated code that compiles and reads well can sti…
03

The strongest positive evidence comes from narrow migrations.

Google reported that across 39 internal migrations, an LLM generated 74.45% of 595 submitted code changes, and developers estimated a 50% cut in total migration time. A companion report covers migrations such as JUnit3 to JUnit4. These were repetitive changes in a codebase with strong tests and a review culture, not COBOL rewrites of a core ledger. Vendor tooling shows the same split. AWS describes its Refactor pattern as deterministic COBOL-to-Java conversion that keeps the monolithic structure, while IBM, Google and Microsoft offer generative translation, and GitHub made Copilot app modernization generally available for Java and .NET in September 2025. AI pays off first where changes are small, repetitive and already covered by tests.

In shortrepetitive and already covered by tests
04

Gartner has moved from optimism to warning.

In 2023 it forecast that by 2027, GenAI tools would explain legacy applications and create replacements, cutting modernization costs by 70%. In June 2026 it predicted that more than 70% of mainframe exit projects started that year will fail to deliver intended benefits because buyers overestimate generative AI tooling, and that by 2030, 75% of vendors in the mainframe exit market will pivot or shut down. Gartner also says many mainframe customers will get more from GenAI by modernizing in place than by accelerating an exit. Federal progress shows the same drag, with only three of the ten critical modernizations GAO flagged in 2019 finished by February 2025. Overestimating what AI can carry is now the leading cause of failure Gartner names.

In shortOverestimating what AI can carry is now the leading…
The detail

Three Questions To Ask Before AI Changes Your Legacy Code.

None of this requires a team to stop using AI on legacy systems. It requires the people funding the work to check whether AI output is being trusted or proven. Three questions expose the difference, and each one is answered by a single document that either exists or does not.

Zone · 01

Who confirmed each rule

Ask who confirmed each business rule the AI extracted, and which source code it came from. AI documentation reads like a new analyst's notes, and GAO describes a COBOL and assembly skills gap that AI documentation eases only when experts validate it. A rule nobody owns is carried into the new system unchecked or quietly dropped. The artifact is a rule catalog that maps every rule to its source and a named business owner.

Zone · 02

What proves the match

Ask where the expected outputs in the test suite came from. Characterization tests record what the legacy system does today, right or wrong, and their expected results must come from running it. If a model misreads a rule, tests built from its reading will pass on wrong code. The artifact is a characterization test suite with outputs captured from the legacy system, plus written parity criteria for a parallel run.

Zone · 03

How large each slice is

Ask how much of the system changes in a single release and how it is rolled back. Gartner ties its 70% failure forecast to buyers overestimating what GenAI tools can do. The strangler fig pattern limits blast radius by routing each request to old or new code through a facade, so rollback becomes a routing change. The artifact is a slice plan with a tested rollback for each capability.

By the numbers

The figures that make it a board-level conversation.

More than 70%
of mainframe exit projects started in 2026 that Gartner predicts will fail to deliver intended benefits because buyers overestimate generative AI tooling
2.1% to 47.3%
share of code translations LLMs got correct across real projects and benchmarks
74.45%
of 595 code changes in 39 internal Google migrations generated by an LLM
Inside the report

What you'll take away.

01

Step 1 - Point AI at comprehension and documentation before translation

Inventory, dependency mapping and code explanation are the most mature AI tasks. Have business owners confirm each extracted rule, since that catalog supports every modernization option, including ones that never translate code.

02

Step 2 - Capture characterization tests from the running legacy system

Let AI draft input classes, boundary values and harnesses, but take expected outputs from the legacy system itself. Add boundary tests for packed decimal, encoding and date logic.

03

Step 3 - Modernize one capability at a time behind a strangler fig facade

Route each request to old or new code, run both in parallel on real inputs, and diff outputs. Shift traffic only when parity holds and rollback has been tested.

04

Step 4 - Write a plan with milestones, scope of work and legacy disposition

These are GAO's three plan elements and a fair baseline for any charter. In 2025 GAO found only three of 11 critical federal legacy systems had plans that included all three.

Questions

Frequently asked.

What is legacy system modernization?

Legacy system modernization is updating an aging application so it meets current business, security and cost needs. Gartner groups the approaches into seven options: encapsulate, rehost, replatform, refactor, rearchitect, rebuild and replace, ordered from least to most disruptive.

Most programs mix several options across a portfolio, so the choice is made per application based on business value, technical health and risk.

How is AI used in legacy modernization?

AI is used to parse and explain legacy code, extract business rules, generate documentation and tests, automate framework upgrades and assist with code translation. Tools include AWS Transform for mainframe, IBM watsonx Code Assistant for Z, GitHub Copilot modernization and Google's Mainframe Assessment Tool.

AI is most reliable for comprehension and for narrow, well-tested code changes, and least reliable for translating complex legacy logic.

Can AI convert COBOL to Java reliably?

Not on its own. Vendor tools convert COBOL to Java and some generate equivalence tests, but a peer-reviewed ICSE 2024 study found LLMs produced correct translations only 2.1% to 47.3% of the time.

Gartner warns that overestimating generative AI will cause more than 70% of mainframe exit projects started in 2026 to miss their goals. Characterization tests and parallel runs come before trusting any translated code.

Why do mainframe modernization projects fail?

They fail mostly on scope. Common causes are oversized projects, weak tests, undocumented business rules, data coupling and too few mainframe experts. Gartner names overestimation of generative AI capabilities as a leading cause for projects started in 2026.

GAO found most critical federal legacy systems lacked complete plans with milestones, a description of the work and a legacy disposition plan.

Does AI make legacy modernization faster or cheaper?

For some tasks, yes. Google reported that developers estimated a 50% cut in total time across 39 narrow internal migrations where an LLM generated 74.45% of code changes. Gartner forecast in 2023 that GenAI would cut modernization costs by 70% by 2027, but by June 2026 it warned of a growing gap between marketing claims and real ability to migrate complex legacy code. Cutover and data migration still set the pace.

What does this whitepaper include?

It includes a map of AI maturity across seven modernization tasks, a decision matrix for Gartner's seven options, the strangler fig delivery model, verification strategies for AI-translated code, a data migration checklist, a risk and control table, the US federal context from GAO, a five-phase roadmap and an eight-factor readiness scorecard with a pre-pilot checklist.

How far does the evidence in this guide reach?

It reaches as far as public sources allow. The figures come from GAO reports, Gartner press releases, official AWS, IBM, Microsoft, GitHub and Google documentation, and research on LLM code migration, including Google's internal migrations and the ICSE 2024 translation study.

Vendor capabilities are vendor-reported. None of it is a survey of enterprise modernization outcomes, and the roadmap and scorecard are guidance, not measured results.

Get the whitepaper

Have it emailed to you.

Drop your details and we'll send Legacy Modernization with AI: A Strategy Guide straight to your inbox - no spam, unsubscribe anytime.

Download whitepaper
Next step

Find out which parts of your legacy estate AI can safely change first.

Bring one legacy application, its source and the tests you have today. We will work through which modernization option fits it, where AI can help, and what proof of parity the first slice would need. SECTION 7 - FAQ - 5 to 8 questions

Book a modernization review