SlideShare a Scribd company logo
1 of 2
Download to read offline
Rupinder Kaur et al. Int. Journal of Engineering Research and Application www.ijera.com
Vol. 3, Issue 5, Sep-Oct 2013, pp.573-574
www.ijera.com 573 | P a g e
Generation of Test Data Using Genetic Algorithm
Rupinder Kaur*, Sandeep Kaur Dhanda*
*A.P., CSE/IT Department, Baba Banda Singh Bahadur Engineering college, Fatehgarh Sahib (Punjab), India
ABSTRACT
Genetic Algorithm has been implemented to automate the generation of test data. The test data was derived from
the program's structure with the aim to traverse every line of code in the software. This work uses fitness
function and variables are represented in binary code. The power of using Genetic Algorithm lies in its ability to
handle input data which may be of complex structure. Thus, the problem of test data generation is treated
entirely as an optimization problem. The advantage of Genetic Algorithm is that through the search and
optimization process, test sets are improved. The work has been tested with the help of Triangle Type
Classification program.
Keywords- Genetic Algorithm, Crossover, Mutation, Test Data, Fitness Function
I. INTRODUCTION
Software testing is one of the main
realistic methods to increase the confidence of
the programmers in the correctness and reliability
of software. Generating adequate test data manually
is labour intensive and time-consuming process. This
problem has motivated researchers to create test data
generators that can examine a program’s structure
and generate adequate test data automatically. It is
not a small task to judge whether a finite set of input
test data is adequate or not. The goal is to uncover as
many faults as possible with a potent set of a
constrained number of tests. Obviously, a test series
that has the potential to uncover many faults is better
than one that can only uncover few. Random test data
generation consists of generating test inputs at
random, in the hope that they will exercise the
desired software features. Often, the desired inputs
must satisfy some constraints, and this makes a
random approach likely to fail [2]. Software testing
automation is not a straightforward forward process.
For years, many researchers have proposed different
methods to generate test data automatically, i.e.
different methods for developing test data generators
[1, 5]. Genetic algorithms that can automatically
generate test cases to test selected path. This
algorithm takes a selected path as a target and
executes sequences of operators iteratively for test
cases to evolve [3]. A method for optimizing
software testing efficiency by identifying the most
critical path clusters in a program [4].This paper has
been organized in four sections. Section II describes
the introduction to genetic algorithm, section III
introduces methodology used to achieve the
objectives and section IV shows the final results and
their discussion.
II. GENETIC ALGORITHM
Genetic Algorithms were invented by John
Holland in the 1960s and were developed by Holland
and his students and colleagues at the University of
Michigan .Holland’s original goal was not to design
algorithms to solve specific problems, but rather to
formally study the phenomenon of adaptation as it
occurs in nature and to develop ways in which the
mechanisms of natural adaptation might be imported
into computer systems. The Genetic Algorithm (GA)
starts by creating an initial population of individuals,
each represented by randomly generated genotype.
The fitness of individuals is evaluated in some
problem-dependent way, and the GA tries to evolve
highly fit individuals from the initial population.
In translating the concepts of genetic algorithms to
the problem of test-data generation, the following
tasks are performed:
• First of all consider the population to be a set of
test.
• Find the set of test data that represents the initial
population. This set is randomly generated
according to the format and type of data used by
the program under test.
• Determining the fitness of each individual which
is based on a fitness function that is problem-
dependent.
• Select two individuals that will be mated to
contribute to the next generation.
• Apply the crossover and mutation processes.
Various operators of genetic algorithm have
been used. The selection operator chooses two
individuals from a generation to become parents for
the recombination process (crossover and mutation).
There are different methods of selecting individuals,
e.g. randomly or with regard to their fitness value.
The crossover operation is used to produce the
descendants that make up the next generation.
Mutation operation picks a gene at random and
changing its state according to the mutation
probability. In a binary code, this simply means
changing the state of a gene from a 0 to a 1 or vice
RESEARCH ARTICLE OPEN ACCESS
Rupinder Kaur et al. Int. Journal of Engineering Research and Application www.ijera.com
Vol. 3, Issue 5, Sep-Oct 2013, pp.573-574
www.ijera.com 574 | P a g e
versa. A fitness value of an individual is the measure
of its strength to survive in the next generation. It
reflects the chance an individual has to be present
directly in the next generation or to be selected for
mating with other individuals in the current
generation to produce children for next generation.
III. METHODOLOGY USED
Single point crossover and bit inversion
mutation methods are used in genetic algorithm.
Selection of values is based on their fitness function
by using roulette wheel selection method.
The following code fragment is used to check the
flow of program. All the statements are given
weights. The assigned weights will be used to
calculate the fitness function of each test case input
given to genetic algorithm.
0. int a,b,c;
1. int match = 0;
2. if (a = b)
3. match = match + 1;
4. if (a == c)
5. match = match + 2;
6. if (b == c)
7. match = match + 3;
8. if (match == 0) /* if a, b and c are not equals to
each other*/
9. if (a + b <= c)
10. printf("Not a triangle"); return 0.0; }
11. else if (b + c <= a) {
12. printf ("Not a triangle"); return 0.0; }
13. else if (a + c <= b) {
14. printf("Not a triangle"); Return 0.0; } else {
15. double p = (a + b + c)/2.0; printf ("Scalene");
16. return sqrt (p*(p-a)*(p-b)*(p-c)); /* compute
square */ }
17. else if (match == 1) /* if (a = b ≠c) */
18. if (a + b <= c) {
19. printf ("Not a triangle"); return 0.0; }
20. double h = sqrt (pow (a, 2) - pow(c/2.0, 2));
printf ("Isosceles");
21. return (c*h)/2.0; /* compute square */ }
22. else if (match == 2) /* if (a = c ≠b) */
23. if (a + c <= b) { 24. printf ("Not a triangle");
return 0.0; } else {
25. double h = sqrt (pow (a, 2) - pow (b/2.0, 2));
printf ("Isosceles");
26. return (b*h)/2.0; /* compute square */ }
27. else if (match == 3) /* if (b = c ≠a) */
28. if (b + c <= a) {
29. printf ("Not a triangle."); return 0.0; } else {
30. double h = sqrt (pow (b, 2) - pow (a/2.0, 2));
printf ("Isosceles");
31. return (a*h)/2.0; /* compute square */ } else { /*
if (a = b= c) */ printf( "Equilateral");
32. return (sqrt (3.0)*a*a)/4.0; /* compute square*/
}
Fig 1 Triangle Type Determination Program
IV. RESULTS
In order to compare the effectiveness of
using GA, it has been compared with random testing.
The following graph shows that the random testing is
good enough for small size of input but as the size
increases, the execution time for the program
increases. So, genetic algorithm works good in that
case
Fig 2 CPU Time taken to run genetic algorithm and
random numbers
REFERENCES
[1] Mansour N, Miran Salame,” Data
Generation for PathTesting”, Software
Quality Journal, 12, 121–136, 2004,Kluwer
Academic Publishers.
[2] Michael, C.C., McGraw, G.E., Schatz,
M.A., Walton, C.C., “ Genetic algorithm for
dynamic test data generation” , Technical
Report, RSTR-003-97-11
[3] Nirpal Premal B ,Kale K V,” Using Genetic
Algorithm for Automated Efficient Software
Test Case Generation for Path Testing”,
International Journal in Advanced
Networking and Applications Volume: 02,
Issue: 06, Pages: 911-915 (2011)
[4] Srivastava, P.R., Kim, T.H.” Application of
genetic algorithm in software testing”,
International Journal of Software
Engineering and Its Applications 3(4)
(October 2009)
[5] Srivastava P. R. et al, “Generation of test
data using Meta heuristic approach” IEEE
TENCON (19-21 NOV 2008), India
available in IEEEXPLORE.
.

More Related Content

What's hot

Coding and testing In Software Engineering
Coding and testing In Software EngineeringCoding and testing In Software Engineering
Coding and testing In Software EngineeringSatya Bhushan Verma
 
A Modified KS-test for Feature Selection
A Modified KS-test for Feature SelectionA Modified KS-test for Feature Selection
A Modified KS-test for Feature SelectionIOSR Journals
 
Iaetsd an efficient and large data base using subset selection algorithm
Iaetsd an efficient and large data base using subset selection algorithmIaetsd an efficient and large data base using subset selection algorithm
Iaetsd an efficient and large data base using subset selection algorithmIaetsd Iaetsd
 
A Review on Feature Selection Methods For Classification Tasks
A Review on Feature Selection Methods For Classification TasksA Review on Feature Selection Methods For Classification Tasks
A Review on Feature Selection Methods For Classification TasksEditor IJCATR
 
Automated well test analysis ii using ‘well test auto’
Automated well test analysis ii using ‘well test auto’Automated well test analysis ii using ‘well test auto’
Automated well test analysis ii using ‘well test auto’Alexander Decker
 
CCC-Bicluster Analysis for Time Series Gene Expression Data
CCC-Bicluster Analysis for Time Series Gene Expression DataCCC-Bicluster Analysis for Time Series Gene Expression Data
CCC-Bicluster Analysis for Time Series Gene Expression DataIRJET Journal
 
Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...
Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...
Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...Editor IJMTER
 
C LUSTERING B ASED A TTRIBUTE S UBSET S ELECTION U SING F AST A LGORITHm
C LUSTERING  B ASED  A TTRIBUTE  S UBSET  S ELECTION  U SING  F AST  A LGORITHmC LUSTERING  B ASED  A TTRIBUTE  S UBSET  S ELECTION  U SING  F AST  A LGORITHm
C LUSTERING B ASED A TTRIBUTE S UBSET S ELECTION U SING F AST A LGORITHmIJCI JOURNAL
 
PREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMS
PREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMSPREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMS
PREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMSSamsung Electronics
 
Predicting performance of classification algorithms
Predicting performance of classification algorithmsPredicting performance of classification algorithms
Predicting performance of classification algorithmsIAEME Publication
 
AUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEW
AUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEWAUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEW
AUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEWijcsit
 
New Rough Set Attribute Reduction Algorithm based on Grey Wolf Optimization
New Rough Set Attribute Reduction Algorithm based on Grey Wolf OptimizationNew Rough Set Attribute Reduction Algorithm based on Grey Wolf Optimization
New Rough Set Attribute Reduction Algorithm based on Grey Wolf OptimizationAboul Ella Hassanien
 
Volume 2-issue-6-2165-2172
Volume 2-issue-6-2165-2172Volume 2-issue-6-2165-2172
Volume 2-issue-6-2165-2172Editor IJARCET
 
EVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATION
EVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATIONEVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATION
EVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATIONijcsit
 

What's hot (15)

Coding and testing In Software Engineering
Coding and testing In Software EngineeringCoding and testing In Software Engineering
Coding and testing In Software Engineering
 
A Modified KS-test for Feature Selection
A Modified KS-test for Feature SelectionA Modified KS-test for Feature Selection
A Modified KS-test for Feature Selection
 
Iaetsd an efficient and large data base using subset selection algorithm
Iaetsd an efficient and large data base using subset selection algorithmIaetsd an efficient and large data base using subset selection algorithm
Iaetsd an efficient and large data base using subset selection algorithm
 
A Review on Feature Selection Methods For Classification Tasks
A Review on Feature Selection Methods For Classification TasksA Review on Feature Selection Methods For Classification Tasks
A Review on Feature Selection Methods For Classification Tasks
 
Automated well test analysis ii using ‘well test auto’
Automated well test analysis ii using ‘well test auto’Automated well test analysis ii using ‘well test auto’
Automated well test analysis ii using ‘well test auto’
 
CCC-Bicluster Analysis for Time Series Gene Expression Data
CCC-Bicluster Analysis for Time Series Gene Expression DataCCC-Bicluster Analysis for Time Series Gene Expression Data
CCC-Bicluster Analysis for Time Series Gene Expression Data
 
Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...
Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...
Computer aided classification of Bascal cell carcinoma using adaptive Neuro-f...
 
C LUSTERING B ASED A TTRIBUTE S UBSET S ELECTION U SING F AST A LGORITHm
C LUSTERING  B ASED  A TTRIBUTE  S UBSET  S ELECTION  U SING  F AST  A LGORITHmC LUSTERING  B ASED  A TTRIBUTE  S UBSET  S ELECTION  U SING  F AST  A LGORITHm
C LUSTERING B ASED A TTRIBUTE S UBSET S ELECTION U SING F AST A LGORITHm
 
PREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMS
PREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMSPREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMS
PREDICTING PERFORMANCE OF CLASSIFICATION ALGORITHMS
 
Predicting performance of classification algorithms
Predicting performance of classification algorithmsPredicting performance of classification algorithms
Predicting performance of classification algorithms
 
Hc3413121317
Hc3413121317Hc3413121317
Hc3413121317
 
AUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEW
AUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEWAUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEW
AUTOMATED TEST CASE GENERATION AND OPTIMIZATION: A COMPARATIVE REVIEW
 
New Rough Set Attribute Reduction Algorithm based on Grey Wolf Optimization
New Rough Set Attribute Reduction Algorithm based on Grey Wolf OptimizationNew Rough Set Attribute Reduction Algorithm based on Grey Wolf Optimization
New Rough Set Attribute Reduction Algorithm based on Grey Wolf Optimization
 
Volume 2-issue-6-2165-2172
Volume 2-issue-6-2165-2172Volume 2-issue-6-2165-2172
Volume 2-issue-6-2165-2172
 
EVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATION
EVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATIONEVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATION
EVOLUTIONARY COMPUTING TECHNIQUES FOR SOFTWARE EFFORT ESTIMATION
 

Viewers also liked

Wattle Grove Primary School - Rubbish Audit 2013 PPT
Wattle Grove Primary School - Rubbish Audit 2013 PPTWattle Grove Primary School - Rubbish Audit 2013 PPT
Wattle Grove Primary School - Rubbish Audit 2013 PPTStuart Meachem
 
Special parralelogrmas day 1
Special parralelogrmas day 1Special parralelogrmas day 1
Special parralelogrmas day 1jbianco9910
 
Media evaluation question 1
Media evaluation question 1Media evaluation question 1
Media evaluation question 1JoelHunt44
 
Velho Amigo
Velho AmigoVelho Amigo
Velho AmigoAMACLERJ
 
Aumenta la confianza de los consumidores en la economía
Aumenta la confianza de los consumidores en la economíaAumenta la confianza de los consumidores en la economía
Aumenta la confianza de los consumidores en la economíaEduardo Nelson German
 
Benemérita Universidad Autónoma de Pueba-Motores magnéticos
Benemérita Universidad Autónoma de Pueba-Motores magnéticosBenemérita Universidad Autónoma de Pueba-Motores magnéticos
Benemérita Universidad Autónoma de Pueba-Motores magnéticosFernando Ramos
 
Energia Inalambrica
Energia InalambricaEnergia Inalambrica
Energia InalambricaMiguel Diaz
 
Photo de la vie scolaire.ppsx
Photo de la vie scolaire.ppsxPhoto de la vie scolaire.ppsx
Photo de la vie scolaire.ppsxolgafalabala
 
Ppc.sociales
Ppc.socialesPpc.sociales
Ppc.socialesedilma15
 
2015創意包裝設計比賽辦法
2015創意包裝設計比賽辦法2015創意包裝設計比賽辦法
2015創意包裝設計比賽辦法昱海 王
 

Viewers also liked (20)

Actividad 8
Actividad 8Actividad 8
Actividad 8
 
Wattle Grove Primary School - Rubbish Audit 2013 PPT
Wattle Grove Primary School - Rubbish Audit 2013 PPTWattle Grove Primary School - Rubbish Audit 2013 PPT
Wattle Grove Primary School - Rubbish Audit 2013 PPT
 
Library shifts
Library shiftsLibrary shifts
Library shifts
 
Special parralelogrmas day 1
Special parralelogrmas day 1Special parralelogrmas day 1
Special parralelogrmas day 1
 
Media evaluation question 1
Media evaluation question 1Media evaluation question 1
Media evaluation question 1
 
GATE Aptitude
GATE AptitudeGATE Aptitude
GATE Aptitude
 
Velho Amigo
Velho AmigoVelho Amigo
Velho Amigo
 
Aumenta la confianza de los consumidores en la economía
Aumenta la confianza de los consumidores en la economíaAumenta la confianza de los consumidores en la economía
Aumenta la confianza de los consumidores en la economía
 
Benemérita Universidad Autónoma de Pueba-Motores magnéticos
Benemérita Universidad Autónoma de Pueba-Motores magnéticosBenemérita Universidad Autónoma de Pueba-Motores magnéticos
Benemérita Universidad Autónoma de Pueba-Motores magnéticos
 
Antoniou
AntoniouAntoniou
Antoniou
 
Planificacion estreategica...alfredo
Planificacion estreategica...alfredoPlanificacion estreategica...alfredo
Planificacion estreategica...alfredo
 
Energia Inalambrica
Energia InalambricaEnergia Inalambrica
Energia Inalambrica
 
Doc1
Doc1Doc1
Doc1
 
Membrana.
Membrana.Membrana.
Membrana.
 
Photo de la vie scolaire.ppsx
Photo de la vie scolaire.ppsxPhoto de la vie scolaire.ppsx
Photo de la vie scolaire.ppsx
 
Ppc.sociales
Ppc.socialesPpc.sociales
Ppc.sociales
 
it
itit
it
 
2015創意包裝設計比賽辦法
2015創意包裝設計比賽辦法2015創意包裝設計比賽辦法
2015創意包裝設計比賽辦法
 
Mision
MisionMision
Mision
 
Fodaa
FodaaFodaa
Fodaa
 

Similar to Da35573574

PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...
PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...
PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...cscpconf
 
Software Testing Using Genetic Algorithms
Software Testing Using Genetic AlgorithmsSoftware Testing Using Genetic Algorithms
Software Testing Using Genetic AlgorithmsIJCSES Journal
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteIAEME Publication
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategyijseajournal
 
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...csandit
 
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...cscpconf
 
Application of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software TestingApplication of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software TestingGhanshyam Yadav
 
ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...
ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...
ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...ijnlc
 
Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...
Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...
Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...AIRCC Publishing Corporation
 
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...IRJET Journal
 
A Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFISA Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFISIJSRD
 
A Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFISA Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFISIJSRD
 
Software testing using genetic algorithms
Software testing using genetic algorithmsSoftware testing using genetic algorithms
Software testing using genetic algorithmsNurhussen Menza
 
research paper
research paperresearch paper
research paperKalyan Ram
 
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATABINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATAijejournal
 
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATABINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATAacijjournal
 
Comparative Analysis of Various Algorithms for Fetal Risk Prediction
Comparative Analysis of Various Algorithms for Fetal Risk PredictionComparative Analysis of Various Algorithms for Fetal Risk Prediction
Comparative Analysis of Various Algorithms for Fetal Risk PredictionIRJET Journal
 
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...IOSR Journals
 

Similar to Da35573574 (20)

PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...
PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...
PROGRAM TEST DATA GENERATION FOR BRANCH COVERAGE WITH GENETIC ALGORITHM: COMP...
 
Software Testing Using Genetic Algorithms
Software Testing Using Genetic AlgorithmsSoftware Testing Using Genetic Algorithms
Software Testing Using Genetic Algorithms
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategy
 
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
 
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
AUTOMATIC GENERATION AND OPTIMIZATION OF TEST DATA USING HARMONY SEARCH ALGOR...
 
Application of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software TestingApplication of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software Testing
 
ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...
ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...
ENACTMENT RANKING OF SUPERVISED ALGORITHMS DEPENDENCE OF DATA SPLITTING ALGOR...
 
Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...
Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...
Enactment Ranking of Supervised Algorithms Dependence of Data Splitting Algor...
 
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
 
Bx34452461
Bx34452461Bx34452461
Bx34452461
 
A Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFISA Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFIS
 
A Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFISA Defect Prediction Model for Software Product based on ANFIS
A Defect Prediction Model for Software Product based on ANFIS
 
Software testing using genetic algorithms
Software testing using genetic algorithmsSoftware testing using genetic algorithms
Software testing using genetic algorithms
 
research paper
research paperresearch paper
research paper
 
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATABINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
 
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATABINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
BINARY SINE COSINE ALGORITHMS FOR FEATURE SELECTION FROM MEDICAL DATA
 
Comparative Analysis of Various Algorithms for Fetal Risk Prediction
Comparative Analysis of Various Algorithms for Fetal Risk PredictionComparative Analysis of Various Algorithms for Fetal Risk Prediction
Comparative Analysis of Various Algorithms for Fetal Risk Prediction
 
M017127578
M017127578M017127578
M017127578
 
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Da35573574

  • 1. Rupinder Kaur et al. Int. Journal of Engineering Research and Application www.ijera.com Vol. 3, Issue 5, Sep-Oct 2013, pp.573-574 www.ijera.com 573 | P a g e Generation of Test Data Using Genetic Algorithm Rupinder Kaur*, Sandeep Kaur Dhanda* *A.P., CSE/IT Department, Baba Banda Singh Bahadur Engineering college, Fatehgarh Sahib (Punjab), India ABSTRACT Genetic Algorithm has been implemented to automate the generation of test data. The test data was derived from the program's structure with the aim to traverse every line of code in the software. This work uses fitness function and variables are represented in binary code. The power of using Genetic Algorithm lies in its ability to handle input data which may be of complex structure. Thus, the problem of test data generation is treated entirely as an optimization problem. The advantage of Genetic Algorithm is that through the search and optimization process, test sets are improved. The work has been tested with the help of Triangle Type Classification program. Keywords- Genetic Algorithm, Crossover, Mutation, Test Data, Fitness Function I. INTRODUCTION Software testing is one of the main realistic methods to increase the confidence of the programmers in the correctness and reliability of software. Generating adequate test data manually is labour intensive and time-consuming process. This problem has motivated researchers to create test data generators that can examine a program’s structure and generate adequate test data automatically. It is not a small task to judge whether a finite set of input test data is adequate or not. The goal is to uncover as many faults as possible with a potent set of a constrained number of tests. Obviously, a test series that has the potential to uncover many faults is better than one that can only uncover few. Random test data generation consists of generating test inputs at random, in the hope that they will exercise the desired software features. Often, the desired inputs must satisfy some constraints, and this makes a random approach likely to fail [2]. Software testing automation is not a straightforward forward process. For years, many researchers have proposed different methods to generate test data automatically, i.e. different methods for developing test data generators [1, 5]. Genetic algorithms that can automatically generate test cases to test selected path. This algorithm takes a selected path as a target and executes sequences of operators iteratively for test cases to evolve [3]. A method for optimizing software testing efficiency by identifying the most critical path clusters in a program [4].This paper has been organized in four sections. Section II describes the introduction to genetic algorithm, section III introduces methodology used to achieve the objectives and section IV shows the final results and their discussion. II. GENETIC ALGORITHM Genetic Algorithms were invented by John Holland in the 1960s and were developed by Holland and his students and colleagues at the University of Michigan .Holland’s original goal was not to design algorithms to solve specific problems, but rather to formally study the phenomenon of adaptation as it occurs in nature and to develop ways in which the mechanisms of natural adaptation might be imported into computer systems. The Genetic Algorithm (GA) starts by creating an initial population of individuals, each represented by randomly generated genotype. The fitness of individuals is evaluated in some problem-dependent way, and the GA tries to evolve highly fit individuals from the initial population. In translating the concepts of genetic algorithms to the problem of test-data generation, the following tasks are performed: • First of all consider the population to be a set of test. • Find the set of test data that represents the initial population. This set is randomly generated according to the format and type of data used by the program under test. • Determining the fitness of each individual which is based on a fitness function that is problem- dependent. • Select two individuals that will be mated to contribute to the next generation. • Apply the crossover and mutation processes. Various operators of genetic algorithm have been used. The selection operator chooses two individuals from a generation to become parents for the recombination process (crossover and mutation). There are different methods of selecting individuals, e.g. randomly or with regard to their fitness value. The crossover operation is used to produce the descendants that make up the next generation. Mutation operation picks a gene at random and changing its state according to the mutation probability. In a binary code, this simply means changing the state of a gene from a 0 to a 1 or vice RESEARCH ARTICLE OPEN ACCESS
  • 2. Rupinder Kaur et al. Int. Journal of Engineering Research and Application www.ijera.com Vol. 3, Issue 5, Sep-Oct 2013, pp.573-574 www.ijera.com 574 | P a g e versa. A fitness value of an individual is the measure of its strength to survive in the next generation. It reflects the chance an individual has to be present directly in the next generation or to be selected for mating with other individuals in the current generation to produce children for next generation. III. METHODOLOGY USED Single point crossover and bit inversion mutation methods are used in genetic algorithm. Selection of values is based on their fitness function by using roulette wheel selection method. The following code fragment is used to check the flow of program. All the statements are given weights. The assigned weights will be used to calculate the fitness function of each test case input given to genetic algorithm. 0. int a,b,c; 1. int match = 0; 2. if (a = b) 3. match = match + 1; 4. if (a == c) 5. match = match + 2; 6. if (b == c) 7. match = match + 3; 8. if (match == 0) /* if a, b and c are not equals to each other*/ 9. if (a + b <= c) 10. printf("Not a triangle"); return 0.0; } 11. else if (b + c <= a) { 12. printf ("Not a triangle"); return 0.0; } 13. else if (a + c <= b) { 14. printf("Not a triangle"); Return 0.0; } else { 15. double p = (a + b + c)/2.0; printf ("Scalene"); 16. return sqrt (p*(p-a)*(p-b)*(p-c)); /* compute square */ } 17. else if (match == 1) /* if (a = b ≠c) */ 18. if (a + b <= c) { 19. printf ("Not a triangle"); return 0.0; } 20. double h = sqrt (pow (a, 2) - pow(c/2.0, 2)); printf ("Isosceles"); 21. return (c*h)/2.0; /* compute square */ } 22. else if (match == 2) /* if (a = c ≠b) */ 23. if (a + c <= b) { 24. printf ("Not a triangle"); return 0.0; } else { 25. double h = sqrt (pow (a, 2) - pow (b/2.0, 2)); printf ("Isosceles"); 26. return (b*h)/2.0; /* compute square */ } 27. else if (match == 3) /* if (b = c ≠a) */ 28. if (b + c <= a) { 29. printf ("Not a triangle."); return 0.0; } else { 30. double h = sqrt (pow (b, 2) - pow (a/2.0, 2)); printf ("Isosceles"); 31. return (a*h)/2.0; /* compute square */ } else { /* if (a = b= c) */ printf( "Equilateral"); 32. return (sqrt (3.0)*a*a)/4.0; /* compute square*/ } Fig 1 Triangle Type Determination Program IV. RESULTS In order to compare the effectiveness of using GA, it has been compared with random testing. The following graph shows that the random testing is good enough for small size of input but as the size increases, the execution time for the program increases. So, genetic algorithm works good in that case Fig 2 CPU Time taken to run genetic algorithm and random numbers REFERENCES [1] Mansour N, Miran Salame,” Data Generation for PathTesting”, Software Quality Journal, 12, 121–136, 2004,Kluwer Academic Publishers. [2] Michael, C.C., McGraw, G.E., Schatz, M.A., Walton, C.C., “ Genetic algorithm for dynamic test data generation” , Technical Report, RSTR-003-97-11 [3] Nirpal Premal B ,Kale K V,” Using Genetic Algorithm for Automated Efficient Software Test Case Generation for Path Testing”, International Journal in Advanced Networking and Applications Volume: 02, Issue: 06, Pages: 911-915 (2011) [4] Srivastava, P.R., Kim, T.H.” Application of genetic algorithm in software testing”, International Journal of Software Engineering and Its Applications 3(4) (October 2009) [5] Srivastava P. R. et al, “Generation of test data using Meta heuristic approach” IEEE TENCON (19-21 NOV 2008), India available in IEEEXPLORE. .