论文标题

自动回归单元测试生成程序合并

Automated Regression Unit Test Generation for Program Merges

论文作者

Ji, Tao, Chen, Liqian, Mao, Xiaoguang, Yi, Xin, Jiang, Jiahong

论文摘要

将其他分支合并到当前的工作分支中很常见在协作软件开发中。但是,开发人员仍然在很大程度上依靠文本合并工具来处理复杂的合并任务。潜在的语义合并冲突可能无法检测到并降低软件质量。回归测试能够防止回归故障,并已广泛用于现实世界软件开发中。但是,合并的软件可能无法通过重新研究现有的整个测试套件来很好地检查。直观地,如果测试套件未能同时涵盖不同分支的更改,则将无法检测到合并冲突。最近,有人提议对3向合并进行验证,但是这种方法甚至不支持某些常见案例,例如对程序的不同部分进行的不同更改。在本文中,我们提出了一种回归单元测试生成的方法,专门根据我们提议的测试甲壳进行检查。我们的一般测试Oracles不仅支持我们检查三路合并,还要检查2路和章鱼合并。考虑到其他位置可能会发生冲突,除了更改项目的方法,我们设计了一种算法来根据整个项目的依赖关系分析选择UUTS。在此基础上,我们实施了一种名为TOM的工具,以生成Java程序合并的单元测试。我们还设计了由389个冲突3向合并和389冲突章鱼合并的基准MCON4J,以促进有关该主题的进一步研究。实验结果表明,汤姆(Tom)发现45个冲突3-方法合并和87个冲突章鱼合并,而基于验证的工具则无法在MCON4J上使用。

Merging other branches into the current working branch is common in collaborative software development. However, developers still heavily rely on the textual merge tools to handle the complicated merge tasks. The latent semantic merge conflicts may fail to be detected and degrade the software quality. Regression testing is able to prevent regression faults and has been widely used in real-world software development. However, the merged software may fail to be well examined by rerunning the existing whole test suite. Intuitively, if the test suite fails to cover the changes of different branches at the same time, the merge conflicts would fail to be detected. Recently, it has been proposed to conduct verification on 3-way merges, but this approach does not support even some common cases such as different changes made to different parts of the program. In this paper, we propose an approach of regression unit test generation specifically for checking program merges according to our proposed test oracles. And our general test oracles support us to examine not only 3-way merges, but also 2-way and octopus merges. Considering the conflicts may arise in other locations besides changed methods of the project, we design an algorithm to select UUTs based on the dependency analysis of the whole project. On this basis, we implement a tool called TOM to generate unit tests for Java program merges. We also design the benchmark MCon4J consisting of 389 conflict 3-way merges and 389 conflict octopus merges to facilitate further studies on this topic. The experimental results show that TOM finds 45 conflict 3- way merges and 87 conflicts octopus merges, while the verification based tool fails to work on MCon4J.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源