Tool Support for Managing Clone Refactorings to Facilitate Code Review in Evolving Software

Zhiyuan Chen, Maneesh Mohanavilasam, Young Woo Kwon, Myoungkyu Song

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

9 Scopus citations

Abstract

Developers often perform copy-and-paste activities. This practice causes the similar code fragment (aka code clones) to be scattered throughout a code base. Refactoring for clone removal is beneficial, preventing clones from having negative effects on software quality, such as hidden bug propagation and unintentional inconsistent changes. However, recent research has provided evidence that factoring out clones is not always to reduce the risk of introducing defects, and it is often difficult or impossible to remove clones using standard refactoring techniques. To investigate which or how clones can be refactored, developers typically spend a significant amount of their time managing individual clone instances or clone groups scattered across a large code base. To address the problem, this paper presents a technique for managing clone refactorings, Pattern-based clone Refactoring Inspection (PRI), using refactoring pattern templates. By matching the refactoring pattern templates against a code base, it summarizes refactoring changes of clones, and detects the clone instances not consistently factored out as potential anomalies. PRI also provides novel visualization user interfaces specifically designed for inspecting clone refactorings. In the evaluation, PRI analyzes clone instances in six open source projects. It identifies clone refactorings with 94.1% accuracy and detects inconsistent refactorings with 98.4% accuracy. Our results show that PRI should help developers effectively inspect evolving clones and correctly apply refactorings to clone groups.

Original languageEnglish
Title of host publicationProceedings - 2017 IEEE 41st Annual Computer Software and Applications Conference, COMPSAC 2017
EditorsClaudio Demartini, Thomas Conte, Motonori Nakamura, Chung-Horng Lung, Zhiyong Zhang, Kamrul Hasan, Sorel Reisman, Ling Liu, William Claycomb, Hiroki Takakura, Ji-Jiang Yang, Edmundo Tovar, Stelvio Cimato, Sheikh Iqbal Ahamed, Toyokazu Akiyama
PublisherIEEE Computer Society
Pages288-297
Number of pages10
ISBN (Electronic)9781538603673
DOIs
StatePublished - 7 Sep 2017
Event41st IEEE Annual Computer Software and Applications Conference, COMPSAC 2017 - Torino, Italy
Duration: 4 Jul 20178 Jul 2017

Publication series

NameProceedings - International Computer Software and Applications Conference
Volume1
ISSN (Print)0730-3157

Conference

Conference41st IEEE Annual Computer Software and Applications Conference, COMPSAC 2017
Country/TerritoryItaly
CityTorino
Period4/07/178/07/17

Keywords

  • Code clones
  • maintenance
  • refactorings
  • software evolution

Fingerprint

Dive into the research topics of 'Tool Support for Managing Clone Refactorings to Facilitate Code Review in Evolving Software'. Together they form a unique fingerprint.

Cite this