[论文解读] A Survey of Deep Learning Based Software Refactoring
本文对基于深度学习的软件重构进行了全面综述,将48项研究按任务分类为五类:代码坏味道检测(56.25%)、重构建议(33.33%)、端到端代码转换(6.25%)、重构挖掘(4.17%)和质量保障(0%)。研究揭示了研究重点的显著失衡,对类级别和变量级别的重构关注极少,并指出了该领域中的关键挑战与未来研究机遇。
Refactoring is one of the most important activities in software engineering which is used to improve the quality of a software system. With the advancement of deep learning techniques, researchers are attempting to apply deep learning techniques to software refactoring. Consequently, dozens of deep learning-based refactoring approaches have been proposed. However, there is a lack of comprehensive reviews on such works as well as a taxonomy for deep learning-based refactoring. To this end, in this paper, we present a survey on deep learning-based software refactoring. We classify related works into five categories according to the major tasks they cover. Among these categories, we further present key aspects (i.e., code smell types, refactoring types, training strategies, and evaluation) to give insight into the details of the technologies that have supported refactoring through deep learning. The classification indicates that there is an imbalance in the adoption of deep learning techniques for the process of refactoring. Most of the deep learning techniques have been used for the detection of code smells and the recommendation of refactoring solutions as found in 56.25\% and 33.33\% of the literature respectively. In contrast, only 6.25\% and 4.17\% were towards the end-to-end code transformation as refactoring and the mining of refactorings, respectively. Notably, we found no literature representation for the quality assurance for refactoring. We also observe that most of the deep learning techniques have been used to support refactoring processes occurring at the method level whereas classes and variables attracted minimal attention. Finally, we discuss the challenges and limitations associated with the employment of deep learning-based refactorings and present some potential research opportunities for future work.
研究动机与目标
- 为解决基于深度学习的软件重构缺乏全面综述和标准化分类体系的问题。
- 分析现有基于深度学习的技术在不同重构任务中的分布与研究重点。
- 识别出如重构质量保障以及类/变量级别重构等尚未充分探索的领域。
- 突出当前方法在端到端转换和重构挖掘方面的研究空白与局限性。
- 通过阐明应用深度学习于软件重构的潜在机遇与挑战,为未来研究提供指导。
提出的方法
- 作者对48项基于深度学习的软件重构研究进行了系统性文献综述,涵盖同行评审的期刊与会议论文。
- 根据研究的主要任务,将这些研究划分为五类:代码坏味道检测、重构建议、端到端代码转换、重构挖掘和质量保障。
- 针对每一类,分析了包括坏味道类型、重构类型、训练策略和评估方法在内的关键方面。
- 本综述采用定性与定量分析相结合的方法,评估不同重构任务及代码元素中技术的普遍性与分布情况。
- 通过考察研究中针对不同代码粒度级别(如方法、类、变量)的比例,评估现有方法的成熟度与关注重点。
- 本研究采用结构化框架,对所调研文献中的深度学习模型、数据集与评估指标进行对比分析。
实验结果
研究问题
- RQ1基于深度学习的软件重构任务的主要类别是什么?它们在现有研究中的分布如何?
- RQ2哪些代码元素(如方法、类、变量)最常被基于深度学习的重构方法所针对?
- RQ3基于深度学习的重构系统中,主流的训练策略与评估方法有哪些?
- RQ4为何在深度学习应用中,关于重构质量保障的研究如此匮乏?
- RQ5在基于深度学习的软件重构领域,关键挑战与开放的研究机遇是什么?
主要发现
- 代码坏味道检测是研究最集中的任务,占所调研研究的56.25%,表明对识别代码质量问题有强烈兴趣。
- 重构建议紧随其后,占比33.33%,显示出在检测后提出改进建议的日益关注。
- 端到端代码转换(即自动化完整重构流程)的研究严重不足,仅有6.25%的研究聚焦于此任务。
- 重构挖掘(即从代码库中提取重构模式)也代表性不足,仅占4.17%的研究。
- 未发现任何研究涉及重构的质量保障,暴露出在验证重构后代码的正确性与安全性方面存在关键研究空白。
- 大多数深度学习技术集中于方法级别,对类级别和变量级别的重构关注极少,表明在粒度关注上存在显著失衡。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。