Conference Proceeding Article
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%.
Refactoring Detection, Software Evolution, Vector-based Code Representation
Computer Sciences | Software Engineering
Software and Cyber-Physical Systems
22nd ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE 2014): Proceedings: November 16-21, 2014, Hong Kong, China
City or Country
MILEA, Narcisa Andreea; JIANG, Lingxiao; and KHOO, Siau-Cheng.
Vector Abstraction and Concretization for Scalable Detection of Refactorings. (2014). 22nd ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE 2014): Proceedings: November 16-21, 2014, Hong Kong, China. 86-97. Research Collection School Of Information Systems.
Available at: http://ink.library.smu.edu.sg/sis_research/2643
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 4.0 License.