🤖 AI Summary
Migrating COBOL systems to Java often suffers from inadequate testing methodologies, leading to challenges in ensuring functional equivalence and comprehensive boundary coverage. This work proposes the “Locksmith Loop,” a novel approach that introduces, for the first time, an agent-based test synthesis mechanism grounded in deterministic oracles. By establishing a co-executable environment between the original COBOL and the target Java code, the method enables deep, automated, and high-fidelity validation through runtime instrumentation, branch-guided witness search, parity-preserving mutation, and locked paragraph analysis. Evaluated on three real-world cases—including two open-source projects and an internal production system—the approach achieves near-complete branch coverage in the former and 91.90% in the latter, with all passing test cases rigorously satisfying deterministic functional equivalence.
📝 Abstract
Migration of legacy COBOL programs to Java requires extensive testing to ensure correct functionality. This effort is often complicated by the lack of test data and the difficulty of validating all corner cases. In this paper we propose a novel agentic test-synthesis method, the "Locksmith Loop," which is initiated by preparing two runtime environments: the COBOL source and the generated Java target are each instrumented with mocks and executed off-mainframe on commodity hardware, then an iterative agentic loop performs Witness Search over input mocks to penetrate program branches, followed by parity-preserving mutations. When routing boundaries are reached, an analyzer identifies a Locked Paragraph: a condition preventing deeper exploration. Across three COBOL-Java case studies, spanning two open-source programs and one internal production-like COBOL program and ranging from 430 to 4,114 source lines, Locksmith consistently improved coverage beyond input-search plateaus, reaching nearly complete coverage on the two open-source programs and 91.90% branch coverage on the internal production-like COBOL program. The generated Java matched the COBOL reference under deterministic parity checks in all accepted test cases. Through these findings we demonstrate, to the best of our knowledge, a novel approach for validating agentic coding output using a deterministic oracle.