Font Size: a A A

A Two-stage Odor Refactoring Recommendation Strategy Based On Hierarchy And Code Changes

Posted on:2021-05-11Degree:MasterType:Thesis
Country:ChinaCandidate:H H WeiFull Text:PDF
GTID:2438330626455042Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
In order to effectively improve the quality of software and reduce the code smells caused by program design and poor coding style,it is necessary to improve the smell processing method,that is,to improve the refactoring efficiency.Because the cost of refactoring is large,and different code smells are not equally important for software systems.This paper proposes two different refactoring tactics to focus on those classes with high probability of smell with different prioritization methods of smelly classes.Previously,the research on prioritization was mainly divided into two types:-kind and-instance.Prioritization of kind-smelly classes was mainly to study different smell types without considering the relationship between different code smells.The research on prioritization of instance-smelly classes was mainly based on the metrics of a single smell.In order to improve the above methods,the main contents of this paper are as follows:(1)FCSP and RCCSP refactorting tactics: Based on the concepts of floss and rootcanal refactorting tactics,different refactorting tactics designed for different prioritization methods of smelly classes are proposed,namely FCSP(floss Code Smell Prioritization)and RCCSP(root-canal Code Smell Prioritization).(2)Prioritization method of kind-smelly classes: Aiming at the situation that the prioritization between smells in the same layer in some research method cannot be determined,a prioritization method of hierarchical-smelly classes is proposed.This method analyzes relevance of code smells(association rules)and prioritizes the smelly classes according to the correlation.(3)Prioritization method of instance-smelly classes: Based on the positive correlation between code change scale and software error-proneness,a prioritization method based on code change index(CCI)is proposed.This method quantitatively analyzes the size of code change through three factors: the number of code change lines,the reason of code change,and the importance of code change classes,and prioritizes the smelly classes according to the number of the CCI.This article mainly prioritizes the seven code smells and experiments them in two java open source projects.By comparing the above two prioritization methods with the same field experiments,the results show that hierarchical prioritization is superior to the random prioritization and initial prioritization method,and CCI prioritization is better than prioritization method of code lines change index(CLCI)and prioritization method of Quality Depreciation Index Rule(QDIR),proved that the refactorting tactics based on the above prioritization method is effective.
Keywords/Search Tags:Code smell, relevance of code smells, prioritization method of hierarchical-smelly classes, prioritization method based on code change index, FCSP and RCCSP refactorting tactics
PDF Full Text Request
Related items