摘要
由于现有代码异味检测方法存在多方面的限制,无法准确高效的检测Android代码异味共存,提出基于机器学习的Android代码异味共存检测方法。首先提出并实现工具ASSD得到分离好的正负样本集,提取源代码中的文本信息作为机器学习分类器的输入,从而实现机器学习检测Android代码异味共存。设计对比实验,实验结果表明机器学习可以检测Android代码异味共存,并且检测效果较现有基于静态程序分析的检测方法有较大提升,其中随机森林模型效果最好,其F1值提升了22%。
Due to the limitations of existing code smell detection methods,it is difficult to accurately and efficiently detect the coexistence of code smells in Android code.In this regard,a machine learning-based approach for detecting the coexistence of code smells in Android code is proposed.Firstly,a tool called ASSD is proposed and implemented to obtain well-separated positive and negative sample sets.The textual information extracted from the source code is used as the input for the machine learning classifier,thus achieving the detection of code smell coexistence using machine learning.Comparative experiments are designed,and the results show that machine learning can effectively detect the coexistence of code smells in Android code,with significantly improved detection performance compared to existing static program analysis-based methods.Among them,the random forest model performs the best,with an F1 score improvement of 22%.
作者
孙梦琪
边奕心
SUN Mengqi;BIAN Yixin(Harbin Normal University,Heilongjang Harbin 150025)
出处
《长江信息通信》
2024年第2期138-140,144,共4页
Changjiang Information & Communications