Training a deep learning model on source code has gained significant traction recently. Since such models reason about vectors of numbers, source code needs to be converted to a code representation before vectorization. Numerous approaches have been proposed to represent source code, from sequences of tokens to abstract syntax trees. However, there is no systematic study to understand the effect of code representation on learning performance. Through a controlled experiment, we examine the impact of various code representations on model accuracy and usefulness in deep learning-based program repair. We train 21 different generative models that suggest fixes for name-based bugs, including 14 different homogeneous code representations, four mixed representations for the buggy and fixed code, and three different embeddings. We assess if fix suggestions produced by the model in various code representations are automatically patchable, meaning they can be transformed to a valid code that is ready to be applied to the buggy code to fix it. We also conduct a developer study to qualitatively evaluate the usefulness of inferred fixes in different code representations. Our results highlight the importance of code representation and its impact on learning and usefulness. Our findings indicate that (1) while code abstractions help the learning process, they can adversely impact the usefulness of inferred fixes from a developer's point of view; this emphasizes the need to look at the patches generated from the practitioner's perspective, which is often neglected in the literature, (2) mixed representations can outperform homogeneous code representations, (3) bug type can affect the effectiveness of different code representations; although current techniques use a single code representation for all bug types, there is no single best code representation applicable to all bug types.
翻译:源代码的深层次学习模型最近获得了显著的牵引力。 由于这些模型对数字矢量的原因, 源代码需要在矢量之前转换成代码代表。 已经提出了许多方法来代表源代码, 从符号序列到抽象的语法树。 但是, 没有系统的研究来理解代码表达法对学习绩效的影响。 我们通过一个受控实验, 检查各种代码表达法对基于深层次学习的程序修复模型准确性和实用性的影响。 我们训练了21个不同的基因化模型, 显示基于名称的错误的修复方法, 包括14个不同的代码表达法、 4个错误和固定代码的混合表达法以及3个不同的嵌入。 我们评估的是, 模式在各种代码表达法中产生的建议是否自动补补补, 意味着它们可以转换成一个有效的代码, 可以用来修正错误的代码。 我们还进行一项开发性研究, 对不同代码表达法的实用性作用进行定性评估。 我们的结果表明, 代码代表法的单一代表法的重要性及其对学习和实用性的影响。 我们的发现:(1) 代码的抽象表达法有助于学习过程的精细度,, 分析方法的精细的精细的精细的精细分析,, 精细的精细的精细的精细的精细的精细的精细的精细的精细的精细的精细。