arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

用于遗留代码迁移确定性验证的智能体方法

Agentic Method for Deterministic Validation of Legacy Code Migration

Andras Ferenczi, Jordan Docherty, Mariya Bessonov, Matthew Findlay, Krishna Lingamneni

arXiv 2607.28271首次发表:更新:

发表机构

American Express(美国运通)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

本文提出名为Locksmith Loop的智能体测试合成方法,通过在三项COBOL-Java案例研究中提升测试覆盖率,实现了遗留代码迁移的确定性验证。

AI 中文摘要

将遗留COBOL程序迁移至Java需要大量测试以确保功能正确性,而测试数据匮乏及所有边界情况验证困难常使该工作复杂化。本文提出一种名为“Locksmith Loop”的新型智能体测试合成方法:首先准备两个运行时环境,在商用硬件上对COBOL源程序与生成的Java目标程序分别植入桩模块并在非主机环境执行;随后迭代智能体循环对输入桩模块执行见证搜索以覆盖程序分支,再进行保持等价性的变异操作。当到达路由边界时,分析器会识别出“锁定段落”——即阻碍深度探索的条件。在三项COBOL-Java案例研究(涵盖两个开源程序与一个内部类生产COBOL程序,源程序行数介于430至4114之间)中,Locksmith始终将测试覆盖率提升至输入搜索平台之上,在两个开源程序上达到近100%的分支覆盖率,在内部类生产COBOL程序上达到91.90%的分支覆盖率。在所有接受的测试用例中,生成的Java代码与COBOL参考代码在确定性等价性检查下表现一致。基于这些发现,我们展示了一种利用确定性预言机验证智能体编码输出的新方法,据我们所知该方法尚属首次提出。

英文摘要

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.

Comments11 pages, 6 figures

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑