arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.14971cs.LGcs.SE
收藏

利用大语言模型实现遗留代码现代化:LLM生成文档的挑战与机遇

Leveraging LLMs for Legacy Code Modernization: Challenges and Opportunities for LLM-Generated Documentation

The MITRE Corporation(MITRE公司)
Colin Diggs, Michael Doyle, Amit Madan, Siggy Scott, Emily Escamilla, Jacob Zimmer, Naveed Nekoo, Paul Ursino, Michael Bartholf, Zachary Robin, Anand Patel, Chr… 展开作者

Colin Diggs, Michael Doyle, Amit Madan, Siggy Scott, Emily Escamilla, Jacob Zimmer, Naveed Nekoo, Paul Ursino, Michael Bartholf, Zachary Robin, Anand Patel, Chris Glasz, William Macke, Paul Kirk, Jasper Phillips, Arun Sridharan, Doug Wendt, Scott Rosen, Nitin Naik, Justin F. Brunelle, Samruddhi Thaker

AI总结:

本文研究利用LLM为MUMPS和IBM大型机汇编等遗留代码生成注释文档,提出提示策略与评估标准,发现LLM生成注释总体质量较高但缺乏可靠的自动化评估指标。

摘要:

遗留软件系统以MUMPS和大型机汇编等过时语言编写,在效率、维护、人员配置和安全性方面面临挑战。尽管大语言模型(LLM)为这些系统的现代化带来了希望,但其理解遗留语言的能力在很大程度上仍是未知的。本文利用两个数据集研究使用LLM为遗留代码生成文档的情况:一个采用MUMPS编写的电子健康记录(EHR)系统,以及采用IBM大型机汇编语言代码(ALC)编写的开源应用程序。我们提出了一种用于生成逐行代码注释的提示策略,以及一个用于评估注释完整性、可读性、有用性和幻觉的评估标准。我们的研究评估了人工评估与自动化指标(如代码复杂度和基于参考的指标)之间的相关性。我们发现,与真实注释相比,LLM为MUMPS和ALC生成的注释通常无幻觉、完整、可读且有用,尽管ALC仍带来一定挑战。然而,没有任何自动化指标与注释质量强相关,足以预测或衡量LLM的性能。我们的发现凸显了当前自动化度量方法的局限性,以及为遗留系统中LLM生成文档建立更好评估指标的必要性。

英文摘要:

Legacy software systems, written in outdated languages like MUMPS and mainframe assembly, pose challenges in efficiency, maintenance, staffing, and security. While LLMs offer promise for modernizing these systems, their ability to understand legacy languages is largely unknown. This paper investigates the utilization of LLMs to generate documentation for legacy code using two datasets: an electronic health records (EHR) system in MUMPS and open-source applications in IBM mainframe Assembly Language Code (ALC). We propose a prompting strategy for generating line-wise code comments and a rubric to evaluate their completeness, readability, usefulness, and hallucination. Our study assesses the correlation between human evaluations and automated metrics, such as code complexity and reference-based metrics. We find that LLM-generated comments for MUMPS and ALC are generally hallucination-free, complete, readable, and useful compared to ground-truth comments, though ALC poses challenges. However, no automated metrics strongly correlate with comment quality to predict or measure LLM performance. Our findings highlight the limitations of current automated measures and the need for better evaluation metrics for LLM-generated documentation in legacy systems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑