TY - JOUR
T1 - Detecting differences across multiple instances of code clones
AU - Lin, Yun
AU - Xing, Zhenchang
AU - Xue, Yinxing
AU - Liu, Yang
AU - Peng, Xin
AU - Sun, Jun
AU - Zhao, Wenyun
N1 - Publisher Copyright:
© 2014 ACM.
PY - 2014/5/31
Y1 - 2014/5/31
N2 - Clone detectors find similar code fragments (i.e., instances of code clones) and report large numbers of them for industrial systems. To maintain or manage code clones, developers often have to investigate differences of multiple cloned code fragments. However,existing program differencing techniques compare only two code fragments at a time. Developers then have to manually combine several pairwise differencing results. In this paper, we present an approach to automatically detecting differences across multiple clone instances. We have implemented our approach as an Eclipse plugin and evaluated its accuracy with three Java software systems. Our evaluation shows that our algorithm has precision over 97.66% and recall over 95.63% in three open source Java projects. We also conducted a user study of 18 developers to evaluate the usefulness of our approach for eight clone-related refactoring tasks. Our study shows that our approach can significantly improve developersperformance in refactoring decisions, refactoring details, and task completion time on clone-related refactoring tasks. Automatically detecting differences across multiple clone instances also opens opportunities for building practical applications of code clones in software maintenance, such as auto-generation of application skeleton, intelligent simultaneous code editing.
AB - Clone detectors find similar code fragments (i.e., instances of code clones) and report large numbers of them for industrial systems. To maintain or manage code clones, developers often have to investigate differences of multiple cloned code fragments. However,existing program differencing techniques compare only two code fragments at a time. Developers then have to manually combine several pairwise differencing results. In this paper, we present an approach to automatically detecting differences across multiple clone instances. We have implemented our approach as an Eclipse plugin and evaluated its accuracy with three Java software systems. Our evaluation shows that our algorithm has precision over 97.66% and recall over 95.63% in three open source Java projects. We also conducted a user study of 18 developers to evaluate the usefulness of our approach for eight clone-related refactoring tasks. Our study shows that our approach can significantly improve developersperformance in refactoring decisions, refactoring details, and task completion time on clone-related refactoring tasks. Automatically detecting differences across multiple clone instances also opens opportunities for building practical applications of code clones in software maintenance, such as auto-generation of application skeleton, intelligent simultaneous code editing.
KW - Code clone
KW - Human study
KW - Program differencing
UR - http://www.scopus.com/inward/record.url?scp=84994181482&partnerID=8YFLogxK
U2 - 10.1145/2568225.2568298
DO - 10.1145/2568225.2568298
M3 - Conference article
AN - SCOPUS:84994181482
SN - 0270-5257
SP - 164
EP - 174
JO - Proceedings - International Conference on Software Engineering
JF - Proceedings - International Conference on Software Engineering
IS - 1
T2 - 36th International Conference on Software Engineering, ICSE 2014
Y2 - 31 May 2014 through 7 June 2014
ER -