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

REACCEPT:基于动态验证与大型语言模型的生产代码与测试代码自动化协同演化

REACCEPT: Automated Co-evolution of Production and Test Code Based on Dynamic Validation and Large Language Models

Jianlei Chi, Xiaotian Wang, Yuhan Huang, Lechen Yu, Di Cui, Jianguo Sun, Jun Sun

AI总结:

本文提出REACCEPT方法,结合大型语言模型、动态验证与检索增强生成技术,实现生产与测试代码的自动化协同演化,在537个Java项目实验中更新准确率达60.16%,显著优于现有方法。

摘要:

同步生产代码与测试代码(即PT协同演化)对于软件开发生命周期中的软件质量至关重要。现有的自动PT协同演化方法要么使用预定义的启发式规则,要么依赖机器学习技术的简单应用。由于底层技术的局限性,现有方法要么只能部分实现PT协同演化的自动化(例如仅自动化过时测试代码的识别),要么导致准确率较低。在本文中,我们提出了REACCEPT,这是一种利用大型语言模型和动态验证来完全自动化PT协同演化(即能够识别和更新过时测试用例)的新方法。REACCEPT依靠基于经验的提示模板生成、动态验证和检索增强生成技术来完成自动化的PT协同演化。为了评估REACCEPT的有效性,我们在包含537个Java项目的数据集上进行了大量实验,并将REACCEPT的性能与几种最先进的方法进行了比较。结果表明,REACCEPT在正确识别的过时测试代码上达到了60.16%的更新准确率,超越了最先进的技术CEPROT 90%。这证实了REACCEPT能够有效地辅助开发人员维护测试代码,提高整体软件质量并减少维护工作量。

英文摘要:

Synchronizing production and test code, known as PT co-evolution, is critical for software quality in the software development lifecycle. Existing methods for automatic PT co-evolution either utilize predefined heuristic rules or rely on simple application of machine learning techniques. Due to the limitations of underlying techniques, existing methods either only partially automate PT co-evolution (e.g., only automate obsolete test code identification) or result in low accuracy. In this paper, we propose REACCEPT, a novel approach that leverages large language models and dynamic validation to fully automate PT co-evolution (i.e., capable of both identifying and updating obsolete test cases). REACCEPT relies on experience-based prompt template generation, dynamic validation, and retrieval-augmented generation techniques to accomplish automated PT co-evolution. To evaluate REACCEPT's effectiveness, we extensive experiments with a dataset of 537 Java projects and compared REACCEPT's performance with several state-of-the-art methods. Results show that REACCEPT achieved an update accuracy of 60.16% on correctly identified obsolete test code, surpassing the state-of-the-art technique CEPROT by 90%. This confirms that REACCEPT can effectively assist developers in maintaining test code, improving overall software quality and reducing maintenance effort.

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

↑