通过逻辑推理识别空指针异常的根本原因
Identifying Root Causes of Null Pointer Exceptions with Logical Inferences
AI总结:
针对基于LLM的故障定位技术依赖LLM导致的不可靠、成本高及难分析问题,提出LogicFL逻辑故障定位技术,通过逻辑推理模拟人类演绎过程识别NPE根本原因,在76个NPE bug上实现88.16%的准确率,成本效率显著优于LLM-based技术且过程可追溯。
摘要:
近年来,基于大型语言模型(LLM)的故障定位(FL)技术被提出,其在FL结果的解释方面表现出性能提升。然而,基于LLM的FL技术存在一个主要问题:严重依赖LLM,而LLM通常不可靠、成本高昂且难以分析或改进。当结果不理想时,确定原因和优化技术以获得更好结果都具有挑战性。为解决这一问题,我们提出LogicFL,一种针对空指针异常(NPEs)的新型逻辑故障定位技术。通过逻辑编程,LogicFL模拟人类开发者的故障定位演绎过程,并对收集的故障代码和测试执行事实进行逻辑推理后识别NPE的原因。在对Apache Commons项目和Defects4J基准中的76个NPE bug的实证评估中,LogicFL准确识别了67个bug(88.16%)的故障位置并精确定位了导致NPE的代码片段,分别比两种对比的基于LLM的FL技术多识别19.64%和4.69%的bug。此外,LogicFL可在类似典型笔记本电脑的低性能机器上执行,平均运行时间为21.63秒,最坏情况下不到两分钟,包括测试执行和输出文件生成。而且,与使用GPT-4o模型的两种基于LLM的FL技术相比,LogicFL的成本效率显著更高,这两种技术的成本分别是LogicFL的343.94倍和3736.19倍。最后但同样重要的是,LogicFL中提供FL结果的演绎过程完全可追溯,使我们能够理解技术结果背后的推理并进一步增强该技术。
英文摘要:
Recently, Large Language Model (LLM)-based Fault Localization (FL) techniques have been proposed, and showed improved performance with explanations on FL results. However, a major issue with LLM-based FL techniques is their heavy reliance on LLMs, which are often unreliable, expensive, and difficult to analyze or improve. When results are unsatisfactory, it is challenging both to determine a cause and to refine a technique for better outcomes. To address this issue, we propose LogicFL, a novel logical fault localization technique for Null Pointer Exceptions (NPEs). With logic programming, LogicFL imitates human developers' deduction process of fault localization, and identifies causes of NPEs after logical inferences on collected facts about faulty code and test execution. In an empirical evaluation of 76 NPE bugs from Apache Commons projects and the Defects4J benchmark, LogicFL accurately identified the fault locations and pinpointed the exact code fragments causing the NPEs for 67 bugs (88.16%), which were 19.64% and 4.69% more bugs than two compared LLM-based FL techniques respectively. In addition, LogicFL can be executed on a low-performance machine similar to a typical laptop, with an average runtime of 21.63 seconds and a worst-case time of under two minutes, including test execution and output file generation. Moreover, when compared to the two LLM-based FL techniques using the GPT-4o model, LogicFL was significantly more cost-efficient, as those techniques required 343.94 and 3,736.19 times the cost of LogicFL, respectively. Last but not least, the deduction process in LogicFL for providing FL results is fully traceable, enabling us to understand the reasoning behind the technique's outcomes and to further enhance the technique.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。