How to Validate a COBOL Migration with AI

Six approaches we use at Abstracta to verify that the migrated system behaves like the original, with examples from a real case: a fintech's COBOL core with more than 8 million lines of code.

COBOL Migration: 6 Approaches to Validating Your Migrated System. Abstract network of connected nodes with check marks.

Validating a COBOL migration, or a migration of any other legacy system, means verifying that the migrated system preserves the behavior of the original system. One strategy for doing this is to use the original system as the specification: capture how it behaves, repeat the same executions on the migrated system, and analyze every difference.

In systems with millions of lines of code, this is only feasible if you break the problem into more manageable parts and build a risk-based plan. We use AI to work at this scale on legacy code, and we validate the results with the people who know the business. This guide is for CTOs, engineering leaders, and QA leaders in banks, fintechs, and other organizations that need to migrate COBOL without putting the business at risk.

This challenge is likely to become more common, because COBOL (like other legacy platforms) is still at the center of many businesses. According to IBM, it processes 95% of ATM transactions and underpins more than 40% of online banking systems. The fintech in this article, for example, runs its core system on COBOL. IBM, citing a 2021 survey, reports an estimated 250 billion lines of COBOL code in production use, and notes that AI can help bridge skills gaps as COBOL developers retire. IBM also lists reducing operational costs and improving interoperability among the benefits of modernizing COBOL applications.

I've been working in testing for more than 20 years, and I worked on legacy migrations long before generative AI. In this article, I share how we approach this challenge today at Abstracta, with examples from an ongoing project: the cloud migration of a Latin American fintech's core system, written in COBOL and with more than 8 million lines of code.

These are six approaches we use to validate a COBOL migration:

  1. Use the original COBOL system as the specification.
  2. Understand undocumented code with the help of AI agents.
  3. Observe the original system at runtime.
  4. Test at different levels of the system, for example, with specific validations for data migration.
  5. Define a different strategy for each component based on its risk.
  6. Review what AI generates at scale and validate it with the business.

Migrating a COBOL or legacy system? Let’s talk about how to validate the migrated system and reduce migration risk.

The Example: An 8-Million-Line COBOL Migration

The fintech needed to migrate its core system because the version of the platform it runs on was approaching the end of its support period. To avoid operating on technology with no backing in case of future problems, the company decided to move the system to the cloud. The project is planned to last two years and is already past the halfway mark. These are the main figures of the system:

System dimensionValue
LanguageCOBOL
FilesMore than 9,000
Lines of codeMore than 8 million
High-level entry points (DCL scripts and API wrappers)More than 750
Embedded SQL statements in the codeMore than 40,000
Code structureUse of GOTO, no object orientation, and asynchronous batch queues
Years of evolution30

Due to the limitations of the language and the underlying platform, the system is poorly modularized and carries three decades of changes and patches. Documentation is scarce or outdated, and many of the people who took part in building it are no longer on the team, so it's common to find portions of code, or entire modules, whose implementation nobody understands.

On top of that, the system processes money movements in a regulated environment, so any change requires a high level of control. What's at stake is business continuity, since everything runs on this core system.

Our role is to support the testing of the migration. The main challenge isn't in development, but in validating that the migrated system keeps the same behavior as the current one and that critical processes keep working correctly.

Why Is Testing the Bottleneck When Migrating COBOL?

With all that code in production, the big question is how to migrate it without putting the business at risk.

With AI assistants and agents, rewriting COBOL code for a target architecture takes much less effort than before. The challenge then shifts to testing: validating that the migrated system preserves the behavior of the original and produces the same results.

In February 2026, Anthropic published an article on COBOL modernization with Claude Code, which links to its code modernization guide. After reading it closely, I was left with the impression that it describes a simpler scenario than the ones we find in real systems.

Having a Claude Code license and following that guide may be enough for a system of a few thousand lines. But COBOL systems that have been in production for decades tend to hold business knowledge in enormous volumes of code. At that scale, migration becomes an engineering problem as much as a rewriting one: how to structure the process, how to break it into manageable parts, and how to reduce risk. IBM describes COBOL modernization in similar terms: system-level engineering work that incorporates code translation, application integration, data architecture redesign, runtime replacement, transaction processing integrity, and security, among other factors. IBM also describes how AI supports code conversion and test generation: in one multi-agent approach it cites, a coder agent translates the code and a reviewer agent checks the converted code, and AI-powered tools can generate tests that compare the semantic equivalence of the new code with the original COBOL code.

More Than 90% of the Project Was Testing

More than ten years ago, I worked on one of my first large migration projects. A Latin American supermarket chain, which had started as a small store 25 years earlier, had 10 locations and wanted to open its 11th. But its RPG system used a single-digit store identifier. Changing that field affected the database structure and, from there, processes such as inventory management, money movements, and account balances.

The company had no documentation, no test cases, and no established testing practice, and the people who had built the system had retired, left, or passed away. All that remained was the code and the users. For a year and a half, we interviewed key users to document how the system worked and what behavior they expected from it, rebuilt the specifications, and wrote tests. The code change took just a month and a half. More than 90% of the project was testing.

The project was a success, but that ratio explains why migrations like that one were uncommon. Today, with AI further reducing the effort needed to modify or rewrite code, many migration and modernization projects are likely to follow the same pattern: less time spent on development and much more effort devoted to validating that the system keeps working as it should.

Technical Debt and Cognitive Debt

Technical debt appears when we solve something in a way that later makes the system harder to maintain or modify: lack of documentation, automated tests, modularization, or other decisions that create future costs.

Cognitive debt, as Margaret-Anne Storey, professor of computer science at the University of Victoria, describes it, is "the debt compounded from going fast" that "lives in the brains of the developers." In practice, it means not understanding how a part of the code works or why it was built that way. I've seen it many times in teams that say, "nobody touches that code because nobody knows why it works." In those cases, even the business rule that originally led to writing it that way may have been lost.

In a COBOL migration, both debts coexist. Besides transforming old code, the challenge is rebuilding enough knowledge about the system to validate that the new one behaves the same. In a 30-year-old system, cognitive debt usually outweighs technical debt, and that's where AI contributes the most: more than writing new code, it helps build understanding of the old code.

Approach 1: Use the Original COBOL System as the Specification

In a COBOL migration, the goal of testing is to verify equivalence: that the migrated system behaves the same as the original. In new development, we look for software that is correct according to what the business expects. In a migration, the legacy system already supports a working business, so its current behavior becomes the specification and the test oracle.

When I talk about legacy code, I like to go back to a 2004 reference book, Working Effectively with Legacy Code, by Michael Feathers. Feathers defines legacy code as code without tests: if something changes, there's no way to validate that the behavior is still what the business needs. For those cases, he proposes the characterization testing approach.

Applied to a COBOL migration, it works like this:

  1. Run functional and automated tests that cover as many paths of the original system as possible.
  2. Save the output of those executions.
  3. Repeat the same executions on the migrated system and save its output.
  4. Compare both outputs and analyze every difference, because that's where a migration error may be.
Characterization testing in a COBOL migration: test the original system, save the output, repeat on the migrated system, and compare every difference.

In this approach, it doesn't matter whether the original output is correct. What matters is detecting where the new system behaves differently. In my view, this is the approach to follow in any modernization of this kind.

There's no magic here: what we do is use AI to scale a pattern that Feathers described more than 20 years ago. I like to sum it up like this: AI does the checking, and people do the testing, with the information AI helps them obtain.

To generate that coverage, we work along two complementary tracks, functional and automation, with two perspectives: a static one, on the code, and a dynamic one, on the running system. Approaches 2 and 3 explain each perspective.

Approach 2: Understand COBOL Code Without Documentation

When a COBOL system has no up-to-date documentation, the most reliable source becomes the code itself. Anthropic's article describes the same starting point: AI that identifies program entry points, traces execution paths through called subroutines, and maps data flows between modules. A friend from college used to say that the best documentation of how a system works is its own source code, because it's the only documentation that's always up to date. In these migrations, it's clear he was right. The difficulty lies in finding what you need within millions of lines, and that's what AI agents make feasible.

An agent that analyzes the entire repository lets you go from the general to the specific and generate different artifacts depending on what you need to understand:

  • Architecture and component diagrams, to get a first picture of the system.
  • Pseudocode or sequence diagrams, to understand a flow end to end.
  • State machines, to follow the lifecycle of a business entity.
  • Flowcharts, to understand the logic and detect edge cases.
  • Documentation, test cases, and test data derived from the code itself.

IBM notes that AI tools can also produce inline comments that document what certain code fragments do.

That said, I believe the most valuable part isn't the diagrams, but having a knowledge base that the testing team can query in natural language, with business questions such as "How is interest calculated on an overdue loan?"

For automated testing, the same static analysis supports dependency mapping and call graphs, from which unit, API, UI, and performance tests are derived. Performance deserves its own attention, because it's another major risk in this type of migration.

A simple way to look at it: the static approach gives you the map, and the dynamic one, which we'll see in Approach 3, confirms that the system still follows it.

How We Do It with Tero

At Abstracta, we use Tero, our open-source AI agent harness for building specialized AI agents that operate with context and governance at scale.

In an Abstracta Tech Talk, I showed an agent connected to an open-source repository written in RPG, code I wasn't familiar with, from a system for managing employees and customers.

First, I asked it for an architecture diagram, then to explain what the application does and what its database structure is, including the data types of each attribute. Then I asked how an employee is added: it returned the business rules, the files involved, and the pseudocode for that logic. Since I found the pseudocode complex, I asked it to represent it as a flowchart.

Tero can be deployed in each organization's own cloud (BYOC) or on the organization's own on-prem infrastructure, and it works with the LLM that the organization chooses: models from OpenAI or Anthropic, or even an open-weight model deployed locally, as one of our clients already does. This way, the system's information stays in a controlled environment.

Through MCP or the APIs available in Tero, agents connect to the tools the team already uses: the code repository, task and documentation managers such as Jira, Confluence, Redmine, or YouTrack, test management tools such as PractiTest or Zephyr, observability sources (metrics, logs, and traces), and databases. For legacy systems, we also built an MCP server that connects to an AS400.

Approach 3: Observe the COBOL System at Runtime

There's a lot of talk about the context an AI agent needs to do its job well. The people doing the testing need it too, and observability is one of the best ways to give it to them: it lets you see the original system's runtime behavior behind each action, something the code alone doesn't show, and the screen people use to interact with the system shows even less.

In functional testing, the idea is for the tester to explore the original system alongside a copilot that explains, in natural language, what the backend is doing:

  • Which endpoints were called and which records were modified.
  • Which jobs were queued and what the trace of each one is.
  • Which state changes occurred.
  • Which internal errors occurred, even if they aren't shown to the user.

This way, the tester sees logs, traces, and queries without leaving the test, and no longer has to guess what's happening behind the scenes. Together with Bantotal's R&D team and Microsoft's AI Co-Innovation Lab, we developed a copilot of this kind for a core banking platform, and then applied the same idea in other environments. Behind the scenes, it connects to the logs and observability tools that already existed; what's new is that everything can now be queried in natural language, which opens it up to a wider audience (for example, testers, analysts, or PMs with no programming experience).

In automated testing, observability plays a different role: it shows what coverage the tests are achieving and makes it possible to keep improving them.

Can You Have Observability on a Mainframe?

Yes, and it's nothing new. About 15 years ago, I came across CA Wily (now DX APM, from Broadcom), one of the first modern observability tools I knew of, which could already connect to mainframes. Its founder later created New Relic (I found that out because he told me himself when I met him at an event in 2016). I remember conversations and working sessions with AS400 administrators and RPG or COBOL developers who showed me how they achieved full traceability, from the user's action to the record that was modified in the database.

More modern platforms, such as Datadog, have focused on cloud and Kubernetes architectures and aren't always as compatible with legacy platforms. Even so, one way or another, you can rebuild the traceability between a user's action and the data it ended up modifying in the database.

Approach 4: Test at Different Levels of the System

At the start of the current project with the fintech I mentioned earlier, the first approach seemed simple: read the code, generate unit tests with 100% coverage, run them, and call the job done. But it wasn't that easy.

We analyzed the call tree to test from the leaves upward and mock the dependencies that had already been tested. Several limitations appeared right away. Running the test for a single file takes about a minute, so a basic set for more than 9,000 files would take around 9,000 minutes, and those tests are run many times throughout the project. Unit testing and coverage measurement tools for COBOL are often restricted by licenses or compiler limitations, and each new run requires restoring a database, which takes about 5 hours. In addition, unit tests need well-defined units, and in a monolith like this one, that means first finding its seams (I come back to this in Approach 5).

Second Attempt: Testing from the Entry Points

That's why we changed strategy and moved automation up to the level of the DCL scripts, which automate system workflows, and the API wrappers, which are the entry points closest to integration and to the user. This took us from more than 9,000 files to more than 750 entry points. That's still a significant volume, so we prioritized based on usage logs and interviews with key users. One of the first findings was that a high percentage of files hadn't been used in more than a year or had duplicate behavior.

We also don't work directly on the COBOL code. From the code analysis, we generate an intermediate Markdown format that explains each feature: inputs, outputs, variables, possible paths, and edge cases. That format serves two purposes: the LLM uses it to generate the automated tests, and the testing team uses it to validate the behavior with the business owners. The generated tests go through a code review process that combines automated review with a review by one or two people.

This approach has its costs too. We lose some control over code coverage, but we gain alignment with business priorities. And keep in mind that bugs already in production can show up in the characterization tests, because the original system is the reference. It's best to decide in advance what to do with them. Finally, a reminder that applies to any migration: don't forget or underestimate performance.

Characterization Testing at the Data Layer Too

As an additional check, we also cover the data layer. The fintech's code has more than 40,000 embedded SQL statements, and the idea is to have automated tests that run those queries against the original database and compare the results with those from the migrated database. A copy of production is used for this. The comparison covers both the data and the response times.

All of this is part of an iterative approach. The goal is to improve the migration tool in early stages: run small tests on its output, detect what doesn't work, and fix it. The final migration will include the full test run, and the idea is to reach that moment with fewer surprises.

Approach 5: Define a Different Strategy for Each Component Based on Its Risk

A large COBOL system can't be migrated or tested as a single unit. You have to break it into parts and define a strategy for each one based on its risk. We call these parts slices: they can be vertical business units or technical layers, and each one has its own diagnosis, its own controls, and its own evidence.

What Often Goes Wrong

In many migrations, I see two recurring problems. The first is that the diagnosis is descriptive rather than operational: "legacy" is used as a synonym for "old," a label that measures nothing. Risk is estimated by intuition, and decisions about scope and speed are made based on perception rather than evidence. The second is that execution has no evidence-based gates: migrations are planned as a big bang, there are no clear measurements of test coverage, and rollback procedures are missing.

A Six-Phase Methodology

To organize that work, we use a six-phase methodology on each slice:

  1. Discovery and baseline: build a verifiable description of the system as it is today.
  2. Migration strategy: decide what changes, how, and in what order.
  3. Behavior control: build the safety net before changing anything.
  4. Implementation: make the change gradually, improve the migration script with early tests, and run the final tests before going to production.
  5. Go-live and rollout: expand traffic as evidence builds up, with rollback ready.
  6. Stabilization and handover: close the loop with the operations team.
Six-phase methodology for each slice: discovery and baseline, migration strategy, behavior control, implementation, go-live and rollout, and stabilization and handover.

In the strategy phase, three decisions are made for each slice: how to partition it and in what order to proceed; what changes (infrastructure, runtime, architecture, data, vendor, or integrations); and with which transition mode, such as coexistence, strangler, branch by abstraction, or expand-contract. We introduce the six phases and the eight verification dimensions in our article on legacy modernization with AI.

What to Validate First in Each COBOL Modernization Path

Besides the transition mode, each slice follows a modernization path. According to Anthropic, most COBOL modernization efforts pick from four approaches: rehost, refactor, rewrite, and replace. Each path changes something different in the system, so the validation effort starts in a different place. This table shows where we suggest starting:

Modernization pathWhat changesWhere we suggest starting validation
RehostThe COBOL code moves to new infrastructure largely unchanged, although IBM notes that moving mainframe workloads to the cloud usually requires some changes, such as altering access to data, installing middleware, or recompiling the applications.Batch jobs, data access, and integrations, comparing the same executions and SQL queries on both platforms, including response times.
RefactorThe code is restructured without changing behavior.Characterization tests at the entry points before each change, so each step can be compared against the previous behavior.
Rewrite (for example, COBOL to Java)The code is converted to a modern language such as Java or Python.Business logic and calculations: decimal precision, data types, and the data structures defined in copybooks, compared with the original.
ReplaceThe system is swapped for a commercial product.The business rules and data flows the old system implemented, which need to be rediscovered and checked against the new product's behavior.

How to Measure the Risk of Each Slice

The diagnosis of each slice is based on eight dimensions that indicate how capable that part of the system is of producing verifiable evidence:

DimensionWhat it measuresWeight
1. Unit and functional testsWhether critical flows are covered and can be repeatedCritical
2. Integration, API, and contract testsWhether the boundaries between systems are clear and validatedSupport
3. Regression and continuous executionTests in CI and gatesCritical
4. Non-functional and operational baselinePerformance, security, and accessibilityComplementary
5. ObservabilityWhat can be inspected at runtimeSupport
6. Incident management and traceabilityHow degradations are handledSupport
7. Versioning, delivery, and reversibilityChange controlCritical
8. Knowledge managementDocumentation and tacit knowledgeComplementary

Each dimension is rated on a maturity scale from 0 to 4: nonexistent, initial or isolated, defined, managed, and optimized. Based on that assessment, each slice falls into a risk class:

  • Critical: one or more dimensions at level 0. There's no safety net to start migrating.
  • High: critical dimensions at level 1, or two support dimensions at level 0. A lot of preparation is needed.
  • Medium: critical dimensions at level 2 and no support dimension at level 0. The migration is feasible with targeted reinforcements.
  • Low: critical dimensions at level 3 or higher. The migration moves forward with incremental gates.

Here's what it looks like for a fictional system being planned for migration, with the scores for the three critical dimensions (Dimensions 1, 3, and 7):

SliceD1 / D3 / D7RiskStrategy
Core ledger0 / 0 / 1CriticalBuild the safety net first and run a pilot with a small slice
Batch ETL0 / 1 / 0CriticalSet up a resettable environment and add approval tests on critical paths
Reporting1 / 3 / 3HighStrengthen D1 before migrating, then proceed incrementally
Customer management2 / 2 / 2MediumApply the strangler pattern with feature flags and targeted reinforcements
API gateway3 / 3 / 4LowMigrate directly with gates in CI

It's the same system, with five slices, four risk levels, and a strategy for each one. From there, you can define the deployment strategy and the roadmap.

The Monolith Paradox

In a highly interdependent monolith, a paradox appears: can you refactor with confidence, without tests, to make the system testable? To isolate a component and migrate it first, you have to modify the monolith, and to modify it without losing behavior, you need tests that don't exist yet. The key is finding the cracks in the monolith, the points where you can separate a part and move forward little by little.

In my experience, risk-based planning is one of the parts left out when migration is framed in an extremely simplified way as giving the code to an LLM, generating the tests, and running them.

Approach 6: Review What AI Generates at Scale and Validate It with the Business

Everything AI generates in a COBOL migration, from a diagram or pseudocode to an automated test, needs a verification scheme designed by the team. Models keep getting better, but they still hallucinate.

Two Teams, Two Levels

At the fintech, we apply characterization testing at two levels, and each one has its own team:

  • Functional team (end to end): documents the system's behavior, interviews users, validates and updates the documentation, and designs risk-based test cases. What we get from querying the code with an LLM isn't taken at face value: it serves as a starting point for conversations with the people who know the business, who are the ones who confirm whether it makes sense.
  • Technical team: analyzes the code and logs, understands the stack's limitations (which automation frameworks exist, how to measure coverage, what observability is available), works with dependency maps, execution trees, data access, and integrations, and generates and validates the automated tests, prioritized according to the system's actual usage.

Reviewing Thousands of Generated Tests

Among the tests AI generates, some have no assertions or very weak assertions, others add mocks right on the part you want to test, and others use hardcoded data. With thousands of tests, reviewing them one by one is no longer humanly possible.

I think that's where we need to step up a level: in addition to designing tests, design a scalable scheme that gives us peace of mind about the coverage and quality of the tests we create. For that, I go back to the fundamentals, such as heuristics. A question as simple as "Do all these tests have at least one assertion?" already helps detect some of the ones we need to fix, and from there, you need to dig into what makes a test good in each system. It's a challenge we're still figuring out.

Testing the Agents Too

An agent is a piece of software, so it needs tests too. In Tero, we automate them with an LLM-as-a-judge approach. That way, if a faster or cheaper model comes along, you can make the switch and verify that the agent still works as expected.

Where Doesn't AI Save You in a COBOL Migration?

AI reduces time and costs in many parts of a COBOL migration, but some challenges still depend on management and on people's judgment. It's best to plan for them from day one:

ChallengeWhat it involves
Token costsAnalyzing repositories with millions of lines and generating thousands of tests requires a significant investment.
Data security and privacyYou need to choose tools that allow this work to be done in a secure environment.
HallucinationsDiagrams, pseudocode, or any interpretation of the code may be wrong and need verification.
Validating at a reasonable costReviewing what AI produces also takes time and people, and it needs to be planned.
Stack limitationsMeasuring coverage, adding observability, automating tests, or creating mocks in COBOL isn't always possible with the available tools.
Environment stability and costAt the fintech, restoring the database takes about 5 hours, and spinning up a new environment isn't as simple as spinning up a container.
Organizational bottlenecksAccess to environments, repositories, licenses, and real test data is often the biggest obstacle, along with dependence on a few people who are also keeping the business running.

If an AI tells you your migration is "fully tested," are you really going to hit the deploy button? I don't think we're ready for that today. The decision to turn off the old system and turn on the new one is still a human one, and the more visible the risks and their mitigations are to whoever makes it, the more informed the risk the organization takes on.

The risk of a migration is determined by your ability to verify. If you can't validate behavior in the new environment, you can't govern the migration.

That's why, in my view, the underlying problem in many migrations is epistemological: where the knowledge of the system lives and where we get it from.

Conclusion: Migrating COBOL with Evidence

Validating a COBOL migration means demonstrating, with evidence, that the new system behaves like the original. AI greatly speeds up understanding the code and generating tests, but what makes the project feasible is how that work is organized: taking the original system as the specification, testing at the right level, comparing results at the data layer too, defining a strategy based on the risk of each slice, and validating everything with the business. That is how a COBOL modernization project helps protect the business value the old system still delivers.

At Abstracta, we work at that intersection: AI-powered quality engineering, human expertise, and agents that operate with context. With Abstracta Intelligence, our enterprise AI platform built on Tero, teams can scale those agents with governance and visibility.

Are you evaluating the migration of a COBOL system, a mainframe, or a core banking system? We can help you lower the risk of that migration with a quality strategy tailored to each component.

Let's talk.
Illustration of a person at a laptop placing a chess piece on the screen and holding a connected-nodes icon, representing strategy and thoughtful decision-making. Faqs section about COBOL Migration.

FAQs about COBOL Migration

What Is COBOL and Why Do Banks Still Use It?

COBOL, short for common business-oriented language, is a programming language for business data processing, first released in 1960, and banks still use it for critical systems: IBM links its adoption by many large financial institutions to its strong support for large-precision fixed-point decimal calculations. According to IBM, it handles 95% of ATM transactions and underpins more than 40% of online banking systems. Insurance companies and government agencies rely on it too.

️ We work with legacy platforms and core banking systems, where we help teams validate the COBOL logic their business still runs on.

How Do You Validate a COBOL Migration?

You validate a COBOL migration by using the original system as the specification. Run functional and automated tests on the COBOL system, save the results, repeat the same executions on the migrated system, and analyze each difference in the output. This approach, called characterization testing, targets behavioral equivalence: the same input should produce the same output. In large systems, you also break the system into parts by risk and validate the results with the business.

️ We design characterization tests at the levels each system allows, from entry points to the data layer, and prioritize them with usage data.

How Do You Check That a COBOL Migration Doesn't Change the System's Behavior?

To check that a COBOL migration doesn't change the system's behavior, compare the results of the original and migrated systems for the same executions. The original system is the reference, even where its behavior has errors. You can compare results in functional tests, in automated tests at the system's entry points, and at the data layer, running the same SQL queries against both databases. Validation also covers integrations and data access.

️ We help the business decide in advance what to do with the bugs the original system already had, since characterization tests can reproduce them as expected behavior.

How Do You Prove That a Replatformed COBOL Application Works the Same as the Original Before You Switch It On in Production?

To show that a replatformed COBOL application works the same as the original before you switch it on in production, build evidence of equivalence: compare the outputs of the same executions and, at the data layer, run the same SQL queries on a copy of production, comparing data and response times. Running both platforms side by side during the transition keeps the original as the reference. Then move traffic gradually, with go-live gates and rollback ready.

️ We help the people who own the risk make the final call with the comparison results in front of them, by defining the evidence each slice needs before go-live.

Can You Migrate COBOL with Claude Code or Other AI Tools?

You can use Claude Code or other AI tools in a COBOL migration to understand legacy code and to help migrate COBOL applications to modern languages. In our experience with millions of lines of code, a full COBOL migration also requires engineering work around the tool, such as breaking the system into parts, managing the risk of each one, and verifying that the business keeps working the same way.

️ We help verification keep pace with code changes when teams use AI coding tools in a migration, by adding risk-based planning for each slice.

What Should You Do If the COBOL System You Want to Migrate Has No Documentation?

If the COBOL system you want to migrate has no documentation, the most reliable source is the COBOL code itself, which AI agents let you query in natural language. These agents can generate architecture diagrams, the database structure, business rules, pseudocode, and flowcharts. Treat what AI returns as a hypothesis and validate it with the people who know the business, such as key users, who confirm whether it makes sense.

️ Our functional teams turn those AI outputs into documentation reviewed with key users, helping that knowledge stay with the organization.

How Do You Run Regression Tests When Migrating a Core Banking System?

To run regression tests when migrating a core banking system, compare the current system's behavior with the migrated system's. To make them feasible at scale, consider automating them at the system's entry points, such as scripts and API wrappers, instead of file by file, and prioritize them with usage logs and interviews with key users. In regulated, mission-critical environments, the depth of testing for each component depends on its risk, regulatory requirements, and agreement with the business.

️ We check generated regression tests with simple heuristics, such as whether each test has at least one assertion, and refine what makes a good test in each system.

How Do You Validate Data Migration from a COBOL or Mainframe System?

Data migration from a COBOL or mainframe system can be validated with characterization testing at the data layer. Run the SQL queries embedded in the code against the original and migrated databases, on a copy of production, and compare both the returned data and the response times. In the fintech's project, the goal is to cover its more than 40,000 embedded SQL statements. Doing this iteratively makes it possible to fix the migration tool before the final migration.

️ Our technical team makes these data-layer comparisons repeatable each time the migration tool changes, by designing them as automated tests.

How Much Effort Does Testing Take in a Mainframe Migration?

Testing can account for most of the effort in a mainframe or other legacy platform migration. In the legacy RPG system migration described in this article, more than 90% of the project was testing: a year and a half to document the system's behavior, rebuild the specifications, and write tests, and a month and a half for the code change. Some tasks don't get faster with AI, such as restoring the database, which takes about 5 hours at the fintech.

️ When we plan the quality work in a migration, we account for that effort from day one, including environment restores, access, and test data.

How Do You Reduce Risk in Mainframe Modernization?

To reduce risk in mainframe modernization, break the system into slices and rate each one across eight dimensions, including functional testing, continuous regression, observability, and reversibility. Each slice then gets a critical, high, medium, or low risk level and its own migration strategy, from building a safety net first to moving directly with gates in CI. This phased approach avoids treating the project as a single migration, and the final switch remains a human decision.

️ We run this slice-by-slice diagnosis with your teams and turn it into a migration roadmap with evidence-based gates.

What Company Can Help Validate a COBOL Migration?

A company that can help validate a COBOL migration is Abstracta, a technology company with nearly 20 years of experience that combines AI-powered quality engineering with deep human expertise. It supports the validation of a Latin American fintech's COBOL core migration to the cloud, with more than 8 million lines of code. Separately, it helped a top bank in Latin America triple its QA coverage, from 6 to 18 projects, without linear headcount growth.

️ Our functional analysts work with your key users, and our technical specialists build the automation around the behavior they confirm.

What Should You Look for in a COBOL Migration Tool?

What you should look for in a COBOL migration tool, especially for an enterprise COBOL migration, is analysis that identifies program entry points, traces execution paths, and maps dependencies across files, including data structures defined in copybooks and data shared through files or databases. As IBM notes, COBOL modernization is system-level engineering work. In our experience, the full migration also requires analysis, testing, and validation that the team plans around the tool.

️ We help the migration tool's output improve before the final migration by testing what it produces from the early stages.

What Parts of a COBOL Program Matter During Migration?

The parts of a COBOL program that matter during migration start with its four divisions. According to IBM, the identification division names the program in its PROGRAM-ID paragraph, the environment division specifies the runtime environment and the input and output resources, the data division holds variable, file, and constant definitions in sections such as working-storage, and the procedure division contains the executable code. Data structures defined in copybooks and embedded SQL statements add dependencies that a migration needs to understand.

️ We use AI agents to map these structures and their dependencies across the codebase, and our teams review those maps before designing tests.

What Is Replacing COBOL?

What is replacing COBOL depends on the modernization path. When code is rewritten, it moves to a modern language such as Java or Python, and IBM also lists C# and .NET as targets for transforming COBOL code; when the system is replaced, a commercial product takes its place. Rehosting keeps COBOL on new infrastructure. IBM also describes encapsulation, which wraps business functions as microservices exposed through APIs without requiring changes to the underlying COBOL system.

️ In the migration strategy phase, we record for each slice what changes and which transition mode it follows.

How Can You Migrate from COBOL to Java?

To migrate from COBOL to Java, start by mapping the legacy codebase: entry points, execution paths, copybooks, and shared data structures. Then move in small parts, with AI assisting code conversion and code generation, and compare each part against the original system. The converted Java code has to reproduce COBOL business logic, including fixed-point decimal calculations, data types, and business rules, so each slice is validated with characterization tests before cutover.

️ Before tests are generated, we document each feature's inputs, outputs, paths, and edge cases in an intermediate format that the testing team reviews with business owners.

How Do You Modernize Legacy COBOL Systems Without a Full Rewrite?

To modernize legacy COBOL systems without a full rewrite, plan the application migration in increments: replatform some components, refactor others selectively, expose stable business functions through APIs, and convert to modern languages only where it pays off. This phased approach lets teams modernize COBOL applications according to risk while critical parts keep running, and each change is compared against the original system before it moves forward.

️ We help each component keep a comparison baseline against the original system by sequencing incremental changes.

What Are the Biggest Risks in a COBOL Migration?

The biggest risks in a COBOL migration are undocumented business logic, hidden dependencies, data differences, and changes in system behavior. Decades of changes can leave important business rules documented only in the code, while copybooks and other dependencies can affect multiple programs. Because COBOL systems often support mission-critical operations, migration planning also needs to account for downtime, rollback, and behavioral equivalence.

️ In the discovery phase, we combine AI-assisted code analysis with interviews with key users to surface hidden dependencies and undocumented rules before a slice moves.

What Can Go Wrong When AI Converts COBOL to Java or Another Modern Language?

When AI converts COBOL to Java or another modern language, the generated code can alter decimal precision or data types, mishandle copybook dependencies, or change business logic, so the migrated system behaves differently. AI can accelerate COBOL code analysis and conversion, but generated code still needs validation. This is important in financial applications, where fixed-point decimal calculations need to produce the same results after migration. Comparing both systems' outputs for the same input helps detect these differences before cutover.

️ Our technical team works with dependency maps, execution trees, data access, and integrations, which helps locate where converted code may behave differently.

How Do You Preserve Decimal Precision in a COBOL Migration?

To preserve decimal precision in a COBOL migration, map COBOL's fixed-point decimal data types carefully in the target language and test calculations against the original system. Preserving decimal precision is critical when COBOL applications process financial transactions because, as IBM notes, COBOL's large-precision fixed-point decimal calculations are not necessarily native to many traditional programming languages. The objective is behavioral equivalence: for the same input, the migrated system should produce the same output.

️ We suggest including calculation-heavy cases, such as interest and balances, in the characterization tests, since that's where rounding differences can surface.

About the Author

Federico Toledo is co-founder and Chief Quality Officer of Abstracta, holds a PhD in software testing, and has worked in the testing industry for more than 20 years.

He is the author of the first testing book originally written in Spanish, now available for free in both Spanish and English, and he is a community builder: for many years he was part of the organizing team of Testing Uy, he created the Quality Sense podcast and the Quality Sense Conf, and he takes part in initiatives such as TAPIA (Workshop on Testing and Artificial Intelligence) and WOPR (Workshop on Performance and Reliability).

About Abstracta

With nearly 2 decades of experience and a global presence, Abstracta is a technology company that helps organizations deliver high-quality software faster by combining AI-powered quality engineering with deep human expertise.

Our expertise spans industries and complex delivery environments. That's why we've built robust partnerships with industry leaders such as Microsoft, Datadog, Tricentis, Perforce BlazeMeter, Sauce Labs, and PractiTest.

Planning a COBOL migration? Contact us to define how to validate it.

Contact Us

Stay connected

with Abstracta

News, articles, and resources on building better software.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Read about our privacy policy.

Illustration of two people connected by a bridge, one with a laptop and one with a tablet, representing collaboration and bridging communication. End of article about COBOL Migration.