Genetic Algorithm for Test Suite Optimization: An Experimental Investigation of Different Selection Methods

Software Testing is an important aspect of the real time software development process. Software testing always assures the quality of software product. As associated with software testing, there are few very important issues where there is a need to pay attention on it in the process of software development test. These issues are generation of effective test case and test suite as well as optimization of test case and suite while doing testing of software product. The important issue is that testing time of the test case and test suite. It is very much important that after development of software product effective testing should be performed. So to overcome these issues of optimization, we have proposed new approach for test suite optimization using genetic algorithm (GA). Genetic algorithm is evolutionary in nature so it is often used for optimization of problem by researcher. In this paper, our aim is to study various selections methods like tournament selection, rank selection and roulette wheel selection and then we apply this genetic algorithm (GA) on various programs which will generate optimized test suite with parameters like fitness value of test case, test suite and take minimum amount of time for execution after certain preset generation. In this paper our main objectives as per the experimental investigation, we show that tournament selection works very fine as compared to other methods with respect fitness selection of test case and test suites, testing time of test case and test suites as well as number of requirements.


Introduction
Genetic Algorithm is evolutionary in nature which was proposed by John Holland [31]. From past many years, GA is used for optimization of problem in various fields like blueprint detection, robotics, artificial intelligence and many more. In order to use genetic algorithm inititially it required to present the chromosome solutions. To evaluate these chromosomes as solutions we have to define fitness function for the same [31]. This genetic algorithm uses idea of population and generation to evaluate through inspired in nature. As far as genetic algorithm is concerned the population contains number of chromosomes which is used as a individual solutions. For the next generation of populations various operators are used and these operators like selection method, crossover methods and mutation methods. As per the Darwin principles of continued existence which is called "the continued existence of the fittest", the good chromosomes are selected while the other one die away. These good chromosomes regenerate new chromosomes with fine genes which form new generation more feasible in nature. In the same way genetic algorithm have the process facsimile as an essential genetic operation for the algorithms. Presently, there are many selection techniques like tournament, roulette wheel, and tournament etc which most important for reproduction of new population. In this paper, our aim is to study various selections methods like tournament selection, rank selection and roulette wheel selection and then we apply this genetic algorithm (GA) on various programs which will generate optimized test suite with parameters like fitness value of test case, test suite and take minimum amount of time for execution after certain preset generation.
[32] Simple steps of genetic algorithm is given below.
As per genetic algorithm (GA), chromosome is selected base on fitness value. Good the fitness value of chromosome have the better chance of selection as per probability. Exclusive of any kind of revolutionize preferred chromosome is simulated into next generation of the population. On the other hand other chromosome can select for the reason that GA"s probability. For the selection of chromosome various methods are used like tournament selection, roulette wheel and rank selection many more. These methods rebelliously influence the presentation of the algorithm. Crossover method is executed on best selected parents. For the use of crossover, two chromosomes are selected and then crossover point is selected arbitrarily and pair of selected chromosomes go through the process of this method. It is important that chance of crossover is high. Two new offspring are generated by this process. The mutation method initiate with chromosome chance from the population then mutation is executed at random based on mutation method. It is very essential that chance of mutation is need to set low. [32]

Literature Survey
This literature investigation is providing information about the various operators of the genetic algorithm like selection methods, crossover methods and mutation methods. As per study also it is clearly review that these genetic algorithm operators are very much important for test case and test suite optimization. This current investigation is presented on test suite optimization problem using genetic algorithm which is a crucial challenges for test suite optimization.
Genetic Algorithm (GA) is used for optimization problems where population evolution is looking for a promising solution.
[4] Tournament and ranking selection method is work well in terms of maintaining steady pressure toward divergence where tournament selection method is more suitable for more efficient with respect to time. [46] In this paper researcher Studied the rank based selection and tournament selection method. In which it investigated that tournament selection method is performing good than rank based selection method.
[48] The quality of the last best algorithm solution can be further improved by an efficient and unfair search.
[11] As per review of this paper after investigation it shows that comparison of roulette wheel selection method and tournament selection method they prove that tournament selection is good method for performance in terms of convergence rate. [49] To select optimized set of test cases with ability to get all the faults in lesser time this takes more time to run entire test suite. This paper introduces novel test case reduction combine technique based on genetic algorithm and bee ant colony optimization. Step1. Representation of given problem using Encoding

Step2. Generate Random Initial Populations
Step3. Loop Define fitness function for chromosomes in a population Generate a new population by using GA operators Calculate fitness value of every chromosome, and then for generation of new population use selection method which is used to select best parents from the population.
Apply crossover on best selected parents for new offspring Generate new population by apply mutation method on offspring Step4. When the process complete we will be able to find a solution from output of genetic algorithm. The important things about optimization of the test suite are that get better quality software product which requires very lees amount testing and efforts. It is an expensive activity and takes a lot of time and effort.Genetic algorithm is used to generate effective test case and test suite which highly important for the testing of software product. Genetic algorithm (GA) is a nature inspired algorithm and it is evolutionary in nature. The purpose of use this algorithm is in optimization and minimization of various problems. Optimization is a process that finds the best solution for a problem. Optimization is the process of making something better. In any process, we have a set of inputs and a set of outputs. Optimization refers to finding the input values so that we get the "best" output values. The definition of "best" varies from problem to problem. The goal of optimization is to find that point or set of points in the search space.
[26] Optimization is needed because of the large test size suites, limited budgets and resource constraints; in that running a whole set of tests is impossible even for a small one modification.
[2] In the creation of a test suite, the variable input domain is the search space and its purpose is to generate test data for branch coverage criteria using evolutionary testing techniques to save computational resources. Global search techniques serve two competing goals such as exploration and exploitation. Exploration is essential to ensure that each part of the solution domain is searchable enough to provide a reliable estimate of the global optimal. Exploitation is also important to focus the search effort around the best solution found so far by searching their environment to reach a better solution.
[4] Test suite optimization is the process of effectively generation of test cases and test suite while doing testing of computer software. In this paper we have proposed improved genetic algorithm (GA) with parameters like tournament selection, multipoint crossover method and bit flipped mutation method for test suite optimization.

A. Tournament Selection
In GA, tournament selection method is used for select fittest individuals from the generation. These fittest individuals are forward to the next generation. In an N-way tournament selection, we select n individuals and execute a tournament among all individuals. Simply fittest individual is selected from selected individuals and pass to the next generation. This is the way other tournaments are performed and we get ultimate selection of individual who goes to the next generation. One of the important things in tournament selection is selection pressure which preferential best individuals. Higher the selection pressure more good individuals are preferential. With these GA will get better population in upcoming generation also convergence of a genetic algorithm is achieved by selection pressure. In case of low pressure then convergence rate is also low and similarly is high pressure then convergence is high. Tournament selection is affording selection pressure between individuals. The winner of the tournament is then passing to the next generation. [52]

Roulette Wheel
The roulette wheel selection method usually use reproduction machinist. In which individuals are selected based a chance to the proportion to the fitness. The chance of selection of section in a roulette wheel is in amount to the quantity of the essential angle of the segment. In GA entire population is partition into wheel and each section represents a chromosome.
The individual is forward to the next generation when proportion of individuals fitness to the total fitness values of an entire population. So for thatith individual in the population is selected with chance relative to F i where F i is the fitness value for every individual while keeping population size is fixed. Then the chance of ith individual is selected is [32,31] (1) Where "n" is the population size.

Rank Selection
As per the study show that roulette wheel has some issue when fitness value of individual varies quite large. For sake of simplicity consider given below figure, if best individual fitness is 75% , its occupies 75% of that circumference of the wheel so we can say that other individual have less chance to get selected for next generation. So to overcome this issue rank selection method is useful. While in rank selection, ranks are given to every individual and then taken each individual, receives fitness from ranking. According to the rank selection method the worst individual will be having rank 1, then next 2 …and so on. So it is obvious that good individual will have N fitness. This approach may be slow down the performance of genetic algorithm because fit individual may not differ from other individual. [31]

Methodology
We are using genetic algorithm (GA) with its parameters like initial population, fitness function/objective function, selection methods, crossover methods and mutation method for test suite optimization. This algorithm is used to calculate fitness value for the each chromosome which is defined in our problem. Based on these fitness values we will also calculate total fitness value of the test suite as per the problem. After calculating fitness value and testing time for the each test suite.

Initial Population
The procedure starts with a set of individuals which is called a Population. Each individual is a result. An individual is recognized by a set of parameters known as Genes. Genes are joined into a string to form a Chromosome. Using genetic algorithm these set of genes of an individual is identified using a string in terms binary values are used. For sake simplicity we dictate rere for generation of the initial population for 4-input variables student scale program.

Fitness Function
In genetic algorithm (GA), fitness function or objective is used to find how fit the particular chromosome. Fitness provides fitness value to each chromosome. The chance of that an individual or chromosome will be selected for reproduction is depends on fitness value. Our proposed fitness function or objective function for the genetic algorithm (GA) is given below.
In our proposed approach, the fitness function is used to calculate fitness value based on summation of all bits each bit string value in the given chromosome. The fitness function or objective function is given below. (2) Where, Tcri is the numbers of requirements are available in the test cases (Chromosome) or individual and n is gene length. The fitness function for calculation of test suites fitnessis given below. (3) Where, Tci is the numbers of test case are available in the test suites (population) and here n is the number of test cases (population). The fitness function for the calculation of testing time of test suite is given below. (

4)
Where, EETS = End Execution Time for Test Suite, SSTTS = Start Execution Time for Test Suite TS stand for Test Suite. Above all three functions like F(X1), F(X2) and F(X3) are the fitness function or objective functions. In which F(X1) will be calculated fitness value of the chromosomes (Test cases) and F(X2) will be calculated fitness value of the test suites and F(X3) will be calculating testing time for the each test suite which are defined in the given problem.

Selection Method
In genetic algorithm (GA) so many selection methods are available for selecting best parents from available test suite. Therefore, selection is the most important method for optimization of any problem. For reproduction or new population we will be using tournament selection technique.

Crossover Method
Similarly like selection method, there many crossover methods are available in genetic algorithm (GA). So Crossover method is the important operator in a genetic algorithm. For each pair of parents to be mated for that a crossover point is chosen at random from within the genes. In our approach we will examined various crossover methods like single point and multi point. We have used multi crossover methods in our proposed genetic algorithm (GA).

Mutation Method
Mutation is also important operator to form new offspring formation, some of their genes can be subjected to mutate with a low down casual probability. Here we have used bit flipped mutation method that implies that bits in the bit string in the chromosome can be flipped using with mutation.

Results and discussion
As per the experimental investigation, we have taken gene length is 10, number of populations are 20 and this process continue till 100th generation. For this we have examined our proposed approach on various programs likes two input variable problem it is odd or even example and three input variable problems it is triangle classifier, quadratic equation and maximum of three and four input variable it is student scale program and five input variable problem it is bubble sort and six input variable problem it is liner equation.
For test suite optimization using genetic algorithm (GA), we will be examined total twenty test suites. As per our problem definition these twenty test suites mean populations in which each test suite contain four test cases. For the comparative analysis of fitness value we have used three selection techniques like tournament selection, roulette wheel selection and rank selection. Results are clearly shows that fitness value of each individual in tournament selection is far better than other two techniques similarly; test sites fitness value is also very fine in tournament selection then other two methods.
In our experiment we use multi point crossover method because it gives better output of individuals. Finally, at last we have examined testing time of test suites with different selection techniques. As per the standard problem result tournament selection method give far better values of testing time of test suites than other two methods like rank selection method and roulette wheel selection method. For simplicity

Conclusion
We have carried out experimental investigation on various standard programs like even or odd program, maximum of three number, triangle classifier problem, quadratic equation, student scale program, and bubble sort program and linear search program. We conclude that the result with this approach of genetic algorithm with tournament selection method works very fine. As we know that crossover operator and mutation method are the most important parameter. Finally we conclude that genetic algorithm (GA) works fine with tournament selection with operators like multi point crossover operator and bit flipped mutation method. As per the experimental investigation after 100 generation, 20 population and each chromosome have gene length is 10, we conclude that 1. While Testing of test suite, time taken by tournament selection method very less as compared to other methods. 2. The fitness value of test suites is also optimized. 3. As the number of generation grows more it is clearly shown that more number of requirements is covered in test suite with our proposed approach in genetic algorithm.