Software modularization is a technique used to divide a software system into independent modules (packages)that are expected to be cohesive and loosely coupled. However, as software systems evolve over time to meet ...Software modularization is a technique used to divide a software system into independent modules (packages)that are expected to be cohesive and loosely coupled. However, as software systems evolve over time to meet new require-ments, their modularizations become complex and gradually loose their quality. Thus, it is challenging to automaticallyoptimize the classes' distribution in packages, also known as remodularization. To alleviate this issue, we introduce a newapproach to optimize software modularization by moving classes to more suitable packages. In addition to improving designquality and preserving semantic coherence, our approach takes into consideration the refactoring effort as an objective initself while optimizing software modularization. We adapt the Elitist Non-dominated Sorting Genetic Algorithm (NSGA-Ⅱ)of Deb et al. to find the best sequence of refactorings that 1) maximize structural quality, 2) maximize semantic cohesivenessof packages (evaluated by a semantic measure based on WordNet), and 3) minimize the refactoring effort. We report theresults of an evaluation of our approach using open-source projects, and we show that our proposal is able to produce acoherent and useful sequence of recommended refactorings both in terms of quality metrics and from the developer's pointsof view.展开更多
文摘Software modularization is a technique used to divide a software system into independent modules (packages)that are expected to be cohesive and loosely coupled. However, as software systems evolve over time to meet new require-ments, their modularizations become complex and gradually loose their quality. Thus, it is challenging to automaticallyoptimize the classes' distribution in packages, also known as remodularization. To alleviate this issue, we introduce a newapproach to optimize software modularization by moving classes to more suitable packages. In addition to improving designquality and preserving semantic coherence, our approach takes into consideration the refactoring effort as an objective initself while optimizing software modularization. We adapt the Elitist Non-dominated Sorting Genetic Algorithm (NSGA-Ⅱ)of Deb et al. to find the best sequence of refactorings that 1) maximize structural quality, 2) maximize semantic cohesivenessof packages (evaluated by a semantic measure based on WordNet), and 3) minimize the refactoring effort. We report theresults of an evaluation of our approach using open-source projects, and we show that our proposal is able to produce acoherent and useful sequence of recommended refactorings both in terms of quality metrics and from the developer's pointsof view.