Agentic AI
Researchers develop automated method to verify COBOL-to-Java migrations with synthetic test cases
A new approach uses execution trace observation and entry-replay certification to ensure legacy code migrations maintain functionality across thousands of test cases.
Testing whether a migrated Java application behaves identically to its original COBOL predecessor is a major obstacle in legacy code modernization. Researchers have introduced a systematic approach to address this challenge by generating and certifying synthetic end-to-end test cases that validate the correctness of automated code migrations.
The Challenge of Legacy Migration Validation#
Converting large COBOL programs to modern languages like Java requires rigorous testing to ensure no functionality is lost or altered during the translation process. Creating sufficient test cases—and especially synthetic data that exercises diverse code paths—remains a persistent bottleneck in agentic (AI-assisted) migration workflows. Without comprehensive coverage, subtle bugs and business logic errors can slip through.
Synthetic Test Generation via Entry-Replay#
The researchers' method involves generating test cases by observing execution traces of a surrogate COBOL program that simulates external system calls. Rather than relying solely on existing test data, this "entry-replay" certification approach creates new synthetic cases that systematically exercise different branches and logical paths in the source code. Each candidate test case is formally certified before use.
Real-World Application and Results#
The team applied their methodology to a substantial legacy COBOL application containing 33,429 lines of code. The effort produced 849 synthetic test cases that achieved:
- 78.1% branch coverage (2,973 out of 3,806 branches)
- 95.7% paragraph (routine) coverage (989 out of 1,033 main abstract syntax tree paragraphs)
When these certified test cases were run against the migrated Java implementation using a validation oracle called the "Locksmith Loop," all 849 tests matched the surrogate COBOL behavior on specified observations. During this campaign, the team identified and corrected 61 defects in the Java generator.
Limitations and Future Work#
To stress-test the gating methodology, researchers intentionally seeded 450 defects into the Java code, including deleted writes, removed paragraph calls, and altered numeric rounding. The validation approach detected 47.6% of these injected errors, successfully catching all deleted writes and calls within executed code paths. However, it proved unable to detect certain categories of errors, particularly those involving rounding precision—a gap that suggests room for refinement in the validation framework for numeric-sensitive operations.

