A software system is usually developed with multiple modules. However, its structure is continuously modified during software evolution, resulting in poor maintainability and understandability. Therefore, software evolution must accompany system refactoring. This paper describes an optimization approach for package structure according to complex network theory. First, we analyze the relations between classes and build the class dependency graph. Second, we propose a community detection algorithm to recombine the classes and optimize system cohesion and coupling without changing the external functionality. Third, by comparing the original and optimized package structure, the two dimensions of splitting the package and moving classes between packages identify package refactoring opportunities. In addition, we evaluate the impact of the above approach on package quality in terms of package reusability and instability. We design experiments on 10 open-source Java software projects to verify the effectiveness of our approach.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.