Detecting Build Conflicts in Software Merge for Java Programs via Static Analysis

Detecting Build Conflicts in Software Merge for Java Programs via Static Analysis
复制标题

DOI:
10.1145/3551349.3556950
复制
发表时间:
2022-10
期刊:
Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering
影响因子:
--
通讯作者:
Sheikh Shadab Towqir;Bowen Shen;Muhammad Ali Gulzar;Na Meng
Sheikh Shadab Towqir;Bowen Shen;Muhammad Ali Gulzar;Na Meng
中科院分区:
其他
文献类型:
--
作者:
Sheikh Shadab Towqir;Bowen Shen;Muhammad Ali Gulzar;Na Meng

文献摘要

相似文献

在软件合并中,来自不同分支的编辑可以在文本上重叠(即,文本冲突)或导致构建和测试错误(即,构建和测试冲突),危及程序员的生产力和软件质量。现有的工具主要关注文本冲突;很少有工具检测高阶冲突(即,构建和测试冲突)。然而,现有的构建冲突检测器是有限的。由于它们大量使用自动构建,当前检测器(例如,Crystal)只报告构建错误,而不是确定根本原因;开发人员必须手动定位冲突的编辑。这些检测器只在要合并的分支没有文本冲突时才有帮助。我们提出了一种新的静态分析为基础的方法Bucond(“构建冲突检测器”)。给定合并场景中的三个代码版本:base B、left l和right r,Bucond将每个版本建模为图,并比较图以提取实体相关的编辑(例如,类重命名)中的L和R。我们认为,当某些编辑共同应用于分支之间的相关实体时,就会发生构建冲突。Bucond通过模式匹配来识别任何可能触发构建冲突的跨分支编辑组合(例如,一个分支添加对字段F的引用,而另一个分支移除F)。我们系统地探索和设计了57种模式,涵盖了我们实验中97%的构建冲突。我们的评估显示Bucond可以补充基于构建的检测器,因为它(1)以100%的准确率和88%-100%的召回率检测冲突,(2)定位冲突编辑,(3)当这些检测器不工作时工作良好。
In software merge, the edits from different branches can textually overlap (i.e., textual conflicts) or cause build and test errors (i.e., build and test conflicts), jeopardizing programmer productivity and software quality. Existing tools primarily focus on textual conflicts; few tools detect higher-order conflicts (i.e., build and test conflicts). However, existing detectors of build conflicts are limited. Due to their heavy usage of automatic build, current detectors (e.g., Crystal) only report build errors instead of identifying the root causes; developers have to manually locate conflicting edits. These detectors only help when the branches-to-merge have no textual conflict. We present a new static analysis-based approach Bucond (“build conflict detector”). Given three code versions in a merging scenario: base b, left l, and right r, Bucond models each version as a graph, and compares graphs to extract entity-related edits (e.g., class renaming) in l and r. We believe that build conflicts occur when certain edits are co-applied to related entities between branches. Bucond realizes this insight via pattern matching to identify any cross-branch edit combination that can trigger build conflicts (e.g., one branch adds a reference to field F while the other branch removes F). We systematically explored and devised 57 patterns, covering 97% of the build conflicts in our experiments. Our evaluation shows Bucond to complement build-based detectors, as it (1) detects conflicts with 100% precision and 88%–100% recall, (2) locates conflicting edits, and (3) works well when those detectors do not.