Issue No.08 - Aug. (2013 vol.39)
Hui Liu , Beijing Institute of Technology, Beijing
Xue Guo , Beijing Institute of Technology, Beijing
Weizhong Shao , Peking University, Beijing
DOI Bookmark: http://doi.ieeecomputersociety.org/10.1109/TSE.2013.4
Software refactoring is an effective method for improvement of software quality while software external behavior remains unchanged. To facilitate software refactoring, a number of tools have been proposed for code smell detection and/or for automatic or semi-automatic refactoring. However, these tools are passive and human driven, thus making software refactoring dependent on developers' spontaneity. As a result, software engineers with little experience in software refactoring might miss a number of potential refactorings or may conduct refactorings later than expected. Few refactorings might result in poor software quality, and delayed refactorings may incur higher refactoring cost. To this end, we propose a monitor-based instant refactoring framework to drive inexperienced software engineers to conduct more refactorings promptly. Changes in the source code are instantly analyzed by a monitor running in the background. If these changes have the potential to introduce code smells, i.e., signs of potential problems in the code that might require refactorings, the monitor invokes corresponding smell detection tools and warns developers to resolve detected smells promptly. Feedback from developers, i.e., whether detected smells have been acknowledged and resolved, is consequently used to optimize smell detection algorithms. The proposed framework has been implemented, evaluated, and compared with the traditional human-driven refactoring tools. Evaluation results suggest that the proposed framework could drive inexperienced engineers to resolve more code smells (by an increase of 140 percent) promptly. The average lifespan of resolved smells was reduced by 92 percent. Results also suggest that the proposed framework could help developers to avoid similar code smells through timely warnings at the early stages of software development, thus reducing the total number of code smells by 51 percent.
Software, Monitoring, Detection algorithms, Cloning, Detectors, Algorithm design and analysis, Inspection, instant refactoring, Software refactoring, code smell detection, monitor
Hui Liu, Xue Guo, Weizhong Shao, "Monitor-Based Instant Software Refactoring", IEEE Transactions on Software Engineering, vol.39, no. 8, pp. 1112-1126, Aug. 2013, doi:10.1109/TSE.2013.4