基于深度学习的软件重构预测评估方法  

Software refactoring prediction evaluation method based on deep learning models

在线阅读下载全文

作  者:张亦弛 张杨[1] 李彦磊 郑琨[1] 刘伟[1] ZHANG Yichi;ZHANG Yang;LI Yanlei;ZHENG Kun;LIU Wei(School of Information Science and Engineering,Hebei University of Science and Technology,Shijiazhuang,Hebei 050018,China)

机构地区:[1]河北科技大学信息科学与工程学院,河北石家庄050018

出  处:《河北科技大学学报》2024年第6期636-642,共7页Journal of Hebei University of Science and Technology

基  金:国家自然科学基金(61440012);河北省自然科学基金(F2023208001);河北省引进留学人员资助项目(C20230358)。

摘  要:为了解决当前软件重构领域深度学习模型预测性能研究的不足,提出了一种基于深度学习的软件重构预测评估方法,以评估深度学习模型的重构预测性能。首先,采用静态分析工具从303个Java项目中收集重构和非重构标签实例,针对提取类、提取子类、提取超类、提取接口、移动类、重命名类以及移动和重命名类7种重构操作构建了7个由源代码度量组成的数据集;其次,搭建卷积神经网络模型、长短期记忆网络模型、门控循环单元模型、多层感知机、自编码器在数据集上进行训练和测试;最后,根据每个模型的准确率、查准率、查全率和F1值对模型进行评估。结果表明,5种深度学习模型预测重构的准确率、查准率、查全率和F1值的平均值均在93%以上,预测提取子类的准确率最高,卷积神经网络模型预测重构的平均准确率高于其他模型。卷积神经网络模型在软件重构预测评估方面效果较好,为未来使用深度学习模型辅助完成重构推荐任务提供了参考。Aiming at the lack of research on the performance of deep learning models in predicting software refactoring in the current field,a deep learning-based software refactoring prediction evaluation method was proposed to assess the refactoring predictive performance of these models.Firstly,refactoring and non-refactoring labeled instances were collected from 303 Java projects using static analysis tools,and seven datasets comprising source code metrics were constructed for seven refactoring operations:extracting class,extracting subclass,extracting super class,extracting interface,moving class,renaming class,and moving and renaming class.Secondly,convolutional neural network(CNN),long short-term memory(LSTM)network,gated recurrent unit(GRU)model,multilayer perceptron(MLP),and autoencoder(AE)were trained and tested on the datasets.Finally,each model was evaluated based on accuracy,precision,recall,and F1-measure.The results show that the average accuracy,precision,recall,and F1-measure of the five deep learning models for predicting refactoring are all above 93%,with the highest accuracy in predicting the extract subclass refactoring,and the CNN model has a higher average accuracy compared to other models.The CNN model is efficient for software refactoring prediction evaluation,which provides reference for future utilization of deep learning models in assisting with completing refactoring recommendation tasks.

关 键 词:软件工程 深度学习 软件重构 重构预测 源代码度量 

分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象