深度学习代码中的克隆:是什么,在哪里,为什么?
Clones in Deep Learning Code: What, Where, and Why?
摘要:
深度学习应用正变得越来越流行。深度学习系统的开发人员努力编写更高效的代码。深度学习系统在不断发展,开发时间表越来越紧,复杂性越来越高,这可能导致糟糕的设计决策。复制粘贴方法在深度学习开发人员中广泛使用,因为他们依赖于通用框架并重复类似的任务。在维护活动中,开发人员经常无法正确地将更改传播到所有克隆片段。据我们所知,还没有研究考察过深度学习开发中的代码克隆实践。鉴于克隆对传统系统的研究中报告的软件质量的负面影响,了解代码克隆对深度学习系统的特性和潜在影响非常重要。为此,我们使用NiCad工具检测了59个Python、14个C#和6个基于Java的深度学习系统以及相同数量的传统软件系统的克隆。然后,我们分析了代码克隆在深度学习和传统系统中的频率和分布。我们使用基于位置的分类法进一步分析代码克隆的分布。我们还研究了错误和代码克隆之间的相关性,以评估克隆对所研究系统质量的影响。最后,我们介绍了一个与深度学习程序相关的代码克隆分类法,并确定了克隆具有最高错误风险的深度学习系统开发阶段。我们的研究结果表明,代码克隆在深度学习系统中是一种常见的做法,而且深度学习开发人员经常从系统中远程存储库中的文件中克隆代码。此外,我们发现代码克隆在DL模型构建过程中发生得更频繁。超参数设置是克隆风险最大的阶段,因为它经常导致故障。
英文摘要:
Deep Learning applications are becoming increasingly popular. Developers of deep learning systems strive to write more efficient code. Deep learning systems are constantly evolving, imposing tighter development timelines and increasing complexity, which may lead to bad design decisions. A copy-paste approach is widely used among deep learning developers because they rely on common frameworks and duplicate similar tasks. Developers often fail to properly propagate changes to all clones fragments during a maintenance activity. To our knowledge, no study has examined code cloning practices in deep learning development. Given the negative impacts of clones on software quality reported in the studies on traditional systems, it is very important to understand the characteristics and potential impacts of code clones on deep learning systems. To this end, we use the NiCad tool to detect clones from 59 Python, 14 C# and 6 Java-based deep learning systems and an equal number of traditional software systems. We then analyze the frequency and distribution of code clones in deep learning and traditional systems. We do further analysis of the distribution of code clones using location-based taxonomy. We also study the correlation between bugs and code clones to assess the impacts of clones on the quality of the studied systems. Finally, we introduce a code clone taxonomy related to deep learning programs and identify the deep learning system development phases in which cloning has the highest risk of faults. Our results show that code cloning is a frequent practice in deep learning systems and that deep learning developers often clone code from files in distant repositories in the system. In addition, we found that code cloning occurs more frequently during DL model construction. And that hyperparameters setting is the phase during which cloning is the riskiest, since it often leads to faults.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。