The increasingly popular adoption of source code in many critical tasks motivates the development of data augmentation (DA) techniques to enhance training data and improve various capabilities (e.g., robustness and generalizability) of these models. Although a series of DA methods have been proposed and tailored for source code models, there lacks a comprehensive survey and examination to understand their effectiveness and implications. This paper fills this gap by conducting a comprehensive and integrative survey of data augmentation for source code, wherein we systematically compile and encapsulate existing literature to provide a comprehensive overview of the field. We start by constructing a taxonomy of DA for source code models model approaches, followed by a discussion on prominent, methodologically illustrative approaches. Next, we highlight the general strategies and techniques to optimize the DA quality. Subsequently, we underscore techniques that find utility in widely-accepted source code scenarios and downstream tasks. Finally, we outline the prevailing challenges and potential opportunities for future research. In essence, this paper endeavors to demystify the corpus of existing literature on DA for source code models, and foster further exploration in this sphere. Complementing this, we present a continually updated GitHub repository that hosts a list of update-to-date papers on DA for source code models, accessible at \url{https://github.com/terryyz/DataAug4Code}.
翻译:源代码在众多关键任务中日益普及,这推动了数据增强技术的发展,以增强训练数据并提升这些模型的多项能力(如鲁棒性和泛化能力)。尽管已有系列针对源代码模型定制和提出的数据增强方法,但目前仍缺乏对其有效性和影响的全面综述与审视。本文通过系统性地整理和归纳现有文献,构建了源代码数据增强领域的全面整合性综述,填补了这一空白。首先,我们构建了源代码模型数据增强方法分类体系,并随后讨论了具有代表性及方法学启示性的典型方法。接着,我们重点阐述了优化数据增强质量的通用策略与技术,并进一步介绍了在广泛采用的源代码场景及下游任务中具有实用价值的技术。最后,我们概述了当前面临的挑战及未来研究的潜在机遇。本质上,本文旨在厘清源代码模型数据增强领域现有文献体系,并推动该领域的深入探索。作为补充,我们提供了一个持续更新的GitHub仓库,收录了关于源代码模型数据增强的最新论文列表,网址为:\url{https://github.com/terryyz/DataAug4Code}。