arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2303.06808cs.SEcs.AI
收藏

面向文本的数据增强提升源代码学习:一项实证研究

Boosting Source Code Learning with Text-Oriented Data Augmentation: An Empirical Study

University of Luxembourg(卢森堡大学);Tianjin University(天津大学);Luxembourg Institute of Science and Technology(卢森堡科学技术研究院);Kyushu University(九州大学)

Zeming Dong, Qiang Hu, Yuejun Guo, Zhenya Zhang, Maxime Cordy, Mike Papadakis, Yves Le Traon, Jianjun Zhao

AI总结:

本文实证研究了25种面向自然语言文本的数据增强方法在源代码学习中的效果,发现部分方法能提升模型准确性与鲁棒性,且轻微破坏语法仍有益。

摘要:

近期研究展示了源代码学习的显著进展,即应用深度神经网络(DNN)来处理各种软件工程任务。与其他基于DNN的领域类似,源代码学习也需要大量高质量的训练数据才能取得成功。数据增强是一种用于生成额外训练数据的技术,在其他领域(如计算机视觉)中被广泛采用。然而,源代码学习中现有的数据增强实践仅限于简单的保持语法的方法,例如代码重构。在本文中,考虑到源代码也可以表示为文本数据,我们率先研究了原本为自然语言文本设计的数据增强方法在源代码学习中的有效性。为此,我们聚焦于代码分类任务,并针对四个关键代码问题和四种DNN架构开展了一项全面的实证研究,以评估25种数据增强方法的有效性。我们的结果揭示了能够为源代码学习带来更准确、更鲁棒模型的特定数据增强方法。此外,我们发现即使数据增强方法轻微破坏源代码语法,它们仍然具有益处。

英文摘要:

Recent studies have demonstrated remarkable advancements in source code learning, which applies deep neural networks (DNNs) to tackle various software engineering tasks. Similar to other DNN-based domains, source code learning also requires massive high-quality training data to achieve the success of these applications. Data augmentation, a technique used to produce additional training data, is widely adopted in other domains (e.g. computer vision). However, the existing practice of data augmentation in source code learning is limited to simple syntax-preserved methods, such as code refactoring. In this paper, considering that source code can also be represented as text data, we take an early step to investigate the effectiveness of data augmentation methods originally designed for natural language texts in the context of source code learning. To this end, we focus on code classification tasks and conduct a comprehensive empirical study across four critical code problems and four DNN architectures to assess the effectiveness of 25 data augmentation methods. Our results reveal specific data augmentation methods that yield more accurate and robust models for source code learning. Additionally, we discover that the data augmentation methods remain beneficial even when they slightly break source code syntax.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑