pith. sign in

arxiv: 2403.10507 · v1 · pith:R2PNSNYInew · submitted 2024-03-15 · 💻 cs.SE

Demystifying Faulty Code with LLM: Step-by-Step Reasoning for Explainable Fault Localization

classification 💻 cs.SE
keywords faultcodelocalizationexplanationsfaultyreasoningdatasetelements
0
0 comments X
read the original abstract

Fault localization is a critical process that involves identifying specific program elements responsible for program failures. Manually pinpointing these elements, such as classes, methods, or statements, which are associated with a fault is laborious and time-consuming. To overcome this challenge, various fault localization tools have been developed. These tools typically generate a ranked list of suspicious program elements. However, this information alone is insufficient. A prior study emphasized that automated fault localization should offer a rationale. In this study, we investigate the step-by-step reasoning for explainable fault localization. We explore the potential of Large Language Models (LLM) in assisting developers in reasoning about code. We proposed FuseFL that utilizes several combinations of information to enhance the LLM results which are spectrum-based fault localization results, test case execution outcomes, and code description (i.e., explanation of what the given code is intended to do). We conducted our investigation using faulty code from Refactory dataset. First, we evaluate the performance of the automated fault localization. Our results demonstrate a more than 30% increase in the number of successfully localized faults at Top-1 compared to the baseline. To evaluate the explanations generated by FuseFL, we create a dataset of human explanations that provide step-by-step reasoning as to why specific lines of code are considered faulty. This dataset consists of 324 faulty code files, along with explanations for 600 faulty lines. Furthermore, we also conducted human studies to evaluate the explanations. We found that for 22 out of the 30 randomly sampled cases, FuseFL generated correct explanations.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 3 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Towards Agentic Runtime Healing

    cs.SE 2024-08 unverdicted novelty 7.0

    Healer uses LLMs to dynamically generate and execute runtime error-handling code, with GPT-4 recovering from 72.8% of errors across four datasets.

  2. Towards Better Linux Kernel Fault Localization: Leveraging Contrastive Reasoning and Hierarchical Context Analysis

    cs.SE 2026-07 unverdicted novelty 6.0

    CoHiKer improves Top-1 fault localization accuracy in the Linux kernel by up to 26% at file level and 57% at method level over prior LLM baselines via contrastive reasoning and hierarchical context analysis.

  3. SieveFL: Hierarchical Runtime-Aware Pruning for Scalable LLM-Based Fault Localization

    cs.SE 2026-05 conditional novelty 6.0

    SieveFL combines vector retrieval and JaCoCo runtime pruning to cut LLM token use by 49% while achieving 41.8% Top-1 accuracy on 395 Defects4J bugs, outperforming AgentFL.