Software Testing Using Genetic Algorithm: Research and Practice


Please note! This essay has been submitted by a student.

Download PDF

The software should be reliable and free from errors. Software testing is an important part of the software development life cycle. Software testing is the critical element of the software quality assurance and gives the ultimate review of the specification, analysis, design and development. As the human is prone to errors, the software development life cycle should be accompanied by the quality assurance mechanisms. Hence, the software testing comes into the picture. Time, cost and other parameters does not permit us to perform the exhaustive testing. This arise the need for the automated testing process. The intention is to find maximum the number of errors and with the minimum effort and time. This paper presents the optimization of testing in software engineering using the Genetic algorithm (GA). Genetic Algorithm is used for the solving of the nonlinear problem. The software path clusters are generated by Genetic algorithm (GA) in accordance with the criticality of the path and tested. The paper discusses some key concepts of the Genetic Algorithm viz. Selection, Crossover, Mutation. The paper shows that GA has positive influence on the performance of the software test cases.

Essay due? We'll write it for you!

Any subject

Min. 3-hour delivery

Pay if satisfied

Get your price

Software Testing is acquainted similarly as with evacuate the mistakes encountered amid the plan and the execution stage. The nearness of blunders in framework and application software causes momentous increment in the expenses, predominantly due to the harms incited and the requirement for the revisions for the relating mistakes. Software Testing is the movement meant to find the unavoidable mistakes in the software items in the most ideal manner conceivable as to distinguish the greatest number of blunders and in the meantime limit the testing cost and time. In light of the parameters like proficiency, likelihood, ease of use, ability, and so forth testing is utilized to produce the estimation about the nature of the software. Testing in the Software advancement life cycle is exceptionally urgent stage as it upgrades the unwavering quality of the software. Unwavering quality can be characterized as the likelihood that the framework works without blunders inside a given timeframe.

Testing expends part of assets as far as time and memory for the location of the blunders. In this manner defenseless to streamlining for example the best harmony between the quantity of experiments created and the normal incentive for the disclosure of the mistakes that must be accomplished. Based on the intrinsic likelihood of the event of the mistake, the estimation of the experiment execution might be relegated.

Testing should be possible either physically or naturally by utilizing testing instruments. It is discovered that computerized software testing is superior to manual testing. In any case, not many test information age instruments are economically accessible today. Different strategies have been proposed for producing test information or experiments consequently. As of late, part of work is being accomplished for experiments age utilizing delicate figuring systems like fluffy rationale, neural systems, GA, hereditary programming and developmental calculation giving keys to the issue territories of software testing. Hereditary Algorithm create ideal number of experiments to perform viable testing. Hereditary Algorithm is utilized to perform different software testing methods, for example, black box and white box testing. In this paper, different software testing systems performed utilizing Genetic Algorithm have been introduced.

Introduction to genetic algorithm

Genetic algorithm falls in the classification of transformative algorithms which are utilized for tackling numerous genuine issues. GA is a powerful enhancement system and pursuit technique. The genetic algorithm is enlivened by the advancement hypothesis of nature for an example method for choosing the fittest people. On account of programming testing, the conceivable arrangement experiments are treated as the populace of chromosomes. Every chromosome is comprised of a string of double digits called quality. For the situation considered attributes are treated as qualities. This underlying populace (conceivable experiments) can be created in an arbitrary way. One of the conceivable ways for creating can be utilizing covetous algorithm.

Genetic algorithms will in general flourish in a domain in which there is an extensive arrangement of hopeful arrangements and in which the hunting space isn’t good and has numerous slopes and valleys. Genuine, genetic algorithms can do well in any condition, yet they may be extraordinarily clobbered by more circumstance explicit algorithms in the more straightforward inquiry spaces. In this way, you should remember that genetic algorithms are not generally the best decision in irregular situations. Now and then they may take a long time to run and are in this way not constantly plausible for ongoing use. They are, in any case, a standout amongst the most dominant techniques with which excellent arrangements are made rapidly to an issue. There are not much fundamental philosophy/Terminology that will be utilized while actualizing genetic calculation like:

  • Individual – Possible solutions.
  • Population – Set of all individuals.
  • Search Space – All possible solutions to the specified problem
  • Chromosome – Blueprint for an individual
  • Trait – Possible aspect of an individual entity.
  • Allele – Possible settings for a trait
  • Locus – The position of a gene on the chromosome
  • Genome – Collection of all chromosomes for an individual entity.


Genetic Algorithm:

  • Initialize (population);
  • Evaluate (population);
  • While (criteria not satisfied)



  • Crossover (population);
  • Mutation (population);
  • Evaluate (population);


It consists of three basic operations: selection, crossover, mutation.


Selection is connected to choose chromosomes from the current populace dependent on their wellness. Wellness can be characterized as the capacity to endure and replicate in nature. The wellness capacity can be characterized dependent on the loads doled out to every one of the likelihoods that can happen. The higher weight demonstrates the criticality of the way to test the information age. For example, the loads can be delegated in such a way, that more weight is given to circles and confused control exchange contrasted with the successive execution. The wellness work is utilized to choose better chromosomes for better people to come. There are many methods of selection: Random Selection, Tournament Selection and Roulette Wheel Selection.


  • Step – 1. Calculate Sum S of the chromosome fitness.
  • Step – 2. Generate random number R from the interval 0, S.
  • Step – 3. Go to the population and sum from 0 to S. When S sum is larger than random number R than return the chromosome.



The crossover is completed over the pair of chosen chromosomes. For the pair of chosen chromosomes, swapping of the succession of bits is done. The procedure is rehashed with various guardians until the planned populace is accomplished.

  • Parent A: aAbBcC
  • Parent B: 123456
  • Child (Offspring): aAb45


For example, the chromosomes are 11001011 (Parent A) and 11011101 (Parent B). Presently after the crossover procedure, the outcome is 11011111 (Child). This youngster is one of the conceivable outcomes from both the parent. Another model is aAbBcC (Parent A) and 123456 (Parent B) are chromosomes and Child is aAb45 is the one plausibility out of many.


  • Adjustment of chromosomes happens in mutation.
  • The principal point is to acquire assorted variety the populace by presenting great characteristics.


Procedure of Genetic Algorithm (GA)

This fundamental procedure normally includes making an underlying arrangement of arbitrary arrangements (populace) and assessing them. In the choice procedure, the better arrangements are recognized (guardians) and they are utilized to produce another new arrangement (youngster). This new populace is then assessed and the procedure for producing another esteem proceeds until the last arrangement is come to.

A portion of the terms in the Genetic Algorithm is utilized from the organic word. For example, Potential arrangement as chromosomes and the administrators which are utilized to create new tyke arrangements are, for example, hybrid and change are gotten from nature.

Hereditary Algorithms were utilized for single target hunt and advancement calculations. The utilization of chromosomes, hereditary administrators, a determination component and an assessment instrument are normal to most hereditary calculations.

Chromosome: the parameter is required in our capacity and groups them into a string. So the all chromosome will completely portray a capacity.

The normal methodology when working with the hereditary calculations is to begin by making a ‘populace’ of irregular chromosome for example 100. We can test every one individual and score it or we can utilize the phrasing ‘Assess its Fitness (work)’.


This determined wellness will assist us with evaluating the effectiveness of the technique utilized. What’s more, further to expand the productivity of the test outcome we can change the information parameters and acquire values for the diverse number of populace.

4. Software Testing using Genetic Algorithm

  • Genetic Algorithms used with White Box Testing and Black Box Testing to generate the test cases.


4.1 White Box Testing

  • White box testing checks the inside conduct of the program. Analyzer manages code, circle, and condition articulations. In a portion of the examination work talk about the code inclusion and information stream testing utilizing Genetic Algorithm.


4.1.1 Path Testing:

The general population took a shot at a strategy to test produced information utilizing a hereditary calculation. It utilizes a weighted Control Flow Graph (CFG). To find the mistakes, way testing spreads each conceivable way in the program. In the event that there are various circles in the program, at that point it contains an interminable number of the way. Our calculation takes a shot at a control stream chart (GCF). Control Flow Graph (CFG) handles free way for another arrangement of articulations or condition. And furthermore every way should go at any rate once in the testing.

In way testing, we manage a program to draw a control stream chart. There are a few criteria to be followed in way testing as each freeway ought to be secured and testing time doesn’t surpass the decided time. The principle objective is to perform way testing utilizing GA is programming quality control.

GA acknowledges defuse ways of the program to be tried. It characterizes the quantity of information factors and the utilization of each contribution with their definition. Likewise, it characterizes the populace size and likelihood of both hybrid and change. To perform information stream testing, locate the quantity of experiments to defuse. There is a whole number vector to store the navigate to each defuse. Estimation of whole number vector in the begin is zero. It utilizes as a counter to tally or check the adequacy of populace.

4.1.2 Data Flow Testing:

To perform powerful testing, the age of experiments or test information is a progressively critical perspective in programming testing. Test information age is tedious procedure than the computerized test information age. Programming testing is an advancement issue because of exertion and tedious procedure. In this way, the improvement procedures GA are utilized to produce appropriate information and techniques were shrouded each freeway in CFG.

4.2 Black Box Testing

This testing is test the functions of the software and that software full fill their specification and also their user requirement.

4.2.1 Functional Testing:

To improve the adequacy of the experiments a few people have chipped away at the usage of transformative procedures. To perform testing, ‘great’ experiments are to be considered or to be assessed. Also, all ‘terrible’ experiments are disposed of. In this testing, we need to check the elements of the product. In GA, concerning the populace, we are creating arbitrary experiments as for the populace and instating numerical qualities to it. And after that finding the number of blunders by the estimation of wellness work. Presently the all great populace go about as experiments and others are dispensed with and along these lines, we can consider the arrangement of all experiments. There are various cycle performed to all-inclusive community or experiments by transformation and consequently, we can say that the practical testing is utilizing Genetic Algorithm expected to the blame uncovering experiments.

4.2.2 Regression Testing:

The altered programming is retest by Regression testing. Here in this testing, we are thinking about the issue of prioritization of experiments. Here is the calculation to prioritization of experiments utilizing GA:

  • Step – 1. Starting populace producing (Generate ‘n’ number of the chromosome, for example, c1, c2, c3… cn.)
  • Step – 2. Introduction of the populace (set reasonable experiments = No. of the chromosome (n))
  • Step – 3. Wellness work estimation set. (Wellness Function = all out code inclusion)
  • Step – 4. Based on wellness work select appropriate populace (Top 2 chromosome from the rundown)
  • Step – 5. Accomplish for chosen chromosomes while (all conditions are valid) Crossover Mutation dispense with all copies End while End for
  • Step – 6. Upgraded arrangement check. On the off chance that the arrangement isn’t attainable, at that point go to step – 5. Else END.


Utilizing a Genetic Algorithm (GA), the ideal arrangement is created by an irregular populace and it changed to the new populace by utilizing hybrid and transformation task.

The wellness work is utilized to discover the most extreme blunders in the financial plan and the base measure of time. Likewise, it is utilized to choose the populace as indicated by the issue. After that we are applying hybrid and transformation in which hybrid is swapping the qualities and transformation is changing the bits and they create the new populace. In the event that there are still blunders recognized in the recently created populace, on the other hand, this procedure is connected until the ideal arrangement isn’t found.

 Application of Genetic Algorithm (GA)

Hereditary Algorithm has been utilized for taking care of complex issues, (for example, NPC and NP-hard), for AI and is likewise utilized for advancing basic test programs. They are an extremely powerful method for rapidly finding a sensible answer for a perplexing issue. Hereditary calculations are most productive and powerful in a scan space for which little is known. On the other hand, hereditary calculations can be utilized to create answers for issues working just in the test condition and digresses once you attempt to utilize them in reality. So when putting essentially, the hereditary calculation can be utilized to make answers for issues that are most certainly not exceptionally simple to compute and break down.


The hereditary calculation can be effectively connected to different non-straight issues with the end goal of improvement. Programming testing is vital for the improvement of mistake-free programming. The hereditary calculation finds the greatest mistakes and limits the testing cost both regarding memory expended and time required in the ideal manner conceivable by building up the exchange off between the two. GA encourages the engineers to find the mistakes in the code utilizing programmed experiment age. The model showed in this paper utilizes the straightforward hereditary the calculation which centers on the determination of experiments and natty gritty examination of them for the blunder revision.

writers online
to help you with essay
banner clock
Clock is ticking and inspiration doesn't come?
We`ll do boring work for you. No plagiarism guarantee. Deadline from 3 hours.

We use cookies to offer you the best experience. By continuing, we’ll assume you agree with our Cookies policy.