利用信息检索增强机器学习以推荐用于代码完成的真实克隆代码方法
Augmenting Machine Learning with Information Retrieval to Recommend Real Cloned Code Methods for Code Completion
摘要:
软件开发人员经常重用存储库中的源代码,因为它节省了开发时间和精力。因此,在这些存储库中积累的代码克隆通常代表重复的功能,并且是在探索性或快速开发中重用的候选者。在以前的工作中,我们介绍了DeepClone,这是一种深度神经网络模型,通过在BigCloneBench数据集上微调GPT-2模型来训练,以预测代码克隆方法。DeepClone输出生成的概率性质可能导致语法和逻辑错误,需要手动编辑输出以进行最终重用。在本文中,我们提出了一种新的方法,在DeepClone输出之上应用信息检索(IR)技术,以推荐与预测输出紧密匹配的真实克隆方法。我们已经定量评估了我们的策略,表明所提出的方法显着提高了推荐的质量。
英文摘要:
Software developers frequently reuse source code from repositories as it saves development time and effort. Code clones accumulated in these repositories hence represent often repeated functionalities and are candidates for reuse in an exploratory or rapid development. In previous work, we introduced DeepClone, a deep neural network model trained by fine tuning GPT-2 model over the BigCloneBench dataset to predict code clone methods. The probabilistic nature of DeepClone output generation can lead to syntax and logic errors that requires manual editing of the output for final reuse. In this paper, we propose a novel approach of applying an information retrieval (IR) technique on top of DeepClone output to recommend real clone methods closely matching the predicted output. We have quantitatively evaluated our strategy, showing that the proposed approach significantly improves the quality of recommendation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。