Font Size: a A A

Design Principles Guided Software Refactoring:A Multi-objective Optimization Approach

Posted on:2019-02-18Degree:DoctorType:Dissertation
Country:ChinaCandidate:Y Y ZhaoFull Text:PDF
GTID:1318330545475801Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
In the software lifecycle,software is often modified or enhanced to meet differ-ent functional requirements.With the advance of the evolution,software design will become more and more complex,and maintenance costs will be higher and higher.Software refactoring technology can improve the software design and reduce mainte-nance costs by changing software internal structure.In order to provide a support for developers in the process of software refactoring,a lot of refactoring methods have been proposed.However,most of them only consider fine granularity(such as class level)refactoring operations.In fact,for large object-oriented software systems,pack-age plays an important role in software design.As a basic organizational unit,package manages the class to reduce the complexity of the system.The design quality of pack-ages is directly related to the quality of the whole software design.Conducting fine grained software refactoring is not enough to significantly improve the design qual-ity of the package.Therefore,if the quality of package design can be improved by refactoring,the quality of software can be improved more effectively.Among the existing refactoring methods,search-based software refactoring meth-ods have attracted much attention in recent years,such as mono-objective approaches and multi-objective approaches.It has been pointed out that mono-objective approach is not enough to balance the conflicting quality attributes(such as cohesion and cou-pling),and a multi-objective approach can better solve the refactoring problem.How-ever,the objectives of existing multi-objective refactoring approaches do not directly quantify the extent to which the design principles are followed.Intuitively,the more a software system follows the design principles,the higher the quality of the software is.If this hypothesis is true,it is more likely to significantly improve software quality by using design principle metrics as the optimization objectives.In addition,in soft-ware design principles,a module having high cohesion and low coupling is the most basic design criterion.It is a common problem in software refactoring how to solve the conflict between cohesion and coupling,and improve both of them at the same time.Using the measure combining cohesion and coupling as the optimization objective is an attempt to solve the conflict between them.However,it remains to be verified that,whether the effectiveness of the cohesion metrics in assessing the software quality is affected by the customer usage coupling.If the influence is significant and positive,it is more advantageous to use the cohesion metrics(which take the coupling relationship into account)as the optimization objectives for software refactoring.In order to solve the above problems,this paper first empirically studies the in-fluence of software compliance with design principles on software quality,and further from the view of high cohesion and low coupling design principle,studies the effect of customer coupling relationship on cohesion metrics in evaluating software quality.Due to the significant correlation between software quality and defect proneness,this paper analyzes the software quality from the perspective of defect proneness,and studies the relationship between design principle metrics(also called modularization metrics)and defect proneness,as well as the corresponding defect prediction abilities.Further,from the perspective of the "high cohesion and low coupling" principle,we study whether the relationship between cohesion metrics and defect proneness is affected by coupling relationship.Finally,based on the conclusions of the previous empirical research,we propose a design principle-oriented multi-objective optimization software refactoring method,aiming to provide a software solution which can significantly improve the quality of software design for developers.In conclusion,the main contributions of this thesis are concluded as the following:(1)We study the relationship between the design principle metrics(modulariza-tion metrics)and software quality,and analyze the relationship between the design principle metrics and the traditional package-level metrics,the correlation with defect-proneness,and the ability of defect prediction in object-oriented system.Based on mul-tiple open source 00 systems,the experimental results show that:1)these modulariza-tion metrics provide new and complementary views of software complexity compared with traditional package-level metrics;2)most of these modularization metrics have a significant association with defect-proneness in an expected direction;and 3)these modularization metrics can substantially improve the effectiveness of defect-proneness prediction when used with traditional package-level metrics together.The above ex-perimental results show that it is beneficial to improve the software quality and reduce defects if the software follows the design principle.(2)Based on whether client usage coupling relationship is exploited,we group these cohesion metrics into two categories:non-context-based and context-based,and investigate the value of considering client usage context in package cohesion for defect-proneness prediction.The experimental results show that:1)context-based cohesion metrics are complementary to non-context-based cohesion metrics;2)most of context-based cohesion metrics have a significantly negative association with defect-proneness;3)when used alone or used together with non-context-based cohesion metrics,context-based cohesion metrics can substantially improve the effectiveness of defect-proneness prediction in most studied systems under both cross-validation and across-version e-valuation.Client usage context has an important value in package cohesion for fault-proneness prediction.The above experimental results indicate that the customer usage coupling relationship has a significant impact on the effectiveness of cohesion metrics for evaluating software quality.(3)Based on the above empirical research,in order to improve the extent to which software follows design principles,we propose a design-principles-guided multiobjec-tive optimization software refactoring approach(called DP-MO-R).The characteristics of this approach are as follows:1)applies genetic algorithm to the software refactoring problem,and defines individual of the algorithm as a refactoring solution;2)defines rules to constrain population initialization,which ensure that the operations of the indi-viduals in the initial population can be performed;and 3)first uses the design principle metrics as the objectives to guide the solution search.In order to evaluate the effective-ness of the approach,we first analyze whether it can improve the quality of software design,and then compare it with an existing multi-objective refactoring method.The results show that this approach can significantly improve the extent to which the de-sign principles are followed,and in the contrast experiment,DP-MO-R has shown a significant advantage in most quality indicators.The package-level refactoring method we propose will provide an effective means for ensuring the software design quality during the software evolution,and help devel-opers enhance the extent to which the design principles are followed,thus improve the software design quality in time.Besides,the previous empirical research will help developers and researchers to get a better understanding of the relationship between modularization metrics and software quality,gain insights into the effects of client us-age coupling on cohesion metrics for software quality evaluation.
Keywords/Search Tags:Software refactoring, design principle, multi-objective optimization, defect prediction, modularization, cohesion
PDF Full Text Request
Related items