Skip to main content
QUICK REVIEW

[Paper Review] Explainable Automated Debugging via Large Language Model-driven Scientific Debugging

Sungmin Kang, Bei Chen|arXiv (Cornell University)|Apr 5, 2023
Software Engineering ResearchComputer Science14 citations
TL;DR

AutoSD uses LLMs to emulate Scientific Debugging with a debugger interface, generating hypotheses and explanations for automated debugging while maintaining competitive repair performance. A human study suggests explanations aid developer decision-making.

ABSTRACT

Automated debugging techniques have the potential to reduce developer effort in debugging, and have matured enough to be adopted by industry. However, one critical issue with existing techniques is that, while developers want rationales for the provided automatic debugging results, existing techniques are ill-suited to provide them, as their deduction process differs significantly from that of human developers. Inspired by the way developers interact with code when debugging, we propose Automated Scientific Debugging (AutoSD), a technique that given buggy code and a bug-revealing test, prompts large language models to automatically generate hypotheses, uses debuggers to actively interact with buggy code, and thus automatically reach conclusions prior to patch generation. By aligning the reasoning of automated debugging more closely with that of human developers, we aim to produce intelligible explanations of how a specific patch has been generated, with the hope that the explanation will lead to more efficient and accurate developer decisions. Our empirical analysis on three program repair benchmarks shows that AutoSD performs competitively with other program repair baselines, and that it can indicate when it is confident in its results. Furthermore, we perform a human study with 20 participants, including six professional developers, to evaluate the utility of explanations from AutoSD. Participants with access to explanations could judge patch correctness in roughly the same time as those without, but their accuracy improved for five out of six real-world bugs studied: 70% of participants answered that they wanted explanations when using repair tools, while 55% answered that they were satisfied with the Scientific Debugging presentation.

Motivation & Objective

  • Motivate explainable automated debugging to align automated reasoning with human debugging processes.
  • Propose AutoSD that uses LLMs to generate hypotheses and debugging experiments via a debugger interface.
  • Demonstrate that AutoSD achieves competitive program repair performance while producing traceable explanations.
  • Evaluate the utility of explanations through a developer-oriented human study.

Proposed method

  • Prompt an LLM with a detailed Scientific Debugging framework to generate hypotheses and corresponding debug experiments.
  • Execute the proposed debugger commands or edit-and-execute scripts to test hypotheses.
  • Use the debugger results to refine hypotheses through Hypothesize-Observe-Conclude iterations until a <DONE> signal or iteration limit is reached.
  • Generate a patch and an explanation that traces intermediate reasoning steps for developer review.
Figure 1 . The pipeline and a real example run of AutoSD , with annotations in black boxes and lightly edited for clarity. Given a detailed description of the scientific debugging concept and a description of the bug (A), AutoSD will generate a hypothesis about what the bug is and construct an exper
Figure 1 . The pipeline and a real example run of AutoSD , with annotations in black boxes and lightly edited for clarity. Given a detailed description of the scientific debugging concept and a description of the bug (A), AutoSD will generate a hypothesis about what the bug is and construct an exper

Experimental results

Research questions

  • RQ1RQ1 Feasibility: Is AutoSD competitive with prior APR techniques while providing explanations?
  • RQ2RQ2 Debugger Ablation: Does the <DONE> token correlate with higher accuracy, and how does predicted debugger output affect performance?
  • RQ3RQ3 Varying LLM: How does AutoSD performance change with different underlying LLMs?
  • RQ4RQ4 Developer Benefit: Do explanations help developers judge patch correctness in a realistic setting?
  • RQ5RQ5 Developer Acceptance: Are explanations acceptable and desirable to developers?

Key findings

  • AutoSD achieves competitive repair performance on three benchmarks (ARHE, Defects4J v1.2/v2.0) compared to baselines, while also providing explanations.
  • The <DONE> token signals higher precision, indicating when AutoSD is likely to produce a correct patch, with debugger-backed results improving reliability.
  • Using larger or more capable LLMs tends to improve AutoSD performance, with ChatGPT as a strong default in experiments.
  • In a human study, explanations improved developers’ accuracy in 5 of 6 real-world bugs and were valued by participants for APR tooling.
  • 70% of participants wanted explanations in APR tools, and 55% were satisfied with the Scientific Debugging presentation.
Figure 2 . Human Study Screen Scheme
Figure 2 . Human Study Screen Scheme

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.