The University of Sheffield
Department of Computer Science

Nasser Albunian MSc Dissertation 2015/16

Cellular Genetic Algorithm for Test Generation

Supervised by G.Fraser

Abstract

Software testing is an investigation that is conducted on software to detect the differences between the existing product and what is expected to be produced. Testing can be carried out by automatically creating test cases that test different aspects of software to ensure that it meets the specifications and requirements. 

The automation of tests generation has been considered and conducted by academia and industries. As a result, many tests generation tools are available, which can be used to automatically generate test cases for software under test. One of these tools is EvoSuite.

EvoSuite is a free tool that can be used to generate unit tests for Java classes. It applies an evolutionary algorithm, i.e. Genetic Algorithm (GA), to generate as small test suites as possible that can achieve high code coverage. However, in the GA, a population of individuals is gradually evolved toward an optimal solution. The mating of individuals occur without restrictions since a population in GA is a type of single population (i.e. Panmixia). In contrast, the individuals in the cellular model of Genetic Algorithm (cGA) are structured in a toroidal d-dimensional grid (d=1, 2). In this case, each individual can only be mated for reproduction with individuals of its neighborhood.

In this project, the cGA is applied to EvoSuite as a search-based testing technique. The main purpose is to investigate the differences between the produced tests when applying the GA and applying the cGA with different neighborhood models. The conducted experiments show that the cGA results in higher coverage than the GA when it is run on complex classes or classes that extend complex classes.