基于机器学习的无低内存解析器异味检测方法
Machine learning-based code smell detection method for No Low Memory Resolver
邢代鑫 1边奕心1
作者信息
- 1. 哈尔滨师范大学计算机科学与信息工程学院,黑龙江哈尔滨 150025
- 折叠
摘要
代码异味是指影响代码维护过程并降低软件质量的糟糕代码设计或实现.因此,代码异味检测在软件重构中非常重要.文章使用五种传统机器学习模型,对Android特有代码异味进行检测.为了获取机器学习模型所需的大量样本数据,文章构建了一个Java代码异味数据集,该数据集包含14,000个样本,并从源代码中提取46个特征.此外,还使用开源Android应用程序进行实验验证.结果表明,随机森林是检测无低内存解析器异味中性能最好的模型,实现了最高的F1值0.928.
Abstract
Code smell refers to poor code design or implementation that affects the code mainte-nance process and lowers software quality.Therefore,code smell detection is crucial in software refactoring.In this paper,we utilize five traditional machine learning models to detect Android-specific code smells.To acquire the large dataset required for machine learning models,we con-struct a Java code smell dataset comprising 14,000 samples,with 72 features extracted from the source code.Additionally,we conduct experimental validation using open-source Android appli-cations.The results show that Random Forest is the best-performing model for detecting code smells in No Low Memory Resolver,achieving the highest F1 score of 0.928.
关键词
Android代码异味/机器学习/异味检测Key words
Android-specific code smells/machine learning/smell detection引用本文复制引用
出版年
2024