kirancodes.me
To Proof Maintenance & Beyond!

Improving refactoring speed by 10X

Jongwook Kim, Don S. Batory, Danny Dig, Maider Azanza

Abstract

Refactoring engines are standard tools in today's Integrated Development Environments (IDEs). They allow programmers to perform one refactoring at a time, but programmers need more. Most design patterns in the Gang-of-Four text can be written as a refactoring script -- a programmatic sequence of refactorings. In this paper, we present R3, a new Java refactoring engine that supports refactoring scripts. It builds a main-memory, non-persistent database to encode Java entity declarations (e.g., packages, classes, methods), their containment relationships, and language features such as inheritance and modifiers. Unlike classical refactoring engines that modify Abstract Syntax Trees (ASTs), R3 refactorings modify only the database; refactored code is produced only when pretty-printing ASTs that reference database changes. R3 performs comparable precondition checks to those of the Eclipse Java Development Tools (JDT) but R3's codebase is about half the size of the JDT refactoring engine and runs an order of magnitude faster. Further, a user study shows that R3 improved the success rate of retrofitting design patterns by 25% up to 50%.

BibTeX
@inproceedings{Kim-al:ICSE16,
  author    = {Jongwook Kim and
               Don S. Batory and
               Danny Dig and
               Maider Azanza},
  title     = {Improving refactoring speed by {10X}},
  booktitle = {ICSE},
  pages     = {1145--1156},
  publisher = {{ACM}},
  year      = {2016},
}

Related papers