arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.05012cs.SE
收藏

EnseSmells:用于自动化代码异味检测的深度集成与编程语言模型

EnseSmells: Deep ensemble and programming language models for automated code smells detection

Anh Ho, Anh M. T. Bui, Phuong T. Nguyen, Amleto Di Salle, Bach Le

AI总结:

本文提出EnseSmells方法,通过融合结构特征与预训练语言模型的统计语义进行代码异味检测,在MLCQ数据集上相比现有方法提升5.98%至28.26%。

摘要:

软件源代码中的异味表示次优设计与实现决策的迹象,可能阻碍代码理解,进而提高代码易变更和易出错的可能性。在软件开发过程的早期阶段识别这些代码问题可以缓解上述问题并提升软件整体质量。当前研究主要集中于利用基于深度学习的模型来探究隐藏在源代码指令中的上下文信息以检测代码异味,而对结构特征和设计相关特征的重要性关注有限。本文提出一种新的代码异味检测方法,构建了一种深度学习架构,该架构重视融合从编程语言预训练模型中获得的结构特征与统计语义。我们进一步深入分析了不同的源代码嵌入模型如何影响不同代码异味类型的检测性能。使用来自精心设计数据集的四种广泛使用的代码异味,我们的实证研究表明,融入设计相关特征可显著提高检测准确率,在MLCQ数据集上优于最先进方法,提升幅度根据代码异味类型不同介于5.98%至28.26%之间。

英文摘要:

A smell in software source code denotes an indication of suboptimal design and implementation decisions, potentially hindering the code understanding and, in turn, raising the likelihood of being prone to changes and faults. Identifying these code issues at an early stage in the software development process can mitigate these problems and enhance the overall quality of the software. Current research primarily focuses on the utilization of deep learning-based models to investigate the contextual information concealed within source code instructions to detect code smells, with limited attention given to the importance of structural and design-related features. This paper proposes a novel approach to code smell detection, constructing a deep learning architecture that places importance on the fusion of structural features and statistical semantics derived from pre-trained models for programming languages. We further provide a thorough analysis of how different source code embedding models affect the detection performance with respect to different code smell types. Using four widely-used code smells from well-designed datasets, our empirical study shows that incorporating design-related features significantly improves detection accuracy, outperforming state-of-the-art methods on the MLCQ dataset with with improvements ranging from 5.98% to 28.26%, depending on the type of code smell.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑