Abstract

With the rapid increase of software scale and complexity, the cost of traditional software testing methods will increase faster than the scale of software. In order to improve test efficiency, it is particularly important to automatically generate high-quality test cases. This paper introduces a framework for automatic test data generation based on the generative adversarial network (GAN). GAN is employed to train a generative model over execution path information to learn the behavior of the software. Then we can use the trained generative model to produce new test data, and select the test data that can improve the branch coverage according to our proposed selection strategy. Compared to prior work, our proposed method is able to handle programs under test with large-scale branches without analyzing branch expressions. In the experiment, we exhibit the performance of our method by using two modules in GNU Scientific Library. In particular, we consider the application of our method in two testing scenarios; unit testing and integration testing, and conduct a series of experiments to compare the performance of three types of GAN models. Results indicate that the WGAN-GP shows the best performance in our framework. Compared with the random testing method, the WGAN-GP based framework improves the test coverage of five functions out of the seven in the unit testing.

Highlights

  • Software testing is one of the most important activities to build a reliable software system

  • SOFTWARE TESTING WITH generative adversarial network (GAN) We propose a framework for automated test data generation and aim to achieve the full branch coverage in software testing

  • Our experiments aim to evaluate which type of GAN is more suitable for the framework, and which test level is suitable for our framework

Read more

Summary

INTRODUCTION

Software testing is one of the most important activities to build a reliable software system. A common procedure of software testing is (i) to execute the software under test (SUT) with the inputs of test cases, and (ii) to compare the test outcomes with the expected ones. There have been different approaches for automation of software testing with AI, and they are roughly divided into three categories: 1) Search-based software testing (SBST): The SBST is a method to generate test inputs with search techniques, e.g., meta-heuristic optimization methods, so that it can achieve high coverage [1]. We propose a software testing framework with generative adversarial networks (GANs). We consider a GAN model to generate test data for the SUT, and a test strategy to increase the test coverage with the GAN. In our model, the discriminator learns program execution paths for SUT and the generator generates test cases including test inputs and expected paths.

GAN: GENERATIVE ADVERSARIAL NETWORK
EXPERIMENT
RESULTS
CONCLUDING REMARK

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.