Font Size: a A A

Structure Analysis And Optimization For Object-Oriented Program

Posted on:2024-08-12Degree:MasterType:Thesis
Country:ChinaCandidate:Y F HuangFull Text:PDF
GTID:2568307052495894Subject:Electronic information
Abstract/Summary:PDF Full Text Request
In object-oriented software,classes and packages are the primary constituent elements,encapsulating data and operations in classes and combining classes into packages to reduce system complexity and increase system comprehensibility.However,in the long-term development and maintenance process,the software inevitably undergoes modifications due to new requirements and environmental changes,causing the code to decay and drift from the original software design,showing poor cohesion and coupling.This paper analyzes and optimizes the program structure,improves the understandability and reusability of the system,and reduces maintenance costs without changing the external behaviors of the software.The main research of the thesis is as follows:1.An optimization method based on the Non-Dominated Sorting Genetic Algorithm(NSGA-II)is proposed to improve existing class structures by reassigning methods in classes to conform to the “high cohesion,low coupling” design criterion.The paper selects10 open source object-oriented software projects to experiment with the approach and obtain refactoring suggestions.The experimental results are evaluated in three aspects: 1)a qualitative analysis of the refactoring suggestions? 2)an assessment of the changes in three quality attributes,such as maintainability,reusability,and entity placement metrics of the system? and 3)a comparison with the remaining two refactoring research approaches.The results show that the NSGA-II algorithm can provide accurate and valuable suggestions for the refactoring operations of moving methods in the class and performs better than the single-objective optimization algorithm.2.An optimization method based on complex network theory is proposed to improve the existing package structure.The approach aims to reorganize classes at the system level to improve package cohesion and reduce package coupling.The community detection algorithm is applied to the class dependency network,and the refactoring suggestions are extracted from the two dimensions of splitting packages and moving classes between packages,by comparing the original and optimized package structures.The paper selects 10 open source object-oriented software projects for experimental validation of the approach.The experimental results are evaluated in four aspects: 1)the changes in the number of large and small packages in the system? 2)the changes in the cohesion and coupling of the system packages? 3)the comparison with the remaining two package refactoring research approaches? and 4)the changes in the reusability and instability of the refactored system is evaluated.The results show that the method in this paper can improve the quality of package design and provide meaningful suggestions for package refactoring.
Keywords/Search Tags:Refactor, Complex Network, Community Detection, Multi-objective Optimization Algorithm, Object-Oriented Programs
PDF Full Text Request
Related items