学习可能的不变量来解释为什么程序失败
Learning Likely Invariants to Explain Why a Program Fails
摘要:
这是困难的。最近的研究表明,自动缺陷定位技术的实用性有限。原因之一是,程序员通常必须了解为什么程序失败之前修复它。在这项工作中,我们的目标是帮助程序员理解一个错误,自动生成可能的不变量,违反了失败的测试。给定一个初始断言和至少一个未通过断言的测试用例的程序,我们首先生成随机测试用例,通过错误定位来识别潜在的错误位置,然后基于主动学习技术生成程序状态变异,以识别“解释”错误原因的谓词。谓词是通过测试用例和失败测试用例的分类器。我们的主要贡献是应用不变量学习的错误解释,以及一种新的方法来克服缺乏测试用例的问题在实践中。我们将我们的方法应用于现实世界的错误,并显示生成的不变量通常与实际的错误修复相关。
英文摘要:
Debugging is difficult. Recent studies show that automatic bug localization techniques have limited usefulness. One of the reasons is that programmers typically have to understand why the program fails before fixing it. In this work, we aim to help programmers understand a bug by automatically generating likely invariants which are violated in the failed tests. Given a program with an initial assertion and at least one test case failing the assertion, we first generate random test cases, identify potential bug locations through bug localization, and then generate program state mutation based on active learning techniques to identify a predicate "explaining" the cause of the bug. The predicate is a classifier for the passed test cases and failed test cases. Our main contribution is the application of invariant learning for bug explanation, as well as a novel approach to overcome the problem of lack of test cases in practice. We apply our method to real-world bugs and show the generated invariants are often correlated to the actual bug fixes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。