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.
翻译:自动化调试技术有望降低开发者的调试工作量,且已成熟到可被工业界采用。然而,现有技术的一个关键问题是:开发者希望获得自动调试结果的合理解释,但现有技术难以提供此类解释,因其推理过程与人类开发者存在显著差异。受开发者在调试时与代码交互方式的启发,我们提出了自动化科学调试(AutoSD)技术。该技术针对有缺陷代码和揭示缺陷的测试用例,通过提示大语言模型自动生成假设,利用调试器主动与缺陷代码交互,从而在补丁生成前自动得出结论。通过使自动化调试的推理过程更贴近人类开发者,我们旨在生成关于特定补丁如何生成的可理解解释,期望这种解释能促使开发者做出更高效、更准确的决策。我们在三个程序修复基准上的实证分析表明,AutoSD与其他程序修复基线方法相比具有竞争力,并能指示其结果的置信度。此外,我们进行了一项包含20名参与者(含6名专业开发者)的人机研究,以评估AutoSD解释的实用性。能够获取解释的参与者在判断补丁正确性方面与无解释组所用时间大致相同,但在所研究的六个真实世界错误中,其判断准确性在五个上有所提升:70%的参与者表示在使用修复工具时希望获得解释,而55%的参与者表示对科学调试(Scientific Debugging)的呈现方式感到满意。