









Abstract:Large Language Models (LLMs) have demonstrated strong performance on code-related tasks, particularly in automated program repair. However, repair effectiveness often depends on accurate upstream fault localization, while the statement-level fault localization capability of LLMs remains insufficiently evaluated. This paper presents a systematic empirical study of LLMs for statement-level fault localization. We evaluate four representative LLMs, including two open-weight models, Qwen2.5-Coder-32B-Instruct and DeepSeek-V3, and two closed-source models, GPT-4.1 mini and Gemini-2.5-Flash, on HumanEval-Java and Defects4J. The evaluation covers different input contexts and prompt strategies, including Zero-shot, Few-shot, and Chain-of-Thought prompting. We further assess model performance from three complementary perspectives: Exact Match, Partial Match, and output consistency, and compare LLMs with representative non-LLM baselines, including PMD and LineDef, under the same source-code-only input setting. In addition, we analyze practical efficiency and cost in terms of end-to-end response time and token-based API cost. The results show that bug report context improves observed fault localization performance on Defects4J; Few-shot prompting improves performance in some cases but does not yield consistent gains; and Chain-of-Thought prompting shows mixed effects across models. Overall, this study reveals the strengths, limitations, and practical trade-offs of LLMs in statement-level fault localization, providing empirical evidence for model selection and application in software engineering practice.
From: Yingjian Xiao [view email]
[v1]
Thu, 23 Oct 2025 13:04:22 UTC (647 KB)
[v2]
Wed, 29 Jul 2026 03:56:56 UTC (2,551 KB)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。