Branching and merging are common practices in collaborative software development, increasing developer's productivity. Despite such benefits, developers need to merge software and resolve merge conflicts. While modern merge techniques can resolve textual conflicts automatically, they fail when the conflict arises at the semantic level. Although semantic merge tools have been proposed, they are usually based on heavyweight static analyses or need explicit specifications of program behavior. In this work, we take a different route and propose SAM (SemAntic Merge), a semantic merge tool based on the automated generation of unit tests that are used as partial specifications. To evaluate SAM's feasibility for detecting conflicts, we perform an empirical study analyzing more than 80 pairs of changes integrated into common class elements from 51 merge scenarios. Furthermore, we also assess how the four unit-test generation tools used by SAM contribute to conflict identification. We propose and assess the adoption of Testability Transformations and Serialization. Our results show that SAM best performs when combining only the tests generated by Differential EvoSuite and EvoSuite and using the proposed Testability Transformations (nine detected conflicts out of 28). These results reinforce previous findings about the potential of using test-case generation to detect test conflicts.
翻译:分支与合并是协作式软件开发中的常见实践,有助于提升开发者的生产力。尽管具有这些优势,开发者仍需合并软件并解决合并冲突。现代合并技术能自动解决文本冲突,但当冲突出现在语义层面时则无法处理。虽然已有语义合并工具被提出,但它们通常基于重量级静态分析或需要程序行为的显式规范。本研究另辟蹊径,提出SAM(语义合并工具),该工具基于自动化生成的单元测试作为部分规范。为评估SAM检测冲突的可行性,我们开展了一项实证研究,分析了来自51个合并场景中集成到公共类元素的80多对变更。此外,我们还评估了SAM使用的四种单元测试生成工具对冲突识别的贡献。我们提出并评估了可测试性变换与序列化方法的采用。结果表明,当仅组合差分EvoSuite和EvoSuite生成的测试并应用所提出的可测试性变换时,SAM表现最佳(在28个冲突中检测出9个)。这些结果进一步印证了之前关于利用测试用例生成检测测试冲突潜力的发现。