<p>Bug localization is a time-consuming and error-prone task in software debugging. Although recent large language model (LLM)-based approaches improve semantic understanding between bug reports and source code, their effectiveness is often limited by noisy bug reports and excessively large search spaces, which destabilize reasoning and incur high computational cost. We propose CoFiLoc, a multi-modal, coarse-to-fine framework for method-level bug localization that explicitly treats search-space compression as a primary objective. CoFiLoc first performs structured bug report denoising to extract high-value technical information, and then progressively narrows the candidate space by integrating lightweight dynamic execution evidence, stack-trace-guided structural signals, and dual semantic-lexical ranking, before applying LLM-based reasoning over a compact set of fault-relevant methods. Extensive experiments on 323 real-world bugs from five Defects4j projects have been conducted to benchmark CoFiLoc against representative spectrum-based, information retrieval-based, deep learning-based, and LLM-based localization methods. The results show that CoFiLoc outperforms the best-performing baseline by up to 13.2% in terms of Top-1 accuracy and reduces Mean Average Rank (MAR) and Mean First Rank (MFR) by up to 2.9 and 2.3 times, respectively.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

CoFiLoc: A Coarse-to-fine LLM-based framework for method-level bug localization

  • Nham Cao,
  • Nhut Tien Nguyen,
  • Thanh Binh Nguyen

摘要

Bug localization is a time-consuming and error-prone task in software debugging. Although recent large language model (LLM)-based approaches improve semantic understanding between bug reports and source code, their effectiveness is often limited by noisy bug reports and excessively large search spaces, which destabilize reasoning and incur high computational cost. We propose CoFiLoc, a multi-modal, coarse-to-fine framework for method-level bug localization that explicitly treats search-space compression as a primary objective. CoFiLoc first performs structured bug report denoising to extract high-value technical information, and then progressively narrows the candidate space by integrating lightweight dynamic execution evidence, stack-trace-guided structural signals, and dual semantic-lexical ranking, before applying LLM-based reasoning over a compact set of fault-relevant methods. Extensive experiments on 323 real-world bugs from five Defects4j projects have been conducted to benchmark CoFiLoc against representative spectrum-based, information retrieval-based, deep learning-based, and LLM-based localization methods. The results show that CoFiLoc outperforms the best-performing baseline by up to 13.2% in terms of Top-1 accuracy and reduces Mean Average Rank (MAR) and Mean First Rank (MFR) by up to 2.9 and 2.3 times, respectively.