Multi-Label Code Smell Detection with Hybrid Model Based on Deep Learning

Yichen Li,Xiaofang Zhang
DOI: https://doi.org/10.18293/seke2022-077
2022-01-01
Abstract:smell is an indicator of potential problems in a software design that have a negative impact on readability and maintainability.Hence, it is essential for developers to make out the code smell to get tips on code maintenance in time.Fortunately, many approaches like metric-based, heuristic-based, machine-learning based and deep-learning based have been proposed to detect code smells.However, existing methods, using the simple code representation to describe different code smells unilaterally, cannot efficiently extract enough rich information from source code.What is more, one code snippet often has several code smells at the same time and there is a lack of multilabel code smell detection based on deep learning.In this paper, we propose a hybrid model with multi-level code representation to further optimize the code smell detection.First, we parse the code into the abstract syntax tree(AST) with control and data flow edges and the graph convolution network is applied to get the prediction at the syntactic and semantic level.Then we use the bidirectional long-short term memory network with attention mechanism to analyze the code tokens at the token-level in the meanwhile.Finally we get the fusion prediction result of the models.Experimental results show that our model can perform outstanding not only in single code smell detection but also in multi-label code smell detection.
What problem does this paper attempt to address?