Int J Performability Eng ›› 2018, Vol. 14 ›› Issue (7): 1493-1502.doi: 10.23940/ijpe.18.07.p13.14931502

• Original articles • Previous Articles     Next Articles

Context-Aware Automatic Code Segment Extraction and Refactoring in Object-Oriented Systems

Wei Liua, Xindi Huanga, Zhigang Hub, and Hong Phong Nguyenc   

  1. aSchool of Informatics, Hunan University of Chinese Medicine, Hunan, 410208, China
    bSchool of Software, Central South University, Hunan, 410075, China
    cFaculty of Civil Engineering, University of Transport and Communications, Hanoi, 100000, Vietnam

Abstract:

Refactoring is a very important technology to improve the reusability and maintainability of existing code, and it is widely used in software development. In order to extract the code segment into a new method easily and cover the shortage of Eclipse in refactoring, the method of Context-Aware Automatic Code Segment Extraction and Refactoring (CAACSER) is proposed. By analyzing the context of the code, the input parameter class, and the output parameter class are introduced to handle complex code segments. The experimental results show that the CAACSER effectively solves some problems and drawbacks of many existing tools in code segment extraction, which acts as a basic step for realizing automatic and semi-automatic refactoring methods. The visualization tool of CAACSER can also carry out reasonable optimizations of the code without changing the systems’ behaviors.


Submitted on March 29, 2018; Revised on April 27, 2018; Accepted on May 23, 2018
References: 16