###
计算机系统应用英文版:2025,34(10):133-142
本文二维码信息
码上扫一扫!
同构集成深度学习的代码异味检测
(1.上海师范大学 信息与机电工程学院, 上海 201418;2.上海计算机软件技术开发中心, 上海 201112;3.上海市计算机软件评测重点实验室, 上海 201112)
Code Smell Detection Based on Homogeneous Ensemble Deep Learning
(1.College of Information, Mechanical and Electrical Engineering, Shanghai Normal University, Shanghai 201418, China;2.Shanghai Development Center of Computer Software Technology, Shanghai 201112, China;3.Shanghai Key Laboratory of Computer Software Testing & Evaluating, Shanghai 201112, China)
摘要
图/表
参考文献
相似文献
本文已被:浏览 353次   下载 1170
Received:February 26, 2025    Revised:March 18, 2025
中文摘要: 代码异味是软件源代码中存在的不良设计问题, 它影响着代码可维护性, 可读性以及可扩展性. 研究人员可以通过检测代码异味确定待重构的代码, 进而改善代码质量. 过去的研究广泛将机器学习技术应用于代码异味检测, 虽取得一定成果, 但在检测准确性、泛化能力方面仍存在局限. 本文构建两种模型: 直接同构集成CNN和RNCNN (random forest-negative correlation learning-CNN), 来检测4种代码异味(Data class, God class, Feature envy, Long method), 利用基于随机森林的特征选择技术提取更重要的特征, 利用深度学习技术对代码的结构特征进行建模, 再使用负相关学习同构集成深度学习模型方法训练模型, 进行异味检测. 与基线工作相比, 本研究的F1值最高提升4.93%.
Abstract:Code smells are undesirable design characteristics in software source code that negatively affect maintainability, readability, and scalability. By detecting code smells, it becomes possible to identify code segments requiring refactoring, thus enhancing code quality. Although machine learning techniques have been widely applied in previous studies for code smell detection, challenges persist regarding detection accuracy and generalization capability. In this study, we propose two models: a directly isomorphic ensemble model combining convolutional neural network (CNN) and a random forest-negative correlation learning-CNN (RNCNN), to detect four types of code smells: Data class, God class, Feature envy, and Long method. A feature selection technique based on random forests is employed to extract the most informative features, and deep learning techniques are utilized to model the structural characteristics of the code. The model is then trained using a homogeneous ensemble deep learning approach based on negative correlation learning. Experimental results demonstrate that the proposed method improves the F1 score by up to 4.93% compared to baseline approaches.
文章编号:     中图分类号:    文献标志码:
基金项目:中国博士后科学基金面上项目(2024M761927); 上海市“科技创新行动”启明星项目(扬帆专项) (24YF2719900)
引用文本:
张苗,黄子杰,陈军华,高建华.同构集成深度学习的代码异味检测.计算机系统应用,2025,34(10):133-142
ZHANG Miao,HUANG Zi-Jie,CHEN Jun-Hua,GAO Jian-Hua.Code Smell Detection Based on Homogeneous Ensemble Deep Learning.COMPUTER SYSTEMS APPLICATIONS,2025,34(10):133-142