计算机科学
重构代码
人工智能
代码气味
编码(集合论)
深度学习
支持向量机
机器学习
卷积神经网络
词汇分析
源代码
自然语言处理
软件
程序设计语言
软件质量
软件开发
集合(抽象数据类型)
作者
Yang Zhang,Chuyan Ge,Su Young Hong,Ruili Tian,Chunhao Dong,Jingjing Liu
标识
DOI:10.1016/j.knosys.2022.109737
摘要
The presence of code smells will increase the risk of failure, make software difficult to maintain, and introduce potential technique debt in the future. Although many deep-learning-based approaches have been proposed to detect code smells, most existing works suffer from the problem of incomplete feature extraction and unbalanced distribution between positive samples and negative samples. Furthermore, the accuracy of existing works can be further improved. This paper proposes a novel approach named DeleSmell to detect code smells based on a deep learning model. The dataset is built by extracting samples from 24 real-world projects. To improve the imbalance in the dataset, a refactoring tool is developed to automatically transform good source code into smelly code and to generate positive samples based on real cases. DeleSmell collects both structural features through iPlasma and semantic features via latent semantic analysis and word2vec. DeleSmell’s model includes a convolutional neural network(CNN) branch and gate recurrent unit(GRU)-attention branch. The final classification is conducted by an support vector machine(SVM). In the experimentation, the effectiveness of DeleSmell is evaluated by answering seven research questions. The experimental results show that DeleSmell improves the accuracy of brain class (BC) and brain method (BM) code smells detection by up to 4.41% compared with existing approaches, demonstrating the effectiveness of our approach.
科研通智能强力驱动
Strongly Powered by AbleSci AI