arXiv:2610.27272cs.SEOct 2026

Manuscript Offprint

arXiv:2610.27272

Certifying Repeatable Entry-Replay Witnesses for COBOL-to-Java Migration

Andras L. Ferenczi, Mariya Bessonov, Allwyn Ponnudurai, Chandrakanth R. Mamillapalli, Krishna K. Maddula, Krishna K. Lingamneni

Andras L. Ferenczi ID^{ID}, Mariya Bessonov, Allwyn Ponnudurai

Chandrakanth R. Mamillapalli, Krishna K. Maddula, Krishna K. Lingamneni

American Express

Abstract—Producing synthetic data for comparison testing a migrated COBOL application is a major challenge that agentic migrations face today. Our prior paper, the Agentic Method for Deterministic Validation of Legacy Code Migration, presents a deterministic oracle to facilitate such migrations, the Locksmith Loop. We now propose a novel method for achieving high branch and paragraph coverage through generated synthetic end-to-end test cases, by means of entry-replay test-case certification by observing the code execution trace on a surrogate COBOL program that mocks external interactions via a chronological external-operation tape. We applied our method to a very large COBOL program with 33,429 lines of code to generate 849 synthetic end-to-end test cases covering 2,973/3,806 source branches (78.1%) and 989/1,033 main-AST paragraphs (95.7%). Using the Locksmith Loop's projected-agreement validation, the generated Java code matched the COBOL surrogate on the specified observations across all 849 certified synthetic end-to-end test cases. During the campaign we detected 61 defects and fixed the Java generator accordingly. To test whether the coding agent could silently introduce business logic bugs, we seeded 450 defects into the Java code, such as deleted writes, deleted paragraph calls, and altered rounding, to verify how many of these would be detected by the gating methodology. The gate detected 47.6%, including all deleted writes and paragraph calls in executed code, but was unable to detect the rounding and precision defects.

Index Terms—legacy migration, COBOL, differential testing, test generation, deterministic replay, translation validation

I. INTRODUCTION

Agentic legacy migration projects need deterministic methods for validating migrated behavior. Frequently, lack of documentation and test data makes it difficult to validate parity between the legacy code (COBOL, in our case) and the new migrated Java code. Unit tests go only so far as to validate local functionality, and integration tests can go only so far as to minimally validate functionality. Even with comprehensive quality assurance user testing, there is a limited guarantee that the system will work as expected with the COBOL code being the ground truth.

The Locksmith Loop [1] provides two methods for generating witnesses (synthetic end-to-end test cases): the Witness Search (input-space exploration) and the Mutation (parity-preserving code mutation). The Locksmith Loop provided a witness generation method demonstrated on a 4,114-line, 142-paragraph COBOL codebase. This paper evaluates a methodological successor to the Locksmith Loop on a 33,429-line, 1,033-paragraph program.

We focus in this research on a novel approach for witness discovery while reusing the Locksmith Loop agentic method for checking projected agreement between the migrated Java code and the surrogate COBOL codebase on certified witnesses. It is important to clarify that the method does not guarantee production functional parity. It is nevertheless helpful for discovering behavioral differences that might otherwise not be identified.

We ask: RQ1: can our method grow the coverage of the COBOL surrogate, and how does coverage accumulate as the certified catalog grows? RQ2: how does the source-outcome set of the final certified catalog differ from that of the retained local-search corpus? RQ3: how many seeded translation defects does the certified gate detect under the observation projection ΦH\Phi_{H} (Section III), and where does detection fail? RQ4: what kinds of COBOL-to-Java migration bugs did the repeatable certification method expose, and how many repairs did each kind require? RQ5: what are the guarantees and the limits of our witness certification process?