Abstract

Code smell is a software quality problem caused by software design flaws. Refactoring code smells can improve software maintainability. While prior works mostly focused on Java code smells, only a few prior researches detect and refactor code smells of Python. Therefore, we intend to outline a route (i.e. sequential refactoring operation) for refactoring Python code smells, including LC, LM, LMC, LPL, LSC, LBCL, LLF, MNC, CCC and LTCE. The route could instruct developers to save effort by refactoring the smell strongly correlated with other smells in advance. As a result, more smells could be resolved by a single refactoring. First, we reveal the co-occurrence and the inter-causation between smells. Then, we evaluate the smells’ correlation. Results highlight seven groups of smells with high co-occurrence. Meanwhile, 10 groups of smells correlate with each other in a significant level of Spearman’s correlation coefficient at 0.01. Finally, we generate the refactoring route based on the association rules, we exploit an empirical verification with 10 developers involved. The results of Kendall’s Tau show that the proposed refactoring route has a high inter-agreement with the developer’s perception. In conclusion, we propose four refactoring routes to provide guidance for practitioners, i.e. {LPL [Formula: see text] LLF}, {LPL [Formula: see text] LBCL}, {LPL [Formula: see text] LMC} and {LPL [Formula: see text] LM [Formula: see text] LC [Formula: see text] CCC [Formula: see text] MNC}.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call