ECC Multi-Label Code Smell Detection Method Based on Ranking Loss
-
摘要: 代码异味是由糟糕的代码或设计问题引起的一种软件特征,严重影响了软件系统的可靠性和可维护性.在软件系统中,一段代码元素可能同时受到多种代码异味的影响,使得软件质量明显下降.多标签分类适用该情况,将高共现的多个代码异味置于同一标签组,可以更好地考虑代码异味的相关性,但现有的多标签代码异味检测方法未考虑同一段代码元素中多种代码异味检测顺序的影响.对此,提出了一种基于排序损失的集成分类器链(ensemble of classifier chains, ECC)多标签代码异味检测方法,该方法选择随机森林作为基础分类器并采取多次迭代ECC的方式,以排序损失最小化为目标,选择一个较优的标签序列集,优化代码异味检测顺序问题,模拟其生成机理,检测一段代码元素是否同时存在长方法-长参数列表、复杂类-消息链或消息链-过大类这3组代码异味.实验采用9个评价指标,结果表明所提出的检测方法优于现有的多标签代码异味检测方法,F1平均值达97.16%.Abstract: Code smell is a software feature of bad code or design problem, which seriously affects the reliability and maintainability of software systems. In a software system, a piece of code element may be affected by multiple code smells at the same time, which makes the quality of the software significantly reduced. Multi-label classification is suitable for this case, by placing multiple code smells with high co-occurrence in one label group, the correlation of code smells can be better considered, but the existing multi-label code smell detection methods do not consider the influence of the code smell detection order in the same code element. As a result, an ECC multi-label code smell detection method based on ranking loss is proposed. This method aims at minimizing ranking loss and chooses an optimal set of label sequences to optimize code smell detection order problem and simulate the mechanism of code smell generation by selecting random forest as the basic classifier and adopting multiple iterations of ECC to detect whether a piece of code element has long method-long parameter list, complex class-message chain or message chain-blob simultaneously. Finally, nine evaluation metrics are used and experimental results show that the proposed method is superior to the existing multi-label code smell detection method with an average F1 of 97.16%.
-
-
期刊类型引用(9)
1. 黄翔东,陈红红,甘霖. 基于频率-时间扩张密集网络的语音增强方法. 计算机研究与发展. 2023(07): 1628-1638 . 本站查看
2. 许春冬,徐琅,周滨. 结合优化U-Net和残差神经网络的单通道语音增强算法. 现代电子技术. 2022(09): 35-40 . 百度学术
3. 葛宛营,张天骐,范聪聪,张天. 噪声情况下采用稀疏非负矩阵分解与深度吸引子网络的人声分离算法. 声学学报. 2021(01): 55-66 . 百度学术
4. GE Wanying,ZHANG Tianqi,FAN Congcong,ZHANG Tian. Monaural noisy speech separation combining sparse non-negative matrix factorization and deep attractor network. Chinese Journal of Acoustics. 2021(02): 266-280 . 必应学术
5. 王静红,梁丽娜,李昊康,周易. 基于注意力网络特征的社区发现算法. 山东大学学报(理学版). 2021(09): 1-12+20 . 百度学术
6. 张天骐,柏浩钧,叶绍鹏,刘鉴兴. 基于门控残差卷积编解码网络的单通道语音增强方法. 信号处理. 2021(10): 1986-1995 . 百度学术
7. 曹丽静. 语音增强技术研究综述. 河北省科学院学报. 2020(02): 30-36 . 百度学术
8. 张天骐,张晓艳,周琳,胡延平. 基于稀疏性的相位谱补偿语音增强算法. 信号处理. 2020(11): 1867-1876 . 百度学术
9. 时文华,张雄伟,邹霞,孙蒙. 利用深度全卷积编解码网络的单通道语音增强. 信号处理. 2019(04): 631-640 . 百度学术
其他类型引用(8)
计量
- 文章访问数: 752
- HTML全文浏览量: 1
- PDF下载量: 352
- 被引次数: 17