Detecting refactored clones

  • Authors:
  • Mati Shomrat;Yishai A. Feldman

  • Affiliations:
  • Blavatnik School of Computer Science, Tel Aviv University, Israel;IBM Research --- Haifa, Israel

  • Venue:
  • ECOOP'13 Proceedings of the 27th European conference on Object-Oriented Programming
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The availability of automated refactoring tools in modern development environments allows programmers to refactor their code with ease. Such tools, however, enable developers to inadvertently create code clones that quickly diverge in form but not in meaning. Furthermore, in the hands of those looking to confuse plagiarism-detection tools, automated refactoring may be abused to avoid discovery of copied code. We present Cider, an algorithm that can detect code clones regardless of various refactorings that may have been applied to some of the copies but not to others. Most significant is the ability to discover interprocedural clones, where parts of one copy have been extracted to separate methods. We evaluated Cider on several open-source Java projects, attempting to detect interprocedural clones between successive versions of each project. Interprocedural clones were detected in all evaluated projects, demonstrating the pervasive nature of the problem. Compared to a manual assessment, Cider performed well in terms of both recall and precision.