Using acceptance tests to predict merge conflict risk
Abstract:
The occurrence of merge conflicts might impair software development. Developers might reduce conflicts by avoiding to perform tasks that change the same files in parallel. As predicting the set of files changed by a task is hard, we use the TAITI tool to compute task interfaces (an approximation of the changed files set). Such a tool takes as input a set of automated acceptance tests that validate the expected behavior of each task, assuming a BDD (Behaviour-Driven Development) context, in which tests guide code development. We measure the conflict risk between tasks as the intersection among its interfaces. To assess the predictions of conflict risk, we measure precision and recall of 6,360 task pairs from 19 Rails projects on GitHub. Our results confirm that Cucumber tests might help to predict the risk of merge conflicts, given the intersection among interfaces denotes a higher probability that the tasks change some file in common. A minimal intersection predicts conflict risk with 0.59 of precision and 0.98 of recall. Also, the higher the intersection size, the higher the number of files changed by both tasks. This way, developers might use the intersection size between TestI as a degree of conflict risk between tasks, prioritizing the selection of a task to work on whose TestI has the lowest intersection with others. Finally, a predictor of conflict risk based on TestI outperforms a predictor based on similar past tasks. Regardless of promising results, sometimes the intersection among interfaces does not guess the conflicting files.
Study Setup
- Script for mining projects and extracting tasks
- Script for computing TestI (TAITI)
- Script for computing TextI
- Script for generating predictions of merge conflict risk
- Task pair sample
Evaluation Results
- Interfaces and predictions of merge conflict risk
- RQ1: Are tasks with non disjoint TestI interfaces associated with higher merge conflict risk?
- RQ2: How often does TestI predict conflict risk between two tasks?
- RQ3: Is the size of the intersection between two TestI interfaces proportional to the number of files changed in common by the corresponding tasks?
- RQ4: Is TestI a better predictor of conflict risk than TextI?
- Other results