Random or Genetic Algorithm Search for Object-Oriented Test Suite Generation?

Achieving high structural coverage is an important aim in software testing. Several search-based techniques have proved successful at automatically generating tests that achieve high coverage. However, despite the well- established arguments behind using evolutionary search algorithms (e.g., genetic algorithms) in preference to random search, it remains an open question whether the benefits can actually be observed in practice when generating unit test suites for object-oriented classes. In this paper, we report an empirical study on the effects of using a genetic algorithm (GA) to generate test suites over generating test suites incrementally with random search, by applying the EvoSuite unit test suite generator to 1,000 classes randomly selected from the SF110 corpus of open source projects. Surprisingly, the results show little difference between the coverage achieved by test suites generated with evolutionary search compared to those generated using random search. A detailed analysis reveals that the genetic algorithm covers more branches of the type where standard fitness functions provide guidance. In practice, however, we observed that the vast majority of branches in the analyzed projects provide no such guidance.

[1]  I. S. Wishnu T3, a Combinator-Based Random Testing Tool for Java: Benchmarking , 2014 .

[2]  Phil McMinn,et al.  Search-Based Test Input Generation for String Data Types Using the Results of Web Queries , 2012, 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation.

[3]  Mark Harman,et al.  Improving Evolutionary Testing By Flag Removal , 2002, GECCO.

[4]  Yann-Gaël Guéhéneuc,et al.  Instance Generator and Problem Representation to Improve Object Oriented Code Coverage , 2015, IEEE Transactions on Software Engineering.

[5]  Gordon Fraser,et al.  Handling test length bloat , 2013, Softw. Test. Verification Reliab..

[6]  Paolo Tonella,et al.  Evolutionary testing of classes , 2004, ISSTA '04.

[7]  Gordon Fraser,et al.  Testing Container Classes: Random or Systematic? , 2011, FASE.

[8]  Michael D. Ernst,et al.  Randoop: feedback-directed random testing for Java , 2007, OOPSLA '07.

[9]  Gordon Fraser,et al.  The Seed is Strong: Seeding Strategies in Search-Based Software Testing , 2012, 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation.

[10]  I. S. W. B. Prasetya T3, a Combinator-Based Random Testing Tool for Java: Benchmarking , 2013, FITTEST@ICTSS.

[11]  Phil McMinn,et al.  Search‐based software test data generation: a survey , 2004, Softw. Test. Verification Reliab..

[12]  Gordon Fraser,et al.  Bytecode Testability Transformation , 2011, SSBSE.

[13]  Joachim Wegener,et al.  Evolutionary test environment for automatic structural testing , 2001, Inf. Softw. Technol..

[14]  Mark Harman,et al.  Automated web application testing using search based software engineering , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

[15]  Vinicius H. S. Durelli,et al.  Quantifying the Characteristics of Java Programs That May Influence Symbolic Execution from a Test Data Generation Perspective , 2014, 2014 IEEE 38th Annual Computer Software and Applications Conference.

[16]  GORDON FRASER,et al.  A Large-Scale Evaluation of Automated Unit Test Generation Using EvoSuite , 2014, ACM Trans. Softw. Eng. Methodol..

[17]  A. Vargha,et al.  A Critique and Improvement of the CL Common Language Effect Size Statistics of McGraw and Wong , 2000 .

[18]  André Baresel,et al.  Evolutionary Testing of Flag Conditions , 2003, GECCO.

[19]  Gordon Fraser,et al.  Whole Test Suite Generation , 2013, IEEE Transactions on Software Engineering.

[20]  Gordon Fraser,et al.  EvoSuite: automatic test suite generation for object-oriented software , 2011, ESEC/FSE '11.

[21]  Luciano Baresi,et al.  TestFul: An Evolutionary Test Approach for Java , 2010, 2010 Third International Conference on Software Testing, Verification and Validation.

[22]  Tim Menzies,et al.  Nighthawk: a two-level genetic-random unit test data generator , 2007, ASE.

[23]  Gordon Fraser,et al.  Improving search-based test suite generation with dynamic symbolic execution , 2013, 2013 IEEE 24th International Symposium on Software Reliability Engineering (ISSRE).

[24]  Yannis Smaragdakis,et al.  JCrasher: an automatic robustness tester for Java , 2004, Softw. Pract. Exp..

[25]  Gordon Fraser,et al.  A Memetic Algorithm for whole test suite generation , 2015, J. Syst. Softw..

[26]  Manuel Oriol,et al.  Testing .NET Code with YETI , 2010, 2010 15th IEEE International Conference on Engineering of Complex Computer Systems.

[27]  Mark Harman,et al.  Testability transformation , 2004, IEEE Transactions on Software Engineering.

[28]  Mark Harman,et al.  A Theoretical and Empirical Study of Search-Based Testing: Local, Global, and Hybrid Search , 2010, IEEE Transactions on Software Engineering.