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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Dong, Zeming, Hu, Qiang, Guo, Yuejun, Zhang, Zhenya, Cordy, Maxime, Papadakis, Mike, Traon, Yves Le, Zhao, Jianjun
Format: Preprint
Veröffentlicht: 2023
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866915140331372544
author Dong, Zeming
Hu, Qiang
Guo, Yuejun
Zhang, Zhenya
Cordy, Maxime
Papadakis, Mike
Traon, Yves Le
Zhao, Jianjun
author_facet Dong, Zeming
Hu, Qiang
Guo, Yuejun
Zhang, Zhenya
Cordy, Maxime
Papadakis, Mike
Traon, Yves Le
Zhao, Jianjun
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2303_06808
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Boosting Source Code Learning with Text-Oriented Data Augmentation: An Empirical Study
Dong, Zeming
Hu, Qiang
Guo, Yuejun
Zhang, Zhenya
Cordy, Maxime
Papadakis, Mike
Traon, Yves Le
Zhao, Jianjun
Software Engineering
Artificial Intelligence
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.
title Boosting Source Code Learning with Text-Oriented Data Augmentation: An Empirical Study
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2303.06808