AcademyTransform & Optimize

Modernizing Legacy Systems with AI

How AI changes the economics of legacy modernization and where it needs rigorous verification; how to choose among the seven migration strategies, migrate incrementally, price technical debt, and demonstrate behavioral equivalence before every cutover.

T202Practitioner13 slidesAbout 11 minutes

1 / 13
PDF
AxiareteAcademy

T202Transform & Optimize · Practitioner

Modernizing Legacy Systems with AI

Recovering knowledge from legacy code, choosing the right strategy, and demonstrating equivalence before cutover.

FormatKnowledge pack · 13 slides
ForArchitects and engineering leaders
LevelPractitioner
Axiarete Academy · T20202 / 13

The premise

Modernization depends on recovering undocumented knowledge

Legacy systems encode decades of rules, exceptions and workarounds, many never written down. AI lowers the cost of recovering that knowledge. It does not remove the need to verify it.

RecoverBusiness rules and dependencies, from code and runtime data.
DecideThe right strategy for each application.
VerifyEquivalence before every cutover.
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20203 / 13

Strategy

Seven strategies, chosen application by application

The seven Rs in AWS migration guidance. For large migrations, AWS recommends migrating first and modernizing afterward.

StrategyWhat changesChoose it when
RetireThe application is switched offThe capability is unused or duplicated
RetainNothing, for nowChange is not yet justified
RehostInfrastructure onlySpeed matters and the code is sound
RelocateHosting location only; same platformBulk moves of virtualized environments
RepurchaseReplaced by a SaaS or packaged productThe capability does not differentiate
ReplatformSelected components, such as the databaseA managed service cuts operating effort
Refactor or re-architectCode and architectureThe capability differentiates and must evolve
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20204 / 13

AI in modernization

Where AI helps today, and where it needs rigorous verification

Helps today
  • Explaining unfamiliar code in plain language
  • Extracting business rules into reviewable specifications
  • Mapping call graphs, data access and dependencies
  • Generating characterization tests from observed behavior
  • Translating well-bounded, well-tested modules
Verify rigorously
  • EBCDIC collating order in comparisons, key ranges and sorts
  • Decimal precision: packed-decimal fields, truncation unless ROUNDED
  • Transaction, locking and concurrency semantics
  • Behavior defined outside the code, in JCL, job schedulers and CICS
  • Batch checkpoint, restart and error-handling logic
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20205 / 13

Verification

Verify each AI output before it reaches a parallel run

Researchers testing IBM’s COBOL-to-Java assistant write that LLM-translated code “cannot be trusted to correctly translate the original code.”

AI outputVerified byAccepted when
Extracted rulesExpert review of each rule against the code it citesA named owner has accepted or rejected every rule
Dependency mapsComparison with scheduler definitions and runtime records such as SMFEvery unmatched dependency is explained
Generated testsInputs and expected outputs captured from the legacy system, not predicted by the modelAn agreed branch-coverage target is met; gaps are listed as risks
Translated codeUnit tests derived from the legacy code, static analysis and expert reviewTests pass and review findings are closed
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20206 / 13

Pattern

Migrate incrementally with the strangler fig

Described by Martin Fowler in 2004 and revised in 2024: grow the new system around the old one until the old one can be removed.

1InterceptRoute calls through a façade the team controls.
2Carve outChoose one capability with clear boundaries.
3RebuildImplement it in the target architecture.
4Run in parallelCompare outputs on production-like traffic.
5ShiftMove traffic gradually, with rollback ready.
6RemoveRetire the old code path, then repeat.
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20207 / 13

Equivalence

Demonstrate equivalence before every cutover

Characterization testsCapture current behavior, defects included, before changing anything.
Parallel runsRun old and new on the same inputs and compare the outputs.
ReconciliationCompare batch and financial outputs run by run, to the last digit.
Shadow trafficMirror live requests to the new system; discard its responses and block side effects.
Agreed tolerancesBusiness owners decide which differences are acceptable.
RollbackA tested path back that also returns data written after cutover.
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20208 / 13

Technical debt

Price technical debt as principal and interest

Ward Cunningham coined the debt metaphor in 1992. In Martin Fowler’s elaboration, principal is the cost to fix and interest is the recurring cost of not fixing, such as slower change.

DebtSignalInterest paid as
CodeComplexity in frequently changed code, low test coverageSlower changes, more defects
ArchitectureTight coupling, shared databasesWider blast radius, coordination cost
InfrastructureUnsupported operating systems and runtimesExtended support fees, security exposure
DependenciesOutdated libraries and frameworksVulnerability backlog, forced major upgrades
KnowledgeFew people understand the systemKey-person risk, slow onboarding
DataInconsistent definitions and copiesReconciliation effort, reporting errors
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20209 / 13

Priorities

Pay down debt where the interest is highest

HighInterestLow
Fix nowQuick returns. Schedule it into normal delivery.
Fund and planA business case with milestones and measured interest.
Fix in passingClean it up when the code is next changed.
Contain or retireIsolate it, or remove the system that carries it.
LowPrincipalHigh
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20210 / 13

Data

Data migration is often the critical path

Profile earlyMeasure quality before design decisions depend on it.
Map meaningFields with the same name often mean different things.
Cleanse at sourceFix defects in the source system before migration.
ReconcileCheck record counts, control totals and balances after every load.
Plan the cutoverWindows, freeze periods and delta loads.
Archive historyRetain per policy and legal holds, accessible outside the new system.
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20211 / 13

Pitfalls

Why modernization programs overrun

Big-bang rewrites
Incremental replacement with parallel runs
Line-by-line translation
Redesign where the old structure no longer fits
Trusting generated code without tests
Characterization tests before any change
Modernizing what should be retired
Rationalize first, then modernize
Forgetting batch jobs and reports
Map scheduled jobs and downstream reports early
No business owner for differences
Name who accepts or rejects each deviation
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20212 / 13

Getting started

An indicative first modernization wave

Weeks 1–4Understand
  • Choose a strategy for each application
  • Recover rules and dependencies with AI, reviewed by experts
  • Write characterization tests
Weeks 5–12Prove
  • Carve out one capability behind a façade
  • Run old and new in parallel
  • Agree tolerances with business owners
Weeks 13–24Scale
  • Shift traffic and retire the old path
  • Repeat for the next capabilities
  • Report debt and cost removed
Modernizing Legacy Systems with AITransform & Optimize
Axiarete Academy · T20213 / 13

Summary

Key takeaways

  1. Recover the knowledge in legacy code and verify it with tests.
  2. Choose among the seven strategies per application, and retire before you modernize.
  3. Use AI to explain, extract, test and translate, and verify every output against the legacy system.
  4. Migrate incrementally, and demonstrate equivalence before every cutover.
  5. Price technical debt as principal and interest, and fix where interest is highest.
Next course · S201AI Governance in PracticeSecure & Govern · Practitioner
Modernizing Legacy Systems with AITransform & Optimize

Bring this course to your leadership team

We run private working sessions that apply these frameworks to your own estate, data and pending decisions.