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

探索大型语言模型在初级程序员故障定位中的潜力与局限性

Exploring the Potential and Limitations of Large Language Models for Novice Program Fault Localization

College of Information Science and Technology, Beijing University of Chemical Technology(北京化工大学信息科学与技术学院);College of Information Engineering, Beijing Institute of Petrochemical Technology(北京石油化工学院信息工程学院);School of Artificial Intelligence and Computer Science, Nantong University(南通大学人工智能与计算机科学学院)

Hexiang Xu, Hengyuan Liu, Yonghao Wu, Xiaolan Kang, Xiang Chen, Yong Liu

AI总结:

本文评估了LLM在初级程序员故障定位中的性能,发现高级模型在准确性上表现优异,但存在推理过度和计算成本高等问题。

摘要:

初级程序员在故障定位方面面临挑战,因为他们对编程语法和逻辑的理解有限。传统方法如基于光谱的故障定位(SBFL)和基于突变的故障定位(MBFL)有助于识别故障,但往往缺乏理解代码上下文的能力,使其在初学者中效果不佳。近年来,大型语言模型(LLMs)展示了克服这些限制的潜力,通过利用其理解程序语法和语义的能力。基于LLM的故障定位比传统技术提供更准确和上下文感知的结果。本研究评估了六个闭源和七个开源LLM,使用Codeflaws、Condefects和BugT数据集,其中BugT是一个专门设计以减轻数据泄漏问题的新数据集。具有推理能力的高级模型,如OpenAI o3和DeepSeekR1,在最小依赖提示工程的情况下实现了更高的准确性。相比之下,没有推理能力的模型,如GPT-4,需要精心设计的提示来维持性能。尽管LLM在简单的故障定位中表现良好,但随着问题难度的增加,其准确性会下降,尽管在BugT数据集中顶级模型仍能保持稳健表现。过度推理是另一个挑战,一些模型生成过多的解释,阻碍了故障定位的清晰度。此外,部署LLM的计算成本仍然是实时调试的重大障碍。LLM的解释在初级程序员帮助中显示出显著价值,一年经验的参与者始终对其评价很高。我们的发现展示了LLM提高调试效率的潜力,同时强调了进一步改进其推理和计算效率以实现实际应用的必要性。

英文摘要:

Novice programmers often face challenges in fault localization due to their limited experience and understanding of programming syntax and logic. Traditional methods like Spectrum-Based Fault Localization (SBFL) and Mutation-Based Fault Localization (MBFL) help identify faults but often lack the ability to understand code context, making them less effective for beginners. In recent years, Large Language Models (LLMs) have shown promise in overcoming these limitations by utilizing their ability to understand program syntax and semantics. LLM-based fault localization provides more accurate and context-aware results than traditional techniques. This study evaluates six closed-source and seven open-source LLMs using the Codeflaws, Condefects, and BugT datasets, with BugT being a newly constructed dataset specifically designed to mitigate data leakage concerns. Advanced models with reasoning capabilities, such as OpenAI o3 and DeepSeekR1, achieve superior accuracy with minimal reliance on prompt engineering. In contrast, models without reasoning capabilities, like GPT-4, require carefully designed prompts to maintain performance. While LLMs perform well in simple fault localization, their accuracy decreases as problem difficulty increases, though top models maintain robust performance in the BugT dataset. Over-reasoning is another challenge, where some models generate excessive explanations that hinder fault localization clarity. Additionally, the computational cost of deploying LLMs remains a significant barrier for real-time debugging. LLM's explanations demonstrate significant value for novice programmer assistance, with one-year experience participants consistently rating them highly. Our findings demonstrate the potential of LLMs to improve debugging efficiency while stressing the need for further refinement in their reasoning and computational efficiency for practical adoption.

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

↑