Download PDFOpen PDF in browserCurrent version

Towards Automated Refactoring of Code Clones in Object-Oriented Programming Languages

EasyChair Preprint no. 1278, version 1

Versions: 12history
13 pagesDate: July 11, 2019


Duplication in source code can have a major negative impact on the maintainability of source code, as it creates implicit dependencies between fragments of code. Such implicit dependencies often cause bugs and increase maintenance efforts. In this study, we look into the opportunities to automatically refactor these duplication problems for object-oriented programming languages. We propose a method to detect clones that are suitable for refactoring. This method focuses on the context and scope of clones, ensuring our refactoring improves the design and does not create side effects.

Our intermediate results indicate that more than half of the duplication in code is related to each other through inheritance, making it easier to refactor these clones in a clean way. About 40 percent of the duplication can be refactored through method extraction, while other clones require other refactoring techniques or further transformations. Future measurements will provide further insight into what clones should be refactored to improve the design of software systems.

Keyphrases: automatic refactoring, Clone Class, clone detection, clone detection tool, Clone Refactoring, Clone type, clone type definition, code clone, code clone detection, Code Clones, duplicated code refactoring advisor, duplication, Java, Maintainability, Method extraction, metrics, modern clone detection tool, object-oriented language, object-oriented programming, object-oriented programming language, OOP, open source, refactoring opportunity, refactoring technique, Software clone, Software Engineering

BibTeX entry
BibTeX does not have the right entry for preprints. This is a hack for producing the correct reference:
  author = {Simon Baars and Ana Oprescu},
  title = {Towards Automated Refactoring of Code Clones in Object-Oriented Programming Languages},
  howpublished = {EasyChair Preprint no. 1278},

  year = {EasyChair, 2019}}
Download PDFOpen PDF in browserCurrent version