Source-linked AI summary
Many-Objective Software Remodularization using NSGA-III
Mohamed Wiem Mkaouer, Marouane Kessentini, Adnan Shaout, Patrice Koligheu, Slim Bechikh, Kalyanmoy Deb, Ali Ouni
TL;DR
Existing remodularization research often focuses on cohesion and coupling, uses few change operations, and omits semantic coherence, code-change cost, and development history. The paper proposes a scalable NSGA-III search-based approach with seven objectives and evaluates it across four open-source and one industrial system. Compared with existing approaches, it reports significant average improvements, with more than 92% of code smells fixed on the evaluated open-source systems.
Problem
Existing remodularization approaches mainly optimize cohesion and coupling, support few operation types, and often omit semantic coherence, code-change cost, and development history.
Method
The paper uses a scalable NSGA-III search-based approach that represents remodularization solutions as operation sequences and optimizes seven objectives.
Results
The approach significantly outperformed existing remodularization approaches on average across four open-source systems and one industrial system; more than 92% of code smells were fixed on the open-source systems.
Takeaways & Limitations
The approach provides remodularization solutions evaluated for structural improvement, semantic coherence, code-change reduction, and consistency with development history.
Takeaways & Limitations
The findings may not generalize to other applications, programming languages, or practitioners, and future replications are needed.
Abstract
from arXiv · showhide
Software systems nowadays are complex and difficult to maintain due to continuous changes and bad design choices. To handle the complexity of systems, software products are, in general, decomposed in terms of packages/modules containing classes that are dependent. However, it is challenging to automatically remodularize systems to improve their maintainability. The majority of existing remodularization work mainly satisfy one objective which is improving the structure of packages by optimizing coupling and cohesion. In addition, most of existing studies are limited to only few operation types such as move class and split packages. Many other objectives, such as the design semantics, reducing the number of changes and maximizing the consistency with development change history, are important to improve the quality of the software by remodularizing it. In this paper, we propose a novel many-objective search-based approach using NSGA-III. The process aims at finding the optimal remodularization solutions that improve the structure of packages, minimize the number of changes, preserve semantics coherence, and re-use the history of changes. We evaluate the efficiency of our approach using four different open-source systems and one automotive industry project, provided by our industrial partner, through a quantitative and qualitative study conducted with software engineers.
INTRODUCTION
Software remodularization addresses degradation in package structure as systems evolve, but existing approaches largely optimize cohesion and coupling alone. The paper proposes a scalable NSGA-III approach that jointly considers structural quality, semantic coherence, code-change cost, and development history.
- Evolving systems become complex, fault-prone, and difficult to maintain, while code changes can degrade class distribution across packages.
- Most existing remodularization studies formulate restructuring as a single-objective problem centered on package cohesion and coupling.
- Structural optimization alone can produce semantically incoherent designs and ignores the number of code changes required.
- Existing studies mainly support move-class and split-package operations, while development history can help identify recognizable changes for proposed solutions.
- The proposed approach uses seven objectives to optimize package structure, semantic coherence, code-change minimization, and consistency with change history.
- Evaluation on four open-source systems and one Ford Motor Company industrial system found average improvements over existing approaches in structure, code changes, and semantics preservation.
SOFTWARE REMODULARIZATION: A MANY-OBJECTIVE PROBLEM
This section frames software remodularization as a many-objective optimization problem and introduces the many-objective techniques used to address it.
- Many-objective techniques are adapted to the software remodularization problem by first describing the optimization methods and then formalizing remodularization accordingly.
Many-Objective Search-based Software Engineering
Many-objective optimization involves more than three objectives, creating search and decision-making difficulties that challenge traditional evolutionary algorithms. The paper investigates scalable many-objective techniques, including NSGA-III, for remodularization with up to seven objectives.
- Many-objective optimization is defined as multi-objective optimization with a high number of objectives M, specifically M > 3.
- The formulation includes M objective functions, P inequality constraints, Q equality constraints, and lower and upper bounds for decision variables.
- Feasible solutions satisfy all P + Q constraints and collectively define the feasible search space Ω.
- Traditional MOEAs such as NSGA-II are often ineffective for many-objective problems because dominance, diversity, and promising search-direction challenges intensify as objectives increase.
- Many-objective methods include objective reduction, preference-guided targets or reference directions, and decomposition to improve search efficiency and decision making.
- The paper investigates many-objective techniques for software remodularization with up to seven objectives, using NSGA-III as a scalable approach.
Many-Objective Software Remodularization: Overview
The approach formulates software remodularization as a seven-objective optimization problem, combining structural, change-cost, semantic, and historical considerations. It uses multiple remodularization operations and similarity measures to search for Pareto-optimal restructuring solutions.
- Remodularization objectives: Seven objectives cover package structure, code-change count, semantic coherence, and consistency with historical changes.Structural objectives include minimizing classes per package and package count, maximizing cohesion, and minimizing coupling.
- Search formulation: The approach searches for a set of Pareto-front solutions represented as ordered sequences of remodularization operations.Both the combinations and the order of change operations determine the search space.
- Remodularization operations: Supported operations include Move method, Extract class, Move class, Merge packages, and Extract/Split package.These operations extend beyond the move-class and split-package operations commonly used in earlier studies.
- History of code changes: Historical similarity encourages operations resembling changes previously applied to the same code fragments.The similarity score aggregates weighted similarities across recorded operations, where each weight reflects similarity to a proposed operation.
- Semantic objectives: Semantic coherence is estimated using vocabulary-based, dependency-based, and cohesion-based similarities between involved code elements.Vocabulary similarity uses tokenized identifiers and term vectors, while dependency similarity uses links such as shared method calls and shared field access.
SOFTWARE REMODULARIZATION USING NSGA-III
The paper addresses software remodularization with an adaptation of NSGA-III. It first presents the technique and then details its adaptation to the remodularization problem.
- SOFTWARE REMODULARIZATION USING NSGA-III: The approach applies NSGA-III to the software remodularization problem and describes the adaptation in two stages.The paper first gives an overview of NSGA-III, then explains the remodularization-specific adaptation.
NSGA-III
NSGA-III extends the NSGA-II framework with reference-point-based selection for many-objective optimization. The paper illustrates reference-point generation and explains how normalized objective values support diversity preservation.
- NSGA-III: NSGA-III retains NSGA-II’s population-generation and non-dominated-sorting framework but changes niche preservation through reference points.Uniformly distributed reference points guide selection from the last partially accepted front.
- Reference-point generation: For three objectives with p = 3, the Das and Dennis method generates 10 uniformly spaced reference points on a hyperplane.The spacing is δ = 1/p = 0.33.
- Reference-point generation: For the remodularization problem, the approach uses seven objectives and p = 5 for reference-point generation.These are identified as the parameters adjusted for the remodularization problem.
- Niche preservation: NSGA-III normalizes objective values and reference points before associating population members with their closest reference lines.This enables comparison on an identical range and supports diversity preservation.
- Niche preservation: Niche counts identify reference points with minimum representation, and the selection procedure uses them to preserve population diversity.A reference point may have multiple associated members or none.
Solution Approach
The solution approach adapts NSGA-III through solution encoding, seven-objective evaluation, genetic variation, feasibility checks, and objective normalization. Candidate solutions are operation sequences applied to the system and retained when their operations satisfy validity constraints.
- Solution Approach: The adaptation comprises solution representation, population initialization, fitness evaluation, selection, genetic operators, and normalization.These steps define the remodularization-specific NSGA-III workflow.
- Solution representation: Each candidate is a variable-length vector whose dimensions encode an ordered sequence of remodularization operations.Operation parameters are randomly generated from source-code elements extracted by parsing the system.
- Feasibility: Generated operation sequences are checked against preconditions and postconditions to ensure that operations can be applied.An example requires referenced packages and classes to exist and specifies the resulting package placement after MoveClass.
- Evaluation: Each executed solution is evaluated using seven objectives, then assigned a non-domination rank and a position relative to reference points.The evaluation occurs after executing the remodularization solution on the system.
- Normalization: Normalization records minimum and maximum values for each metric so population members and reference points share the same range.The shared range is required for diversity preservation.
- Genetic operators: One-point crossover recombines parent operation sequences, while bit-string mutation probabilistically replaces operations.Crossover enforces sequence-length limits, and mutation changes dimensions according to the mutation probability.
- Feasibility: After variation, infeasible operations are removed, and a sequence is valid only when fewer than 10% of its operations are rejected.Feasibility is checked using operation preconditions and postconditions.
VALIDATION
The evaluation uses experiments across multiple system versions and an industrial project, repeating each experiment 31 times and statistically comparing NSGA-III with existing approaches.
- Validation: 31 repetitions per experiment support statistical comparison of NSGA-III with existing remodularization approaches.The obtained results are subsequently statistically analyzed.
- Validation: The evaluation covers different versions of large open-source systems and one industrial project from Ford Motor Company.
- Validation: NSGA-III is compared with a variety of existing approaches.
Research Questions
The study investigates structural improvement, semantic preservation, change minimization, history reuse, algorithmic performance, comparison with existing remodularization, and usefulness to software engineers.
- Research Questions: The approach seeks to improve package structure while reducing changes, preserving semantic coherence, and reusing recorded operations from similar contexts.
- RQ1: RQ1.1 evaluates structural improvement using NCP, NP, NIE, and NAE across four open-source systems and one industrial project.
- RQ1: RQ1.2 validates semantic preservation through manual software-engineer assessment and automatic validation using JHotDraw's expected operations.
- RQ1: RQ1.3 measures the number of operations suggested, while RQ1.4 evaluates recorded-operation effects through MP and ROP.
- RQ2: RQ2 compares NSGA-III with MOEA/D, IBEA, and NSGA-II using IGD, with many-objective solutions selected by maximum trade-off.
- RQ3–RQ4: RQ3 compares the proposal with a coupling-and-cohesion technique limited to split packages, while RQ4 assesses usefulness through software-engineer feedback.
Software Projects Studied
The study evaluates four medium-to-large open-source Java projects and Ford's industrial JDI system, using collected historical operations and varied solution-length limits.
- Projects: The open-source systems are Xerces-J, JFreeChart, GanttProject, and JHotDraw, alongside Ford Motor Company's Java-based JDI project.
- Projects: The selected systems range from medium to large open-source projects actively developed over the past 10 years.
- Solution limits: Solution chromosome lengths use lower and upper bounds of 10 and 350 operations.
- Solution limits: NSGA-III performance is assessed with hypervolume while size limits vary between 10 and 500 operations.
- History collection: Ref-Finder identifies operations between analyzed software releases, after manual validation, using the operation types specified in Table 2.
Experimental Setting
The experimental setting combines engineer evaluation, multiple objective combinations, controlled algorithm parameters, and repeated statistically analyzed runs.
- Participants: The qualitative study involved 13 University of Michigan subjects and 2 Ford software engineers familiar with Java development.Reported Java experience ranged from 2 to 16 years.
- Objective combinations: The study evaluates solutions across combinations of NCP, NP, COU, COH, SP, NCH, and CHC objectives.
- Study organization: Each system requires 21 solutions for evaluation, with up to 10 operations randomly sampled per solution and cross-validation across participant groups.
- Participant evaluation: Participants evaluated semantic coherence and usefulness without knowing the specific algorithms or objective combinations.They rated operations as Yes, No, or May be, with majority votes determining correctness.
- Algorithm configuration: Search algorithms use objective-dependent population sizes and generation limits, common algorithm parameters, and 31 independent runs per problem instance.Results are statistically analyzed with the Wilcoxon rank sum test at a 99% confidence level.
Results
Across five systems, NSGA-III produced competitive structural improvements while improving semantic preservation, limiting code changes, and reusing development history. Its seven-objective formulation also performed strongly against alternative many-objective algorithms, although selecting among equivalent solutions remains necessary.
- Structural quality: NSGA-III achieved structural improvements close to mono- and multi-objective algorithms while finding compromises across seven objectives.The reported structural scores were sometimes better than those from approaches using only structural and semantic objectives.
- Semantic preservation: 88% of proposed operations were judged semantically feasible across five systems, compared with 51%–70% for NSGA-II and simulated annealing.The evaluation was conducted by software engineers and assessed whether operations generated semantic incoherence.
- Code-change reduction: 64 operations were required on average, versus 72 for IBEA, 71 for MOEA/D, and 79 for NSGA-II.The comparison covers the number of operations needed to apply the suggested remodularization solutions across all studied systems.
- History reuse: Recorded change history improved semantic preservation, and optimal solutions reused more than 75% of the recorded operations history.The results support using past operations to generate coherent and meaningful remodularization solutions.
- Many-objective optimization: When comparing seven-objective algorithms, NSGA-III was better than NSGA-II, IBEA, and MOEA/D on median IGD values over 31 runs.All comparisons were statistically significant at a 99% confidence level; NSGA-II performance degraded for problems with more than three objectives.
- Many-objective optimization: NSGA-III’s non-dominated solutions had better diversity than the alternatives, with a spread of approximately [0, 0.88] versus MOEA/D’s [0, 0.8].On the JDI-Ford seven-objective problem, NSGA-III and MOEA/D showed the best convergence, while NSGA-III showed better diversity.
THREATS TO VALIDITY
The study addresses construct, internal, and external validity threats through expert inspection, repeated statistical analysis, participant controls, and diversified subjects. Generalization remains limited by the five-system sample, participant composition, limited participants, parameter tuning, objective ordering, and manually selected semantic weights.
- The study considers construct, internal, and external validity threats affecting interpretation, experimental bias, and generalizability.
- Construct validity: Quantitative measures and expected-operation data were checked through expert inspection and Ref-Finder-supported operation detection.Ref-Finder operations were manually inspected before selecting the types used in experiments.
- Internal validity: 31 independent runs and Wilcoxon tests at 99% confidence address stochastic-algorithm variability, but parameter tuning remains a future evaluation need.The study used trial-and-error tuning; ANOVA-based sensitivity analysis is identified as a possible alternative.
- Internal validity: Isomorphic solutions may make objective-based goodness misleading, and the observed fitness-to-success correlation was limited to a few manually validated solutions.The authors state that this issue is outside the paper’s scope and plan more extensive empirical studies.
- Internal validity: Subject diversity, learning, fatigue, and diffusion were mitigated through balanced groups, randomization, written guidance, time flexibility, and separation instructions.Only ten operations per system were randomly selected for evaluation.
- External validity: Findings cannot yet be generalized to other applications, programming languages, or practitioners because the study used five systems and a limited participant group.Open-source evaluations were not conducted by the original developers, whereas some original Ford developers participated.
RELATED WORK
Related work largely targets modularization or remodularization through structural cohesion and coupling, with limited semantic, historical, and operation-level support. The paper positions its approach as combining structural and semantic information, change history, and finer-grained refactoring operations.
- Modularization foundations: Earlier studies often sought new module decompositions rather than improving existing modularizations.
- Search-based approaches: Search-based modularization initially used single-objective hill climbing to maximize cohesion and minimize coupling.
- Semantic coherence: Most remodularization approaches rely on structural metrics, while semantic coherence requires additional information to avoid semantically incoherent designs.Bavota et al. introduced a single-objective package-splitting approach incorporating semantic information.
- Semantic coherence: The proposed approach combines package- and class-level semantic and structural information to guide grouping, splitting, moving, or retaining code elements.
- Change history and refactoring scope: Existing approaches generally omit change history and support mainly moving classes or grouping and splitting packages.The paper identifies moving methods or fields between classes in different packages as an unaddressed operation type.
CONCLUSIONS AND FUTURE WORK
The paper introduces a scalable NSGA-III remodularization approach supporting seven objectives and addressing structural, semantic, change-cost, historical, and operation-scope limitations. Across four open-source and one industrial system, it significantly outperformed existing approaches, while future work targets broader validation and tuning.
- Contributions: The approach supports seven objectives for structural quality, semantic coherence, code-change minimization, and consistency with development change history.
- Evaluation: Evaluation covered four open-source systems and one Ford industrial system using quantitative and qualitative comparisons with existing remodularization approaches.
- Results: More than 92% of code smells were fixed on the different open-source systems, with statistically significant results across 31 simulations at 99% confidence.
- Future work: Future work includes larger comparative studies, additional software-engineering applications, parameter-setting analysis, developer preference weighting, history-focused remodularization, and broader expert participation.