Towards Generating Unit Test Codes Using Generative Adversarial Networks

2Citations
Citations of this article
9Readers
Mendeley users who have this article in their library.

Abstract

Unit testing is one of the important software development steps to ensure the software’s quality. Despite its importance, unit testing is often neglected since it requires a significant amount of time and effort from the software developers to write them. Existing automated testing generating systems from past research still have shortcomings due to the Genetic Algorithm (GA) limitations to generate the appropriate unit test codes. This study explores the feasibility of using Generative Adversarial Networks (GAN) models to generate unit test code with the ability of GAN to cover GA’s drawbacks. We perform experimentations using four state-of-the-art GAN models to generate basic unit test codes and compare the results by analyzing the generated output codes using novel metrics proposed from past studies as well as performing qualitative evaluation on the generated outputs. The results show that the generated codes have satisfactory quality scores (BLEU-2 of around 99%) from the models and adequate diversity score (NLL-Div and NLL-Gen) in most models. Our study shows positive indications and potential in the use of GAN for automatic unit test code generation and suggests recommendations for future studies in GAN-based unit test code generation systems.

Cite

CITATION STYLE

APA

Alibasa, M. J., Purwanto, R. W., Priyadi, Y., & Riskiana, R. R. (2022). Towards Generating Unit Test Codes Using Generative Adversarial Networks. Jurnal RESTI, 6(2), 305–314. https://doi.org/10.29207/resti.v6i2.3940

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free