arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.09657cs.SE
收藏

代码大语言模型对故障定位的影响

Impact of Large Language Models of Code on Fault Localization

Suhwan Ji, Sanghwa Lee, Changsup Lee, Hyeonseung Im, Yo-Sub Han

AI总结:

本文提出一种序列生成方法微调代码大语言模型用于故障定位,在Defects4J基准上Top-1/3/5预测表现均优于现有最优基于学习的故障定位技术,为相关任务提供新方向。

摘要:

在软件调试中,定位错误位置至关重要。传统故障定位(FL)技术依赖于执行程序,并结合代码覆盖矩阵与测试用例结果来计算每个函数或代码行的可疑度分数。近年来,基于学习的故障定位技术利用机器学习模型从代码覆盖矩阵中提取有效特征,以提升故障定位性能。然而,这类技术需要可编译的源代码、现成的测试用例,以及专门的工具来为目标编程语言生成代码覆盖矩阵。\n本文首次提出一种简单且有效的序列生成方法,用于针对故障定位任务微调代码大语言模型(LLMCs)。近年来,LLMCs在各类软件工程问题中受到广泛关注。基于此,我们利用LLMCs在大规模代码语料上预训练所获得的代码固有理解能力。具体而言,我们针对故障定位任务微调了13个具有代表性的、基于编码器、编码器-解码器和解码器架构的LLMC。与现有方法不同,LLMC不依赖编译后的输入,因此即使代码存在语法错误也能进行分析。不过,它们对输入数据的长度存在限制。因此,为了与现有故障定位技术进行公平比较,我们从项目级基准Defects4J中提取包含错误的方法,并在行级别上进行分析。实验结果表明,采用我们的方法微调后的LLMC,在Defects4J的1291个方法的Top-1/3/5预测中,成功定位错误位置的比例分别为50.6%、64.2%和72.3%,性能分别是当前最优的基于学习的前沿技术的1.35倍、1.12倍和1.08倍。我们的研究结果为利用LLMC开展故障定位和自动化程序修复任务提供了有前景的研究方向。

英文摘要:

Identifying the point of error is imperative in software debugging. Traditional fault localization (FL) techniques rely on executing the program and using the code coverage matrix in tandem with test case results to calculate a suspiciousness score for each function or line. Recently, learning-based FL techniques have harnessed machine learning models to extract meaningful features from the code coverage matrix and improve FL performance. These techniques, however, require compilable source code, existing test cases, and specialized tools for generating the code coverage matrix for each programming language of interest. In this paper, we propose, for the first time, a simple but effective sequence generation approach for fine-tuning large language models of code (LLMCs) for FL tasks. LLMCs have recently received much attention for various software engineering problems. In line with these, we leverage the innate understanding of code that LLMCs have acquired through pre-training on large code corpora. Specifically, we fine-tune representative encoder, encoder-decoder, and decoder-based 13 LLMCs for FL tasks. Unlike previous approaches, LLMCs can analyze code sequences even with syntactic errors, since they do not rely on compiled input. Still, they have a limitation on the length of the input data. Therefore, for a fair comparison with existing FL techniques, we extract methods with errors from the project-level benchmark, Defects4J, and analyze them at the line level. Experimental results show that LLMCs fine-tuned with our approach successfully pinpoint error positions in 50.6\%, 64.2\%, and 72.3\% of 1,291 methods in Defects4J for Top-1/3/5 prediction, outperforming the best learning-based state-of-the-art technique by up to 1.35, 1.12, and 1.08 times, respectively. Our findings suggest promising research directions for FL and automated program repair tasks using LLMCs.

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

↑