Towards Understanding the Distribution and Evolution of Code Smells: An Empirical Study on Java and Python Projects (S)
Code smells are usually associated with poor coding practices, design issues, and potential bugs.Studies on code smells are important.However, existing studies lack research on the distribution and evolution of code smells in different programming languages.To fill this gap, we collected 9 Java projects and 9 Python projects from GitHub and analyzed them with existing tools.We found that Java's code smell rate (the percentage of the number of code smells in total lines of code) of 11.11% is higher than Python's code smell rate of 1.31%."Magic Number", "Long Statement", and "Unutilized Abstraction" are the top three code smells in Java, while "Design Smells", "Common Weakness Enumeration", and "Unused Code" are the top three code smells in Python.The code smell aggregation level (the percentage of code smells in the top five modules in the total number of code smells) in Java is 44.07%while in Python is 59.18%, indicating that both languages are likely to accumulate code smells in certain modules.During the project's progress, the code smell rate remained steady in both languages, while the aggregation level showed a downward trend.Our findings can help developers understand common code smells and their trends in projects, thus guiding them to improve software quality.
Authors
- Qing Mi (ORCID: https://orcid.org/0000-0001-5063-3189)
- T Zhang
- Yuhe Wang (ORCID: https://orcid.org/0000-0002-2267-698X)
- Keke Cai
Institutions
- Beijing University of Technology (CN)
- University of Science and Technology Beijing (CN)
Publication Details
- Journal
- Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering
- Published
- 2024-10-28
- DOI
- https://doi.org/10.18293/seke2024-079
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Beijing University of Technology