Detecting Differences across Multiple Instances of Code Clones

Author(s): Yun Lin, Zhenchang Xing, Yinxing Xue, Yang Liu, Xin Peng, Jun Sun, Wenyun Zhao
Venue: Proceedings of the 36th International Conference on Software Engineering
Date: 2014

Type of Experiement: Controlled Experiment
Sample Size: 18
Class/Experience Level: Graduate Student
Data Collection Method: Observation


In large software systems code clones can become difficult to maintain or change. Current tools compare two pieces of code at a time to show the differences between them. Manually comparing all of the code clones in a system can become a lot of work and the authors are trying to solve this problem. The authors created an algorithm to compare many code clones at once called MCIDiff.

In order to test MCIDiff’s effectiveness, they compared 18 graduate students divided into 2 groups results from the study. One group was only allowed to use CloneDetective, a code clone tool that allows the user to compare two pieces of code. The other group used MCIDiff to compare code clones. The subjects had to decide if the code was refactorable and provide the reasoning behind their decision. Two judges who did not know which group each subject was from gave scores based on the reasoning and the decision. Overall, MCIDiff was shown to yield higher scores and allowed the subjects to finish the task faster than the group using CloneDetective.

This new tool will help developers refactor code and might also allow for changing code in multiple places at one time. The authors think there might also be a use in revision control for multiple conflicts happening at once.