Font Size: a A A

Generate Python Code Smell Refactoring Chains Based On Association Rules And Dependencies

Posted on:2022-11-25Degree:MasterType:Thesis
Country:ChinaCandidate:G L WangFull Text:PDF
GTID:2518306749483374Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
Code smell is a software quality problem caused by software design flaws,making software systems difficult to develop and maintain.Code refactoring can improve the scalability and maintainability of software systems,and the priority sequence of code smell refactoring is crucial.The current related work in the industry is mainly aimed at Java code smell,and only a few researches involve detection and refactoring of Python code smell.In view of this,this paper studies 10 Python code smell categories,and generates a refactoring route of Python code smell based on association rules and correlation.First,this paper evaluates the co-occurrence and causality between smells,mining the frequency intensity of different smell groups,and the possibility that the appearance of one smell triggers another smell.Secondly,this paper uses the Spearman correlation coefficient to calculate the correlation between smells,and by prioritizing the reconstruction of code smells with high co-occurrence and strong correlation,making development work achieve multiplier effect with half the effort.The main contributions of this article are as follows:(1)Mining the co-occurrence and correlation of Python code smells and explore the code smells with the highest co-occurrence and correlation among 9 active open-source projects on Git Hub.(2)The combinatorial relationship between Python code smells was quantitatively assessed,the code smells of Java software and Python software were compared,and the interaction and impact of Python code smells were explored.(3)Four Python code smell refactoring Routes are proposed to provide developers with refactoring priorities to improve efficiency.Finally,the rationality of the reconstruction strategy is verified by Kendall's Tau.This paper analyzes 94 versions of 9 open-source Python projects,and studies 10 kinds of Python code smells.The results show that: 15.77% of the projects have one or more code smells,and there are 7 groups of code smells with strong co-occurrence.There are also 10 groups of highly correlated code smells that are significantly correlated at the 0.01 level by Spearman.Finally,code smell refactoring routes are generated based on association rules,and empirically verified with 10 developers,the Kendall's Tau show that the proposed refactoring routes have a high inter-agreement with the developer's perception.This paper provides 4 kinds of Python code smell refactoring routes: {LPL?LLF},{LPL?LBCL},{LPL?LMC} and {LPL?LM?LC?CCC?MNC}.
Keywords/Search Tags:Python code smell, co-occurrence, correlation, code refactoring, empirical software engineering
PDF Full Text Request
Related items