arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1506.01883cs.SE
收藏

利用自动测试套件重构改进动态分析

Dynamic Analysis can be Improved with Automatic Test Suite Refactoring

Jifeng Xuan, Benoit Cornu, Matias Martinez, Benoit Baudry, Lionel Seinturier, Martin Monperrus

摘要:

上下文:开发人员设计测试套件来自动验证软件是否满足其预期行为。许多动态分析技术都是利用测试用例中的执行痕迹进行分析的。然而,在实践中,只有一个跟踪是由一个手动编写的测试用例的执行产生的。目的:本文提出了一种新的测试用例重构技术,称为B-重构。B-重构背后的思想是将测试用例分割成小的测试片段,这些测试片段覆盖控制流的更简单部分,以便为动态分析提供更好的支持。方法:对于一个给定的动态分析技术,我们的测试套件重构方法监测测试用例的执行,并确定小的测试用例,而不损失的测试能力。我们应用B-重构,以协助两个现有的分析任务:自动修复的if语句错误和自动分析的异常合同。结果:实验结果表明,测试集重构可以有效地简化测试集的执行痕迹。三个现实世界的错误,以前不能修复与原始测试套件后,应用B-重构修复;同时,异常合同更好地验证通过应用B-重构到原始测试套件。结论:应用B-重构可以有效地提高测试用例的纯度。现有的动态分析任务可以通过测试套件重构来增强。

英文摘要:

Context: Developers design test suites to automatically verify that software meets its expected behaviors. Many dynamic analysis techniques are performed on the exploitation of execution traces from test cases. However, in practice, there is only one trace that results from the execution of one manually-written test case. Objective: In this paper, we propose a new technique of test suite refactoring, called B-Refactoring. The idea behind B-Refactoring is to split a test case into small test fragments, which cover a simpler part of the control flow to provide better support for dynamic analysis. Method: For a given dynamic analysis technique, our test suite refactoring approach monitors the execution of test cases and identifies small test cases without loss of the test ability. We apply B-Refactoring to assist two existing analysis tasks: automatic repair of if-statements bugs and automatic analysis of exception contracts. Results: Experimental results show that test suite refactoring can effectively simplify the execution traces of the test suite. Three real-world bugs that could previously not be fixed with the original test suite are fixed after applying B-Refactoring; meanwhile, exception contracts are better verified via applying B-Refactoring to original test suites. Conclusions: We conclude that applying B-Refactoring can effectively improve the purity of test cases. Existing dynamic analysis tasks can be enhanced by test suite refactoring.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑