Publication Type

Conference Proceeding Article

Version

publishedVersion

Publication Date

11-2014

Abstract

Automated techniques have been proposed to either identify refactoring opportunities (i.e., code fragments that can be but have not yet been restructured in a program), or reconstruct historical refactorings (i.e., code restructuring operations that have happened between different versions of a program). In this paper, we propose a new technique that can detect both refactoring opportunities and historical refactorings in large code bases. The key of our technique is the design of vector abstraction and concretization operations that can encode code changes induced by certain refactorings as characteristic vectors. Thus, the problem of identifying refactorings can be reduced to the problem of identifying matching vectors, which can be solved efficiently. We have implemented our technique for Java. The prototype is applied to 200 bundle projects from the Eclipse ecosystem containing 4.5 million lines of code, and reports in total more than 32K instances of 17 types of refactoring opportunities, taking 25 minutes on average for each type. The prototype is also applied to 14 versions of 3 smaller programs (JMeter, Ant, XML-Security), and detects (1) more than 2.8K refactoring opportunities within individual versions with a precision of about 87%, and (2) more than 190 historical refactorings across consecutive versions of the programs with a precision of about 92%.

Keywords

Refactoring Detection, Software Evolution, Vector-based Code Representation

Discipline

Computer Sciences | Software Engineering

Research Areas

Software and Cyber-Physical Systems

Publication

22nd ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE 2014): Proceedings: November 16-21, 2014, Hong Kong, China

First Page

86

Last Page

97

ISBN

9781450330565

Identifier

10.1145/2635868.2635926

Publisher

ACM

City or Country

New York

Additional URL

http://dx.doi.org/10.1145/2635868.2635926

Share

COinS