This invention belongs to the field of
software automated refactoring technology, specifically involving a method and
system for detecting concern overload odors using topic modeling and mining, and for searching refactoring solutions using genetic algorithms. The method includes:
parsing and preprocessing the
source code of a microservice
system to obtain a code dependency matrix for
quality assessment; using topic modeling techniques to mine concerns in the
system and detect concern overload odors, while converting overloaded services into a set of refactoring units; and using a multi-objective
genetic algorithm to search a
list of refactoring solutions and using
Euclidean distance to select the optimal refactoring solution. This invention discovers
microservices with concern overload odors by mining semantic topics in the
software system and provides a
modular decomposition and refactoring method for overloaded services, thereby helping architects quickly discover and refactor concern overload odors within the system, improving the efficiency of
software maintenance and evolution.