프로그램 병합을 위한 자동화된 회귀 단위 테스트 생성
Automated Regression Unit Test Generation for Program Merges
Automated Regression Unit Test Generation for Program Merges
@misc{ji2020automated,
title = {Automated Regression Unit Test Generation for Program Merges},
author = {Tao Ji and Liqian Chen and Xiaoguang Mao and Xin Yi and Jiahong Jiang},
year = {2020},
eprint = {2003.00154},
archivePrefix = {arXiv},
primaryClass = {cs.SE},
url = {https://arxiv.org/abs/2003.00154}
}
Ji, T., Chen, L., Mao, X., Yi, X., & Jiang, J. (2020). Automated Regression Unit Test Generation for Program Merges [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2003.00154
JI T, CHEN L, MAO X, et al. Automated Regression Unit Test Generation for Program Merges[EB/OL]. (2020-02-29)[2026-11-29]. https://arxiv.org/abs/2003.00154.
초록
기존 브랜치를 현재 작업 브랜치에 병합하는 것은 협업 소프트웨어 개발에서 흔한 현상이지만, 개발자들은 여전히 복잡한 병합 작업을 처리하기 위해 텍스트 기반 병합 도구에 크게 의존하고 있다. 잠재적 의미 병합 충돌은 감지되지 않고 소프트웨어 품질을 저하시킬 수 있다. 회귀 테스트는 회귀 결함을 방지할 수 있으며 실제 세계의 소프트웨어 개발에서 널리 사용되고 있다. 그러나 기존 전체 테스트 스위트 를 재실행하여 병합된 소프트웨어를 잘 검증하는 것은 어려울 수 있다. 직관적으로, 테스트 스위트 가 다른 브랜치의 변경 사항을 동시에 커버하지 못하면 병합 충돌이 감지되지 못할 것이다. 최근에는 3-way 병합에 대한 검증이 제안되었으나, 이 접근법은 프로그램의 다른 부분에 다른 변경 사항이 적용된 것과 같은 일반적인 경우조차도 지원하지 않는다. 본 논문에서는 제안된 테스트 오라클에 따라 프로그램 병합을 확인하기 위한 회귀 단위 테스트 생성 접근법을 제안한다. 우리의 일반적 테스트 오라클은 3-way 병합뿐만 아니라 2-way 병합과 octopus 병합도 검증할 수 있게 한다. 프로젝트의 변경된 방법 외에도 충돌이 다른 위치에서 발생할 수 있으므로, 전체 프로젝트의 의존성 분석을 기반으로 UUT 를 선택하는 알고리즘을 설계한다. 이 기반 위에서 우리는 Java 프로그램 병합을 위한 단위 테스트를 생성하는 도구를 TOM 으로 구현한다. 또한 해당 주제에 대한 추가 연구를 용이하게 하기 위해 389 개의 충돌 3-way 병합과 389 개의 충돌 octopus 병합으로 구성된 벤치마크 MCon4J 를 설계한다. 실험 결과는 TOM 이 45 개의 충돌 3-way 병합과 87 개의 충돌 octopus 병합을 찾았으며, 검증 기반 도구는 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.