EvoObj Dev Docs

This site is to provide developer documentation for EvoObj [1] and by extension EvoSuite [2]. This site has been created for educational purposes only and is in no way endorsed or acknowledge by EvoObj nor EvoSuite.

EvoObj/EvoSuite Background

EvoSuite is a well known Search Based Test Generation tool to automatically produce testcases for a program. EvoObj extended EvoSuite by building an Object Construction Graph in order to produce better seeds for programs with object type inputs. Although EvoSuite provides documentation of how to extend it, the examples provided demonstrate how to make modular modifications such as adjusting fitness functions or genetic algorithm operators. Below is an end to end workflow of what happens when invoking EvoSuite, including the modifications provided by EvoObj.

EvoSuite Workflow

This workflow assumes that -Dstrategy==EVOSUITE in order to kick off Whole Test Suite generation. It also assumes that -Dalgorithm==MONOTONIC_GA. Using alternative strategies and algorithms will cause slightly different execution paths, however understanding this flow will help when understanding how the more complicated strategies work.

Confusing Points

  • TestSuite vs TestCase/TestChromosome

    A TestSuiteChromosome is made up of many TestChromosomes. Each TestChromosome has a 1:1 correspondance with a TestCase.

  • TestSuiteFitness vs FitnessFactory

    TestSuiteFitnessFunctions evaluates fitness for a TestSuiteChromosome. A FitnessFactory extends AbstractFitnessFactory which implements TestFitnessFactory these also get fitness of a TestSuiteChromosome. However, each one of these factories takes a specific implementation of TestFitnessFunction. These FitnessFunctions get the fitness for a TestChromosome. The advantage of a FitnessFactory is that they can return coverage goals whereas TestSuiteFitnessFunctions only return fitness.

References

[1] Lin, Y., Ong, Y.S., Sun, J., Fraser, G. and Dong, J.S., 2021. Graph-based seed object synthesis for search-based unit testing. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (pp. 1068-1080).
[2] Fraser, G. and Arcuri, A., 2011. Evosuite: Automatic Test Suite Generation for Object-Oriented Software. In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering (pp. 416-419).

Search icon by Icons8