Python Code Smell Detection Using Machine Learning

Python(编程语言) 计算机科学 机器学习 人工智能 可维护性 可测试性 特征选择 单元测试 回归检验 软件 工具箱 软件质量 程序设计语言 软件系统 软件开发 软件工程 软件建设 哲学 认识论
作者
Natthida Vatanapakorn,Chitsutha Soomlek,Pusadee Seresangtakul
标识
DOI:10.1109/icsec56337.2022.10049330
摘要

Python is an increasingly popular programming language used in various software projects and domains. Code smells in Python significantly influences the maintainability, understandability, testability issues. This paper proposes a machine learning-based code smell detection for Python programs. We trained eight machine learning models with a dataset based on 115 open-source Python projects, 39 class-level software metrics, and 22 function-level software metrics. We intended to identify five code smell types in both class and function levels, i.e., long method, long parameter list, large class long scope chaining, and long based class list. Correlation-based feature selection (CFS) and logistic regression-forward stepwise (conditional) selection were employed to improve the performance of the model. This research concluded with an empirical evaluation of the performance of the machine learning approaches against the tuning machine method. The results show that the machine learning method achieved 99.72% accuracy when identifying long method and long base class list. The machine learning-based code smell detection also outperformed the tuning machine method. Moreover, we also found a set of high-impact features that contributed most when identifying each type of code smell.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
ddd发布了新的文献求助10
1秒前
1秒前
浮浮世世发布了新的文献求助10
2秒前
3秒前
喜上眉梢发布了新的文献求助10
4秒前
sen完成签到,获得积分10
4秒前
腼腆的赛君完成签到,获得积分10
5秒前
好吧只是个名字完成签到,获得积分10
5秒前
情怀应助浮浮世世采纳,获得10
7秒前
10秒前
LLN发布了新的文献求助10
10秒前
李健应助喜上眉梢采纳,获得10
12秒前
科研通AI6.3应助2058753794采纳,获得10
13秒前
yutu1111发布了新的文献求助10
15秒前
爆米花应助ddd采纳,获得10
16秒前
yhy完成签到 ,获得积分10
23秒前
wanci应助li采纳,获得10
24秒前
眼睛大的松鼠完成签到,获得积分10
24秒前
合适背包完成签到,获得积分10
26秒前
萤火完成签到,获得积分10
27秒前
yutu1111完成签到,获得积分10
28秒前
32秒前
32秒前
小蓝完成签到,获得积分10
32秒前
xxszyb完成签到,获得积分10
33秒前
的法国队完成签到,获得积分10
34秒前
35秒前
ayer发布了新的文献求助10
36秒前
cauwindwill发布了新的文献求助10
38秒前
沉默的涔完成签到 ,获得积分10
39秒前
白小超人完成签到 ,获得积分10
39秒前
sss发布了新的文献求助30
39秒前
40秒前
科研通AI6.2应助郭竞阳采纳,获得10
41秒前
automan发布了新的文献求助10
45秒前
46秒前
nan完成签到,获得积分10
48秒前
ayer完成签到,获得积分10
49秒前
53秒前
54秒前
高分求助中
液晶指向矢仿真分析数据集 8888
Invited Discussant 63O and 64O 1000
Dr. Dirk Wiechmann on Lingual Orthodontics: Part I 888
Ideology and Meaning-Making under the Putin Regime 750
化工技术经济第五版电子版 500
Petrology and Plate Tectonics 500
Writing Systems 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 计算机科学 化学工程 生物化学 物理 内科学 复合材料 催化作用 光电子学 物理化学 电极 细胞生物学 基因 遗传学
热门帖子
关注 科研通微信公众号,转发送积分 6880529
求助须知:如何正确求助?哪些是违规求助? 8580181
关于积分的说明 18229959
捐赠科研通 6263549
什么是DOI,文献DOI怎么找? 3055054
关于科研通互助平台的介绍 2065338
邀请新用户注册赠送积分活动 2032715