Download PDFOpen PDF in browserCurrent version

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

EasyChair Preprint 1278, version 1

Versions: 12history
13 pagesDate: July 11, 2019

Abstract

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

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