Improving Refactoring Speed by 10X
Improving Refactoring Speed by 10X
复制标题
DOI:
10.1145/2884781.2884802
复制
发表时间:
2016-05
期刊:
影响因子:
--
通讯作者:
Jongwook Kim;D. Batory;Danny Dig;Maider Azanza
中科院分区:
文献类型:
--
作者:
Jongwook Kim;D. Batory;Danny Dig;Maider Azanza
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%.