arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.04861cs.SE
收藏

深度学习代码重构:实践与未满足的工具需求研究

Refactoring Deep Learning Code: A Study of Practices and Unsatisfied Tool Needs

Siqi Wang, Xing Hu, Bei Wang, Wenxin Yao, Xin Xia, Xinyu Wang

AI总结:

本研究通过分析5个深度学习项目的4921项重构实践、调研159名从业者,揭示了深度学习代码重构的分布特点及现有工具的不足,为重构工具发展和开发实践提供了建议。

摘要:

随着深度学习的快速发展,复杂算法的实现与海量数据处理已成为深度学习项目的标准组成部分。因此,随着软件迭代,代码复杂度持续攀升,难以维护和理解。现有研究已探讨了传统软件中重构对软件质量的影响,但深度学习语境下的代码重构认知仍不清晰。本研究旨在填补这一知识空白,通过实证方法考察深度学习领域代码重构的现状,以及从业者对重构的看法。我们首先手动分析了5个热门且维护良好的深度学习项目(如PyTorch)的提交历史,从历史提交中挖掘出4921项重构实践,并衡量了不同类型和元素的重构操作的分布情况,发现深度学习项目中重构操作类型的分布与传统Java软件中的分布存在差异。随后我们对159名从业者开展了调查,了解他们对深度学习项目中代码重构的看法以及对现有重构工具的期望。调查结果显示,深度学习领域的重构研究及相关工具开发对提升项目可维护性和代码质量至关重要,而当前的重构工具未能充分满足从业者的需求。最后,我们对重构工具的未来发展提出了展望,并为开发者的开发实践提供了建议。

英文摘要:

With the rapid development of deep learning, the implementation of intricate algorithms and substantial data processing have become standard elements of deep learning projects. As a result, the code has become progressively complex as the software evolves, which is difficult to maintain and understand. Existing studies have investigated the impact of refactoring on software quality within traditional software. However, the insight of code refactoring in the context of deep learning is still unclear. This study endeavors to fill this knowledge gap by empirically examining the current state of code refactoring in deep learning realm, and practitioners' views on refactoring. We first manually analyzed the commit history of five popular and well-maintained deep learning projects (e.g., PyTorch). We mined 4,921 refactoring practices in historical commits and measured how different types and elements of refactoring operations are distributed and found that refactoring operation types' distribution in deep learning projects is different from it in traditional Java software. We then surveyed 159 practitioners about their views of code refactoring in deep learning projects and their expectations of current refactoring tools. The result of the survey showed that refactoring research and the development of related tools in the field of deep learning are crucial for improving project maintainability and code quality, and that current refactoring tools do not adequately meet the needs of practitioners. Lastly, we provided our perspective on the future advancement of refactoring tools and offered suggestions for developers' development practices.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑