TY - GEN
T1 - Distilling useful clones by contextual differencing
AU - Xing, Zhenchang
AU - Xue, Yinxing
AU - Jarzabek, Stan
PY - 2013
Y1 - 2013
N2 - Clone detectors find similar code fragments and report large numbers of them for large systems. Textually similar clones may perform different computations, depending on the program context in which clones occur. Understanding these contextual differences is essential to distill useful clones for a specific maintenance task, such as refactoring. Manual analysis of contextual differences is time consuming and error-prone. To mitigate this problem, we present an automated approach to helping developers find and analyze contextual differences of clones. Our approach represents context of clones as program dependence graphs, and applies a graph differencing technique to identify required contextual differences of clones. We implemented a tool called CloneDifferentiator that identifies contextual differences of clones and allows developers to formulate queries to distill candidate clones that are useful for a given refactoring task. Two empirical studies show that CloneDifferentiator can reduce the efforts of post-detection analysis of clones for refactorings.
AB - Clone detectors find similar code fragments and report large numbers of them for large systems. Textually similar clones may perform different computations, depending on the program context in which clones occur. Understanding these contextual differences is essential to distill useful clones for a specific maintenance task, such as refactoring. Manual analysis of contextual differences is time consuming and error-prone. To mitigate this problem, we present an automated approach to helping developers find and analyze contextual differences of clones. Our approach represents context of clones as program dependence graphs, and applies a graph differencing technique to identify required contextual differences of clones. We implemented a tool called CloneDifferentiator that identifies contextual differences of clones and allows developers to formulate queries to distill candidate clones that are useful for a given refactoring task. Two empirical studies show that CloneDifferentiator can reduce the efforts of post-detection analysis of clones for refactorings.
KW - Clone analysis
KW - graph matching
KW - program dependence graph
UR - http://www.scopus.com/inward/record.url?scp=84893379503&partnerID=8YFLogxK
U2 - 10.1109/WCRE.2013.6671285
DO - 10.1109/WCRE.2013.6671285
M3 - Conference contribution
SN - 9781479929313
T3 - Proceedings - Working Conference on Reverse Engineering, WCRE
SP - 102
EP - 111
BT - Proceedings - 20th Working Conference on Reverse Engineering, WCRE 2013
T2 - 20th Working Conference on Reverse Engineering, WCRE 2013
Y2 - 14 October 2013 through 17 October 2013
ER -