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

软件补丁的自动描述生成

Automated Description Generation for Software Patches

Thanh Trong Vu, Tuan-Dung Bui, Thanh-Dat Do, Thu-Trang Nguyen, Hieu Dinh Vo, Son Nguyen

AI总结:

本文提出PATCHEXPLAINER,将软件补丁描述生成建模为机器翻译任务,通过显式表示关键元素并结合描述相似性进行训练,在真实数据集上显著优于现有方法。

摘要:

软件补丁在改进和发展代码库方面起着关键作用,能够解决错误、漏洞和优化问题。补丁描述提供了变更的详细记录,有助于开发者之间的理解和协作。然而,手动创建描述在时间消耗以及质量和细节的变化方面存在挑战。在本文中,我们提出PATCHEXPLAINER,一种通过将补丁描述生成构建为机器翻译任务来解决这些挑战的方法。在PATCHEXPLAINER中,我们利用关键元素、历史上下文和语法约定的显式表示。此外,PATCHEXPLAINER中的翻译模型设计时考虑了描述相似性。特别是,该模型被明确训练以识别和纳入被聚类成组的补丁描述中存在的相似性,从而提高其在相似补丁中生成准确且一致描述的能力。双重目标是最大化相似性并准确预测所属组。我们在一个大型真实世界软件补丁数据集上的实验结果表明,PATCHEXPLAINER始终优于现有方法,在BLEU上改进高达189%,在Exact Match率上提升5.7倍,在Semantic Similarity上提升154%,证实了其在生成软件补丁描述方面的有效性。

英文摘要:

Software patches are pivotal in refining and evolving codebases, addressing bugs, vulnerabilities, and optimizations. Patch descriptions provide detailed accounts of changes, aiding comprehension and collaboration among developers. However, manual description creation poses challenges in terms of time consumption and variations in quality and detail. In this paper, we propose PATCHEXPLAINER, an approach that addresses these challenges by framing patch description generation as a machine translation task. In PATCHEXPLAINER, we leverage explicit representations of critical elements, historical context, and syntactic conventions. Moreover, the translation model in PATCHEXPLAINER is designed with an awareness of description similarity. Particularly, the model is explicitly trained to recognize and incorporate similarities present in patch descriptions clustered into groups, improving its ability to generate accurate and consistent descriptions across similar patches. The dual objectives maximize similarity and accurately predict affiliating groups. Our experimental results on a large dataset of real-world software patches show that PATCHEXPLAINER consistently outperforms existing methods, with improvements up to 189% in BLEU, 5.7X in Exact Match rate, and 154% in Semantic Similarity, affirming its effectiveness in generating software patch descriptions.

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

↑