Skip to content
Amarello
Case study · Insurance

AI-assisted modernization of a mission-critical COBOL core

A leading insurer in Mexico was migrating a decades-old COBOL platform to Java microservices. The greatest risk was not writing the new code but proving that it does exactly what the old code did. With artificial intelligence we turned that monolith into queryable knowledge, cross-checked its logic against the QA tests and left a code analysis platform running in the client's cloud.

Client
A leading insurer in Mexico
Sector
Insurance
Project
AI-assisted legacy code analysis and software testing
Technologies
Claude · Google Cloud

In numbers

  • ~941,000

    lines of legacy source inventoried and analyzed

  • 281

    business processes covered by the QA validation

  • >60%

    lower AI operating cost than with the initial approach

  • In their cloud

    code analysis platform running in the client's environment

In short

The business logic lived in hundreds of thousands of lines of COBOL that no one wrote recently and whose maintenance depended on scarce specialists. Before migrating, it had to be understood and verifiable. The objective was explicit from kickoff: not to migrate code, but to reduce the risk of the migration at a sustainable cost.

01 · The problem

Migrating without being able to prove that the new system does what the old one did

Migrating a transactional COBOL core to Java microservices raises three problems at once.

  1. 01

    Knowledge is tacit

    Business logic accumulated over decades across programs, copybooks and batch processes. There is no single readable source of truth: the truth is the code.

  2. 02

    Scale exceeds human capacity

    Nearly a million lines spread across thousands of files. Documenting that by hand, process by process, is a person-years effort that ages while it is being produced.

  3. 03

    Risk concentrates in QA

    Every functional omission the tests fail to catch becomes a production defect in a system that moves real financial operations. No one could guarantee that the test matrices covered all the logic the COBOL actually executed.

02 · How we solved it

An AI lab in three phases, inside the client's cloud

We did not rewrite the system: we made it understandable and verifiable, and left that capability in the hands of the client's team.

  1. 1

    Understand the legacy code

    With the help of Claude we built processes that walk the full repository, group artifacts by family and extract each program's structure: inputs, outputs, dependencies, data access and execution flow. That information was translated into natural language to generate technical documentation per process.

    On top of that documentation we built knowledge bases queryable in Spanish, with answers grounded exclusively in the source code. For the first time, the legacy system could be asked what it does and why.

  2. 2

    Cross-check the actual logic against the QA tests

    A production COBOL program is not understood by reading a single file: it is understood by following the chain of copybooks, batch processes and data definitions around it. Claude works with the full repository as context, which allowed long, cumulative analyses over entire program families.

    With that understanding, the AI acts as a virtual tester: it takes the documentation derived from the code and the quality team's test cases, and points out what each test validates, what logic is left unvalidated and which cases should exist. It also compares the COBOL with its Java counterpart to identify the migration patterns in use and their risk.

  3. 3

    From lab to platform

    An artisanal exercise neither scales nor transfers. The third phase turned the method into a code analysis platform deployed in the client's own Google Cloud environment, under their access controls: source code never leaves their perimeter.

    • Indexer

      Ingests and indexes complete repositories, the COBOL monolith and the target Java repositories, and builds a knowledge base over the source code.

    • Agent

      Answers technical queries in natural language, grounded exclusively in the indexed repositories and the test matrices, with traceability back to the source artifact.

    • Web interface

      Puts that capability directly in the hands of the client's development and QA teams, with no intermediaries.

Principles we applied

  • The code stays inAll processing happens on the client's cloud infrastructure, under their identity policies.
  • Grounded answersThe agent answers exclusively from the indexed repositories, with traceability to the artifact. It does not opine: it cites.
  • The human decidesThe AI produces high-quality drafts; functional validation and architectural decisions always belong to the client's team.

03 · The benefit for the client

What the insurer got

The migration stopped being an act of faith and became a verifiable process.

It understands its legacy system

  • About 941,000 lines of code inventoried and analyzed, with technical documentation derived directly from the source code.
  • Knowledge bases queryable in natural language, validated by its own team.

It migrates with less risk

  • Automated cross-validation between the code's actual logic and the test matrices of 281 processes, with coverage gaps identified and new cases recommended.
  • A comparison of the COBOL with its Java counterpart that made the different migration patterns and their risk visible.

Its own capability, not dependency

  • A code analysis platform running in its cloud, with the migration repositories indexed and in use by its development and QA teams.
  • Knowledge transfer and training: the lab does not depend on the vendor.

A sustainable AI cost

  • Cost was calibrated on a small sample before committing the budget. Economical models for mechanical work and the most capable one for deep reasoning, plus incremental adoption at the pace of the migration sprints, cut AI operating cost by more than 60 % compared with the initial approach.

04 · What it means for your operation

It applies to any legacy core undergoing modernization

The pattern transfers to organizations with COBOL, PL/I, C++, PowerBuilder or inherited stored procedures.

  1. 1Inventory and structure the universe of artifacts before analyzing anything.
  2. 2Extract intent from the code with a model capable of sustaining broad context and deep reasoning.
  3. 3Cross-check against QA to turn understanding into test coverage.
  4. 4Calibrate cost on a small sample before committing the full budget.
  5. 5Productize and transfer inside the client's perimeter.

The value lies in none of the five steps on its own. It lies in the migration becoming a verifiable process.

A legacy core undergoing modernization is exactly where we start.

A bounded inventory, cost calibrated on a sample, and a result proven before scaling.

We use one necessary cookie and, only if you accept, measurement cookies to understand how the site is used. No advertising. Cookie policy