SmartPaste:学习适应Source Code
SmartPaste: Learning to Adapt Source Code
摘要:
深度神经网络已被证明在一系列自然语言任务中取得了成功,如机器翻译和文本摘要。虽然最近考虑了源代码(即形式语言)的任务,但这一领域的大多数工作并不试图利用其已知语法和结构所提供的独特机会。在这项工作中,我们介绍SmartPaste,第一个任务,需要使用这些信息。该任务是程序修复问题的一个变体,需要将给定的(粘贴的)代码片段适应周围的现有源代码。作为第一个解决方案,我们设计了一组深度神经模型,这些模型学习以数据流敏感的方式表示每个变量位置和变量使用的上下文。我们的评估表明,我们的模型可以在许多情况下学习解决SmartPaste任务,达到58.6%的准确率,同时学习变量使用的有意义的表示。
英文摘要:
Deep Neural Networks have been shown to succeed at a range of natural language tasks such as machine translation and text summarization. While tasks on source code (ie, formal languages) have been considered recently, most work in this area does not attempt to capitalize on the unique opportunities offered by its known syntax and structure. In this work, we introduce SmartPaste, a first task that requires to use such information. The task is a variant of the program repair problem that requires to adapt a given (pasted) snippet of code to surrounding, existing source code. As first solutions, we design a set of deep neural models that learn to represent the context of each variable location and variable usage in a data flow-sensitive way. Our evaluation suggests that our models can learn to solve the SmartPaste task in many cases, achieving 58.6% accuracy, while learning meaningful representation of variable usages.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。