一句话:提出基于符号执行的测试生成框架,自动验证 COBOL 到 Java 翻译的语义等价性。
基于大语言模型的生成式技术已可将 COBOL 等遗留企业代码翻译为 Java 或 Python 等现代语言,但自动转换结果的可信度无法保证。本文提出一个框架与工具,用于验证原始 COBOL 程序与翻译后 Java 程序之间的等价性。该方法采用基于符号执行的测试生成技术,自动为源 COBOL 程序生成单元测试,并对测试中涉及的外部资源调用进行 mock;随后生成等价的 JUnit 测试用例及等价 mock,通过运行这些测试检查两个程序的语义等价性。验证结果还可用于修复翻译代码中的问题,并为 AI 模型提供反馈以改进后续转换。作者实现了相应工具并提供了演示视频。
Recent advances in Large Language Model (LLM) based Generative AI techniques have made it feasible to translate enterpriselevel code from legacy languages such as COBOL to modern languages such as Java or Python. While the results of LLM-based automatic transformation are encouraging, the resulting code cannot be trusted to correctly translate the original code. We propose a framework and a tool to help validate the equivalence of COBOL and translated Java. The results can also help repair the code if there are some issues and provide feedback to the AI model to improve. We have developed a symbolic-execution-based test generation to automatically generate unit tests for the source COBOL programs which also mocks the external resource calls. We generate equivalent JUnit test cases with equivalent mocking as COBOL and run them to check semantic equivalence between original and translated programs. Demo Video: https://youtu.be/aqF_agNP-lU
@inproceedings{paperbot8276,
title = {Automated Validation of COBOL to Java Transformation},
author = {Atul Kumar and Diptikalyan Saha and Toshiaki Yasue and Kohichi Ono and Saravanan Krishnan and Sandeep Hans and Fumiko Satoh and Gerald Mitchell and Sachin Kumar},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3695365}
}