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

一种在持续集成中检测提交行为变更的方法与基准

An Approach and Benchmark to Detect Behavioral Changes of Commits in Continuous Integration

Benjamin Danglot, Martin Monperrus, Walter Rudametkin, Benoit Baudry

AI总结:

本研究提出名为DCI的自动化方法,通过断言扩增和基于搜索的输入空间探索生成测试变体,以检测CI中提交的行为变更,构建了首个真实行为变更数据集并验证了方法有效性,同时指出其适用范围局限。

摘要:

当开发者向应用代码库推送变更时,良好的实践是编写指定该行为变更的测试用例。得益于持续集成(CI),测试会在后续提交上运行,以检查这些提交不会引入该行为的回归问题。本文提出一种检测提交中行为变更的方法。该方法以一个程序、其测试套件和一次提交作为输入,输出一组能够捕获程序提交前版本与提交后版本之间行为差异的测试方法。我们将该方法命名为DCI(Detecting behavioral changes in CI,CI中行为变更检测)。它通过两种方式生成现有测试用例的变体:(i)断言扩增,以及(ii)基于搜索的输入空间探索。我们在来自6个开源Java项目的60个精心整理的提交上评估了该方法。据我们所知,这是首个精心整理的真实世界行为变更数据集。评估结果表明,DCI能够生成可检测行为变更的测试方法。该方法完全自动化,可集成到当前的开发流程中。其主要局限性在于仅针对单元测试,且仅适用于相对少部分的提交。更具体地说,DCI适用于存在已执行修改代码的单元测试的提交。在实践中,从我们的基准项目中发现,有15.29%的提交满足DCI所需的条件。

英文摘要:

When a developer pushes a change to an application's codebase, a good practice is to have a test case specifying this behavioral change. Thanks to continuous integration (CI), the test is run on subsequent commits to check that they do no introduce a regression for that behavior. In this paper, we propose an approach that detects behavioral changes in commits. As input, it takes a program, its test suite, and a commit. Its output is a set of test methods that capture the behavioral difference between the pre-commit and post-commit versions of the program. We call our approach DCI (Detecting behavioral changes in CI). It works by generating variations of the existing test cases through (i) assertion amplification and (ii) a search-based exploration of the input space. We evaluate our approach on a curated set of 60 commits from 6 open source Java projects. To our knowledge, this is the first ever curated dataset of real-world behavioral changes. Our evaluation shows that DCI is able to generate test methods that detect behavioral changes. Our approach is fully automated and can be integrated into current development processes. The main limitations are that it targets unit tests and works on a relatively small fraction of commits. More specifically, DCI works on commits that have a unit test that already executes the modified code. In practice, from our benchmark projects, we found 15.29% of commits to meet the conditions required by DCI.

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

↑