Automatic Software Refactoring via Weighted Clustering in Method-Level Networks
Authors:
- 8 March 2017
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 44 (3) , 202-236
Abstract
In this study, we describe a system-level multiple refactoring algorithm, which can identify the move method, move field, and extract class refactoring opportunities automatically according to the principle of “high cohesion and low coupling.” The algorithm works by merging and splitting related classes to obtain the optimal functionality distribution from the system-level. Furthermore, we present a weighted clustering algorithm for regrouping the entities in a system based on merged method-level networks. Using a series of preprocessing steps and preconditions, the “bad smells” introduced by cohesion and coupling problems can be removed from both the non-inheritance and inheritance hierarchies without changing the code behaviors. We rank the refactoring suggestions based on the anticipated benefits that they bring to the system. Based on comparisons with related research and assessing the refactoring results using quality metrics and empirical evaluation, we show that the proposed approach performs well in different systems and is beneficial from the perspective of the original developers. Finally, an open source tool is implemented to support the proposed approach.Keywords
Funding Information
- National Natural Science Foundation of China (61374178, 61402092)
- MOE research center for online education, China (2016ZD306)
- Ph.D. Start-up Foundation of Liaoning Province, China (201501141)
This publication has 45 references indexed in Scilit:
- Using complexity, coupling, and cohesion metrics as early indicators of vulnerabilitiesJournal of Systems Architecture, 2011
- Identifying Extract Class refactoring opportunities using structural and semantic cohesion measuresJournal of Systems and Software, 2011
- Automated scheduling for clone‐based refactoring using a competent GASoftware: Practice and Experience, 2010
- Stability of Ecological Communities and the Architecture of Mutualistic and Trophic NetworksScience, 2010
- Search-based refactoring for software maintenanceJournal of Systems and Software, 2008
- Finding community structure in very large networksPhysical Review E, 2004
- Comparing performance of algorithms for generating concept latticesJournal of Experimental & Theoretical Artificial Intelligence, 2002
- Cohesion and reuse in an object-oriented systemACM SIGSOFT Software Engineering Notes, 1995
- Object-oriented metrics that predict maintainabilityJournal of Systems and Software, 1993
- Efficient algorithms for agglomerative hierarchical clustering methodsJournal of Classification, 1984