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

深度学习基于自动补丁正确性评估中的代码表示效果研究

On the Effectiveness of Code Representation in Deep Learning-Based Automated Patch Correctness Assessment

Nanjing University of Science and Technology(南京理工大学);Nanjing University(南京大学);Swinburne University of Technology(斯威本科技大学)

Quanjun Zhang, Haichuan Hu, Chunrong Fang, Ye Shang, Tao Zheng, Zhenyu Chen, Yun Yang, Liang Xiao

AI总结:

本文研究了不同代码表示在预测补丁正确性中的性能,发现基于图的表示在多个基准上表现最佳,同时整合序列表示可提升性能。

摘要:

自动程序修复(APR)旨在生成正确的补丁,但因测试套件薄弱而持续面临补丁过拟合问题。为此,社区提出了多种预测补丁正确性的方法(APCA方法)。其中,局部深度学习方法通过将输入代码片段编码为精心设计的表示并构建二元模型来预测正确性。尽管这些方法在理解补丁正确性方面基础重要,但代码表示尚未被系统研究。为此,本文进行了首次广泛研究,评估了不同代码表示在超过500个训练的APCA模型上预测补丁正确性的性能。实验结果表明,基于图的代码表示在多个基准上表现最佳,例如在三个GNN模型上,CPG的平均准确率为82.6%。此外,本文还展示了此类表示在三种不同先前APCA方法中的表现,例如通过AST过滤掉87.09%的过拟合补丁。我们进一步发现,将序列表示整合到启发式表示中可使五个指标平均提升13.5%。总体而言,本文研究突显了利用代码表示来推理补丁正确性的潜力和挑战,从而提高了现成APR工具的实用性并减少了开发人员的手动调试工作。

英文摘要:

Automated program repair (APR) attempts to generate correct patches and has drawn wide attention from both academia and industry in the past decades. However, APR is continuously struggling with the patch overfitting issue due to the weak test suites. Thus, to address the overfitting problem, the community has proposed an increasing number of approaches to predict patch correctness (APCA approaches). Among them, locally deep learning approaches aimed at automatically match designs has been emerging strongly. Such approaches typically encode input code snippets into well-designed representations and build a binary model for correctness prediction. Despite being fundamental in reason about patch correctness, code representation has not been systematically investigated. To bridge this gap, we perform the first extensive study to evaluate the performance of different code representations on predicting patch correctness from more than 500 trained APCA models. The experimental results on 15 benchmarks with four categories and 11 classifiers show that the graph-based code representation which is ill-explored in the literature, consistently outperforms other representations, e.g., an average accuracy of 82.6% for CPG across three GNN models. Moreover, we demonstrate that such representations can achieve comparable or better performance for three different previous APCA approaches, e.g., filtering out 87.09% overfitting patches by TREETRAIN with AST. We further find that integrating sequence-based representation into heuristic-based representation is able to yield an average improvement of 13.5% on five metrics. Overall, our study highlights the potential and challenges of utilizing code representation to reason about patch correctness, thus increasing the usability of off-the-shelf APR tools and reducing the manual debugging effort of developers in practice.

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

↑