arXiv:2501.10542cs.SEcs.AI2025-01被引 7

用大模型智能反馈提升代码缺陷定位准确率

Improved IR-based Bug Localization with Intelligent Relevance Feedback

  • 用大模型分析报告与代码上下文关联性
  • 在MAP/MRR/HIT@K上领先基线超48%
  • 能定位52%原方法无法处理的劣质报告

软件缺陷是开发与维护中的重大挑战,开发者约50%时间用于处理缺陷。现有基于信息检索(IR)的定位技术依赖文本与语义相关性,但难以跨越需深度上下文理解的关键鸿沟。本文提出BRaIn技术,利用大语言模型(LLM)评估报告与代码间的语境相关性,并通过其生成的智能相关性反馈重构查询、重排源文档,从而改进缺陷定位。在Bench4BL基准数据集上,使用三个指标评估并与六种基线方法对比,实验结果表明,BRaIn在MAP、MRR和HIT@K上分别超越基线87.6%、89.5%和48.8%。此外,可定位约52%因报告质量差而无法被基线定位的缺陷。该方法通过填补上下文差距并引入智能反馈,显著提升了基于IR的缺陷定位能力。

原文摘要 · Abstract (English)

Software bugs pose a significant challenge during development and maintenance, and practitioners spend nearly 50% of their time dealing with bugs. Many existing techniques adopt Information Retrieval (IR) to localize a reported bug using textual and semantic relevance between bug reports and source code. However, they often struggle to bridge a critical gap between bug reports and code that requires in-depth contextual understanding, which goes beyond textual or semantic relevance. In this paper, we present a novel technique for bug localization - BRaIn - that addresses the contextual gaps by assessing the relevance between bug reports and code with Large Language Models (LLM). It then leverages the LLM's feedback (a.k.a., Intelligent Relevance Feedback) to reformulate queries and re-rank source documents, improving bug localization. We evaluate BRaIn using a benchmark dataset, Bench4BL, and three performance metrics and compare it against six baseline techniques from the literature. Our experimental results show that BRaIn outperforms baselines by 87.6%, 89.5%, and 48.8% margins in MAP, MRR, and HIT@K, respectively. Additionally, it can localize approximately 52% of bugs that cannot be localized by the baseline techniques due to the poor quality of corresponding bug reports. By addressing the contextual gaps and introducing Intelligent Relevance Feedback, BRaIn advances not only theory but also improves IR-based bug localization.

缺陷定位大模型信息检索

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。