基于深度学习的软件重构预测评估方法
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

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


Software refactoring prediction evaluation method based on deep learning models
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    为了解决当前软件重构领域深度学习模型预测性能研究的不足,提出了一种基于深度学习的软件重构预测评估方法,以评估深度学习模型的重构预测性能。首先,采用静态分析工具从303个Java项目中收集重构和非重构标签实例,针对提取类、提取子类、提取超类、提取接口、移动类、重命名类以及移动和重命名类7种重构操作构建了7个由源代码度量组成的数据集;其次,搭建卷积神经网络模型、长短期记忆网络模型、门控循环单元模型、多层感知机、自编码器在数据集上进行训练和测试;最后,根据每个模型的准确率、查准率、查全率和F1值对模型进行评估。结果表明,5种深度学习模型预测重构的准确率、查准率、查全率和F1值的平均值均在93%以上,预测提取子类的准确率最高,卷积神经网络模型预测重构的平均准确率高于其他模型。卷积神经网络模型在软件重构预测评估方面效果较好,为未来使用深度学习模型辅助完成重构推荐任务提供了参考。

    Abstract:

    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.

    参考文献
    相似文献
    引证文献
引用本文

张亦弛,张 杨,李彦磊,郑 琨,刘 伟.基于深度学习的软件重构预测评估方法[J].河北科技大学学报,2024,45(6):636-642

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2023-11-03
  • 最后修改日期:2024-03-11
  • 录用日期:
  • 在线发布日期: 2025-01-02
  • 出版日期:
文章二维码