关键词:
深度学习
代码异味
异味检测
摘要:
随着移动应用的快速发展,代码异味问题日益凸显,严重影响了软件的质量和性能。本文提出了一种基于深度学习的过度耦合的消息链异味检测方法,旨在提高代码异味的检测效率和准确性。为了自动获取深度学习模型所需的大量标签数据,提出一种基于静态程序分析的正负样本自动生成方法,并实现自动化工具ASSD。然后,使用程序文本信息作为特征集训练三种深度学习模型,实现异味检测。实验结果表明,使用深度学习模型可以检测过度耦合的消息链异味。卷积神经网络模型在查准率、查全率和F1值上均表现优异,其次是循环神经网络模型。本研究的方法和结果为Android应用开发中代码异味的自动检测提供了有效的技术支持。With the rapid development of mobile applications, the problem of code odor has become increasingly prominent, seriously affecting the quality and performance of software. This article proposes a deep learning based over coupled message chain odor detection method aimed at improving the efficiency and accuracy of code odor detection. In order to automatically obtain the large amount of labeled data required for deep learning models, a method for generating positive and negative samples based on static program analysis is proposed, and the automation tool ASSD is implemented. Then, three deep learning models were trained using program text information as the feature set to achieve odor detection. The experimental results indicate that using deep learning models can detect the odor of over coupled message chains. Convolutional neural network models perform well in precision, recall, and F1 score, followed by recurrent neural network models. The methods and results of this study provide effective technical support for automatic detection of code smells in Android application development.