QA City

Most Popular

Using Genetic Algorithm In Software Testing

By SiliconIndia   |     |    1 Comments
Print Email

Genetic Algorithm is the new trend coming in software testing as almost everyone can gain benefits from Genetic Algorithms by encoding solutions of a given problem to chromosomes in GA, and compare the relative performance or fitness of solutions. They have been used for problem-solving and for modeling. GAs are applied to many scientific, engineering problems, in business and entertainment. Neuro Dimension & Evolver are the companies who are using Genetic Algorithm.

According to a research paper published by KNIT (Kamla Nehru Institute of Technology) India, the 2 main concepts that contribute to Genetic Algorithm are:
Genetic Algorithm (GA):

Fig: GA Approach to Focused Software Testing

They are developed through the inspiration of a family of computational models. GAs are optimization algorithms based on natural genetics and selection mechanisms. GA is used to find the solutions to optimization & search problems and the major usage of GA is to identify the failures while testing which are more severe & likely to occur for the user. GAs are useful and efficient when the search space is large, complex or poorly understood; when domain knowledge is scarce or expert knowledge is difficult to encode to narrow the search space, when no mathematical analysis is available and when traditional search methods fail.

The very basic idea of GA is to encode the values of the parameters of an optimization problem in a chromosome (it can be a binary string or a more elaborate data structure) which is evaluated by an objective function.

GAs have been successfully applied to a wide range of applications including optimization, scheduling & design problems and also been applied in many optimization problems for generation of test plants for functionality testing, feasible test cases & in many other areas. GAs can also be applied in many scientific, engineering problems, in business and entertainment including automatic programming, machine & robot learning, economic models, immune system model, ecological models, population genetic models, interaction between evolution & learning, models of social system.

Basic steps of a typical Genetic Algorithm:
Procedure GA
Initialize Population;
While termination condition not satisfied do
{Evaluate current population;
Set current population equal to be the new child population;}

The above algorithm starts by initializing a set of chromosomes & at the end of each generation each chromosome is evaluated & modified according to the no. of generation operations in order to produce a new population.
This algorithm will iterate until the population has evolved to form a solution to the problem or until the maximum number of generations have been performed.

Mutation Testing:
It is a fault based testing technique in which tester used to find the effectiveness of the test cases. This test measures how "good" the tests are by inserting faults into the program under test. The purpose here is to maintain the diversity in generation to prevent premature convergence to a local optimal solution.

Basic operations that are involved in mutation testing:
Flip Mutator - According to the range specified by the alleles this will replace a single gene in a chromosome to a random value.
Swap Mutator - This will randomly swap a number of genes of the chromosome.
Gaussian Mutator - This will pick a new value among the current value using Gaussian distribution.

Don't Miss
Experts on QA
Swaid Qadir Bhat
Sr System Architect
Virtusa Corporation
Subhash  Motwani
Prasad Rao Pasam
Ayaskanta  Mohanty
Managing Director
TATWA Technologies
Rajesh  Dagar
Software Architect
Connect Icon Pvt Ltd
Yasar  Khuthub
Software QA Manager
Azure IT Solutions
Sunil  Bhat
Project Management
HCL Infosystems Limi
Sharad  Agarwal
Team Lead
Write your comment now
Reader's comments(1)
1: I am currently pursuing research from Delhi University in this area and would like to know of any current research going on over the globe, and if possible any RA opportunities.
Posted by:Chayanika - 07 Jun, 2012
This report is the result of the largest public-private sector rese...
For those not familiar with the Coverity Scan™ service, i...