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}。