Documente Academic
Documente Profesional
Documente Cultură
Abstract
Test data generation is basically the process of identifying a set of data which satisfy the criteria set for testing. Lot of research have been done by many researchers and they developed many test data generators like random test data generators, symbolic test data generators and dynamic test data generators. This paper analyses and then compares the techniques applied in generating test cases based on genetic algorithm Keywords: Test case generation, Genetic Algorithms, fitness functions
1. INTRODUCTION
Software testing is a major and most important part of software engineering so that errors can be identified easily. The process of validation and verification occurs in software testing. It is the most time consuming and costly activity to satisfy customers. Most of the time in software development is normally spent in software testing. So designing the minimal number of test cases and to determine the maximum number of [1] as much as possible is the main goal of software testing. In this paper, various works done by the researchers have been compared, for identification and implementation of the test case generators and techniques to optimize them.
2. GENETIC ALGORITHM
Genetic algorithm is a rapidly growing area in Artificial Intelligence. Darwins theory inspired genetic algorithm. It is started with the set of solutions which is basically represented by chromosome known as population. New population is generated by using the results from previous solution. New solutions are selected according to their fitness and this procedure is repeated until the specified condition is satisfied.
38
International Journal of Computational Intelligence and Information Security, March 2012 Vol. 3, No. 3
39
International Journal of Computational Intelligence and Information Security, March 2012 Vol. 3, No. 3
Roya Alavi et.al. [10] developed a system for generating test cases using genetic algorithm based on initial test cases. They proposed a method called KMGA (K-means Genetic Algorithm) which is a combination of k-means and genetic algorithm. In k-means algorithm, test cases are clustering according to the internal criteria. The purpose of k-means algorithm is to minimized sum of distances. of every point from their centers.After clustering; the gained centres are entered to the genetic algorithm as test instances.
6. COMPARISON RESULTS
A comparison is presented among the genetic algorithm based test data generation techniques through many dimensions. As shown in Table 1 for the first dimension coverage criterion. Xanthakis and Bueno techniques are employed to generate test data for selected paths of the program; each technique takes one path at a time in a given sequence.Whereas, in the work of Xanthakis the genetic algorithm is used to find input data that satisfies all branch predicates of a chosen path. Buenos technique can be applied to the generation of the test data for the sub-paths from the entry node to some goal node different from the exit node. Roper, Jones, Pargas and Michael techniques attempt to achieve a desired level of branch coverage all branches in the software were exercised but the loops are controlling to zero, one, two and three loops. Pargas technique uses Control Dependence Graph thus the paths are acyclic and Michaels technique uses condition-decision coverage. For the second dimension, fitness function is taken where Ropers fitness function is the coverage of the program which is achieved, i.e. the number of branches to the total number of branches. Jones considers two fitness functions: the Hamming Distance function and a simple reciprocal of the difference between two predicate values. The former may be applied in general, while latter applies only to predicates in which numerical values are compared. Pargas fitness function is the number of predicates in which numerical values are compared. Pargas fitness function is the number of predicates that it has in common with the predicates on a control-dependence predicate path of the target. Finally Buenos technique uses the fitness function, where NC path similarity, EP absolute value of the path predicate(branch) function, and MEP is the maximum predicate function value among the candidate. Many approaches are used to select the survival of individuals such as high fitness, high average, high fitness in the selected subpopulation, hybrid between random and high fitness.
TABLE 1: COMPARISON ACCORDING TO COVERAGE CRITERION AND FITNESS FUNCTION
Fitness Function The branch distance values. Percentage of coverage achieved Hamming distance or reciprocal Common predicates Predicate function Based upon the priority
Criteria Path Branch Hamming distance or reciprocal Statement and branch Branch (Condition-decision Feasible path
RoyaAlavi
Cj is Calculated(Number of Clusters)
40
International Journal of Computational Intelligence and Information Security, March 2012 Vol. 3, No. 3
REFERENCES
[1] Xanthakis S ,Ellis C,SkourlasC,Le Gall A,Kastiskas,Karapoulious K. . pp 625-636 (1992) Application of genetic algorithm to Software Testing. In 5th international conference on software Engineering and its Applications [2] Roper M,MacleanI,BrooksA,MillerJ,Wood M. , (1995) Genetic Algorithm and the Automatic Generation of Test Data. Technical Report RR/95/195.Department of Computer Scienece,University of Strathclyde [3] Jones B F, Sthamer H H,Eyres D E. (1998);41(2):98-107.2.Automatic Strucural Testing using Genetic Algorithm. Software Engineering Research Journal [4] Sthamer H. H., the automatic generation of test data using genetic Algorithm, ,(1995) Ph. D Thesis, University of Glamorgan,Pontyprid, Wales, Great Britain [5] Pargas R P, Harrold M J, Peck R R ,(1999)Test Data Generation Using Genetic Algorithm. Journal of Software Testing, Verifications and Reliabilit [6] Bueno P M S ,Jino M. ,(2002)Identification of Potentially Infeasible Program Paths by monitoring the search for Test Data. Proceedings of the Fifteenth IEEE International Conference on Automated Software Engineering [7] Bueno P M S ,Jino M. (2011) 25th Brazilian Symposium Automatic Test Data Generation for Program Paths Using Genetic Algorithms. International Journal of Software Engineering and Knowledge EngineeringSoftware Engineering (SBES), [8] Michael C C, McGraw G E, Schatz M A ,(2001)Generating Software Test by Evolution. IEEE Transactions on Software Engineering [9] Praveen RanjanSrivastava,PriyankaGupta,YogitaArrawatia, SumanYadav. . March (2009) Volume 34 Number 2 ACM SIGSOFT Software Engineering Notes [10] RoyaAlavi and ShahriarLofti. IPCSIT vol. 14 (2011) IACSIT Press, Singapore The New Approach for Software Testing Using a Genetic Algorithm Based on Clustering Initial Test Instances 2011 International Conference on Computer and Software Modelling
41