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}),收录面向源代码模型的数据增强相关最新研究工作。