IJCS_2016_0302012.pdf

Embed Size (px)

Citation preview

  • 8/16/2019 IJCS_2016_0302012.pdf

    1/8

     

    131 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

     International Journal of Computer Systems (ISSN: 2394-1065), Volume 03 –  Issue 02, February, 2016

     Available at http://www.ijcsonline.com/

    Automatic Test Data Generation using Genetic Algorithm using Sequence

    Diagram

    Anju Bala, Dr. Rajender Singh Chhillar

    Department of Computer Science & Applications,M.D. University, Rohtak, India

    Abstract

    The most striking feature of SDLC is software testing. It is very labour-intensive and expensive process in software

    development and handling as well as maintenance of software. The main objective of this paper is to extend the testing

    technique. Testing is to show the incorrectness and is considered to succeed when an error is detected [Myers79].

    Today’s automatic testing has replaced manual testing with a great extent. Automating testing is very helpful in reducing

    human efforts to generate test cases or test data. Test data or test case is a very tiresome task in software testing. It has

    multiple set of values or data that are used to test the functionality of a particular feature. All degrees of the test values

    and conditions maintained in separate files and stored as test data. Test case or data generation is a set of conditions or

    rules that are developed for finding the failure points in a developing software. Nowadays, many researches have paid

    considerable attention, focusing on test data generation techniques. This paper adopts a case study and proposes atechnique for test data generation, based on genetic algorithm using critical path. Critical path testing is considered to

     solve the looping problem and improving the testing efficiency. Test data scenario is derived from sequence diagram.

    Sequence diagram reveals the sequence of calls in a system using exchange of messages among the objects of system.

    Keywords:  Genetic Algorithm, UML, Sequence diagram and graph, Test-data generation.

    I.  I NTRODUCTION

    Software testing is recognized as a key feature or aninevitable part of software development life cycle. It is themost exhaustive and critical phase but unavoidable, in

    SDLC. Software testing is the phenomena of executing a program with the intent of finding an error or fault to makethe software error-free and satisfy the end-user. Testing is avery essential phase, though very labour-intensive andexpensive process in software development and handling aswell as maintenance of software. It accounts for taking alarge part of total cost, up to 50 percent for a entiresoftware development [1]. Due to advancement intechnology, the software system as well as testing processhas becomes very complex, to overcome from all theseissues, testing process should be automated, proportional tocost of developing software should be reducedsignificantly. So, a challenging part of this phase, entails tothe generation of test cases or data. This generation is verycrucial to the success of testing, because it is very hard partof software, to obtain a fully tested program, given that thelarge number of test cases will be able, if needed to findmaximum number of faults in less number of iterations.Software program is infinite, and a suitable design of testcases will be able to detect a maximum number of faults.For the requirement of good and effective software qualityassurance, the technique for automatic generation of testdata, make efforts efficiently to systematically uncover thedifferent types of errors with a minimum amount of timeand efforts. A test data is a set of data performed in asequence and related to a test objective, which will producea number of tests input values, observed output, expected

    output or test oracle needed for the test to run, such asenvironment prerequisites [2].

    A good test case should have the quality to cover everyaspect of test objective and high rate of fault detection. Thismethod is used for automatic generation of test case usually

     based on efficiently searching or finding small set of testcases with high probability of detecting as-yet

    undiscovered error [1]. There have been few efforts onrepresenting a considerable attention, which covers allexisting automatic test case generation approaches. In this

     paper, we extend a general classification for automatic testdata generation approaches with comparison betweenexisting approaches, to show that the existing approachesare resource-intensive as well as limited budget. So, this

     paper presents a generic approach i.e. Genetic Algorithm,is the most acceptable approach to generate automatic testdata or test case.

    This paper is presented as follows: Section 2 review therelated work of test-data generation techniques. Many test-data generation techniques have been developed. Section 3

    gives an overview on introduction of UML and its diagram,notation and terminology of sequence diagram. Section 4gives the introduction of GA. Section 5 describes the

     proposed approach for generation of test data. Section 6 presents case study of on-line appointment in hospital.Section 7 presents conclusion and future work of this

     paper.

    II.  RELATED WORK

    Many researches have been done in the field of test datageneration technology. Recently, many techniques have

     been proposed, all related to Genetic Algorithm.

    Parveen Ranjan and T.H. Kim [5] developed variable

    length genetic algorithm that optimized and selected the path testing coverage criteria. Genetic algorithm used inControl Flow Graph (CFG). Testing covers every possible

  • 8/16/2019 IJCS_2016_0302012.pdf

    2/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    132 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

     path in Software under Test (SUT). Weights are assigned toedge of CFG by applying 80-20 rules. Xanthakis et al. [8]

     present genetic algorithm to generate the test data. Geneticalgorithms are used for generation of test data for structure.A path is selected by the user and the relevant branches areexecuted from program. Fitness function is calculated by

    summation of branch predicated. V. Mary Sumalatha,G.S.V.P. Raju [9] presents the test case generation bymeans of UML sequence diagram using genetic algorithmfrom which best test cases optimized. Genetic algorithmapplied on sequence graph. All paths discover from sourceto destination with loops and calculate the fitness value.Sangeeta Sabherwal [7] proposed a technique for

     prioritization of test cases scenario derived from activitydiagram and state chart diagram using genetic algorithmconcepts, stack and information flow (IF) diagram. Stack

     based application is adopted for assigning the weight toeach node of activity and state chart diagram. Bo Zhangand Chen Wang [3] use simulated annealing algorithm intogenetic algorithm to generate the test data for path testing.A simulated annealing algorithm is inspired by theannealing of metals. In this method, solid is heated fromhigh temperature and cooled down slowly to maintainthermodynamic equilibrium of system. The adaptivegenetic simulated annealing algorithm is proposed byZhang to automatically generate the test data. The steps ifthis algorithm is shown in his paper. The fitness value,crossover, mutation another modification are applied ingenetic algorithm procedure. M. Harman [4] focused onautomated test data generation using search based softwareengineering. Automated test data generation using geneticalgorithm is based on search based software engineering.Sultan H. Aljahdali [8] presented the limitation of genetic

    algorithm in software testing. The majority of softwaretest-data generation techniques are based on geneticalgorithm. It attempts to compare and classify thecombinatorial problems according to genetic algorithmfeature and parameters.

    III.  UML

    The Unified Modeling Language (UML) is standardmodeling language, is widely used to visualize, specify,construct and document the main artifacts of softwaresystem. UML is used in business modeling and manyarchitectural modeling, but here mainly in softwaredevelopment modeling to design and implement forcomponent-based applications. In software development, itis very popular to generate test cases or data with the helpof graphical notation i.e. rectangles, lines, ellipses etc

     provided by UML. It has own syntax and semantics. Apartfrom all of the aforementioned techniques adoption ofUML, there is inevitable nature of UML is, once the modelis developed, then a variety of problems solved i.e.analysis, specification, code and test case or datageneration, visualize and understand the problem andworking of the software testing. It is also helpful in

     bridging the gaps between the designers and testers. Themost important modeling language has been invented byGrady Booch, Jim Rumbaugh in 1994 to combine thediagramming notations of two most popular methods of

    Booch and OMT (Object Modeling Techniques).The UMLand its diagrams are widely used to visually depict thestatic structure and more importantly, the dynamic behaviorof applications. UML constructs different types of

    diagrams, categorized into two groups-structural diagramsand behavioral diagrams [Vaughan07]. There are manytypes of diagram to capture five different behavior of thesystem i.e. Class diagram, Component diagram andDeployment diagram are to represent the static behavior ofsystem. Activity diagram, Sequence diagram, State

    diagram are used to represent the dynamic behavior of thesystem. Here, the focus is on sequence diagram and activitydiagram because sequence diagram is most popular inUML diagram to generate test data or cases.

     A.  Sequence Diagram

    A sequence diagram is also called an interactiondiagram and most common behavior diagram. It is very

     popular artifact of UML for dynamic modeling. It focuseson behavior of your system. Sequence diagram onlyfocuses on processes how they interact to one – another andin what order. It constructs the message sequence chart. Itshows all interaction of objects in timely manner. It revealsthe exchange of information between objects and classes ina scenario. It shows the functionality of a scenario.Sometimes, it is called event diagram or event scenario.Structure of sequence diagram represented by followingnotations i.e. class name is written in boxes with colon,

     parallel vertical lines, different processes, horizontal arrowrepresents message exchanged between objects, thisscenario also shows in graphical run time scenario. 

    Sequence diagram is better than other dynamicdiagram. In this paper, a brief idea is given on comparisonof sequence diagram to activity diagram with the intent ofshowing that the sequence diagram is better to generate testdata.

    Activity diagram focuses on a particular operation of anobject. But sequence diagram focuses on the way of

     process execution in sequence, operations and its parameters but activity diagram reveals the workflow ofoperations.

    Sequence diagram keeps track on the interaction between objects, this feature extends its usability fordynamic modeling. But in activity diagram, it focuses onhow the process flow of an object.

    Fig1. Basic notation of sequence diagram

    Sequence diagram expresses most formal level ofrefinement. In research field, most of the software

    developer consider sequence diagram because it is veryhelpful in documenting or predicting, how a system should

     behave in future or in other words, it is very useful in present and future level. From the organizational point of

  • 8/16/2019 IJCS_2016_0302012.pdf

    3/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    133 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

    view, it shows how the business currently working byshowing the interaction between objects or how will be

     performed in future. Sequence diagram looks like as shownin Figure 1.

     B.   Basic Notation of Sequence Diagram

    The basic notations that are used in sequence diagramare described below:

     

    I.  Actor: A participant or entity that interacts with thesystem.

    II.  Lifeline: A vertical line reveals the sequence ofevents, participate during an interaction.

    III.  Unit: Represent a module or subsystem, component,unit or run-time entity in the system.

    IV.  Separator: Represent an interface or boundary between subsystem, components or units.

    V.  Group: Header elements into subsystem or

    components.

    VI.  Synchronous Message: The sender waits for aresponse to a synchronous message before allcontinuous.

    VII.  Asynchronous message: A message that does notrequire a response before sender continuous. Anasynchronous message shows only a call from thesender.

    VIII.  Execution occurrence: A vertical shaded rectanglethat appears on a participant’s lifeline and representsthe period when participates executing the operation.

    IX. 

    Callback message: A message returns to a participant that is waiting for a return back. Theresulting execution occurrence shows on top ofexisting one.

    X.  Self message: A message from participants to itself.The resulting execution occurrence appears on thetop of sending execution.

    XI.  Create message: create a message to invoke the first participant. If it receives it should be first.

    XII.  Destroy message: Represents the destruction of aheader elements as a result of a call for anotherelement.

    XIII. 

    Comment: A comment is additional information can be attached to any point on a lifeline.

    XIV.  Time start: it is a starting point..

    XV.  Time expiration: it shows the expiry time.

    IV.  GENETIC ALGORITHM

     A.   INTRODUCTION

    Genetic Algorithm is based on natural phenomena. Thefundamental concept behind GAs is “natural selection” and“genetic inheritance”. The founder of GA is John Holland,university of Michigan (1970) in U.S.A developed aremarkable idea in the field of heuristic search. It is basedon the evolutionary principle. GA belongs to the class of

     probabilistic algorithm. GA empirically provides directedsearch algorithms rely on the mechanics of biologicalevolution. The best part behind to use GA than other

    searching algorithm is that GA performs a multi-directionalsearch by maintaining the optimized solutions not a single

     point. Main application areas of GA are- AI, business,scientific and engineering circle etc. But these can be usedin many forms like to generate automatic test cases etc. GAis a class of probabilistic optimization algorithm. Genetic

    Algorithms are categorized as global heuristic search orGA is good heuristic search for combinatorial problems[20].

    Ex.TSP, pen movement of a plotter, measure real worldrouting of school, prisoner’s dialemma. 

    The simple form of GA is given by following. Thisalgorithm is stopped when population covers all theoptimal solution.

    Simple genetic algorithm: 

    Simple_Genetic_Algorithm( )

    {

    Initialize the population; /*generate the initial population*/

    Calculate fitness function; /* calculate fitness value foreach individual */

    While(Fitness Value != Optimal Value)

    {

    Selection; /* randomly select individual for mating*/

    Crossover; /* apply crossover and mutation for getting best individual */

    Mutation; /* Calculate fitness value of new individualand discard old individual by maintaining the fitnesscriteria of individual. If population reaches to stoppingcriteria or reach best individual or population hasconverged than finish = true. */

    End

    End

    The basic steps of genetic algorithm a shown in this step:

    Fig 2. Flow chart of genetic algorithm

  • 8/16/2019 IJCS_2016_0302012.pdf

    4/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    134 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

    Genetic Algorithm has basically three operators usedfor population to generate new offspring. 

      Initialization is the very first operator of genetic

    algorithm, it creates an initial population ofchromosomes, at the beginning of execution.

    Selection of population is random in initialization.  Selection  operator is a process to select two

    chromosome from the population forreproduction. There should be a selectionmechanism, how these chromosomes will beselected. Mainly expectation is to select, suchchromosomes that gives the better individual. So,selecting such chromosomes at higher probabilitywill produce better population after each iterationof algorithm. Selection must be balanced bymaintaining the diversity of population needed forexploration. So, too strong selection and so weakselection will reach to slow evolution.  Roulette-

    Wheel, Rank-based, Tournament, Uniform and Elitism is the classic selection method inGA.[Goldberg89], [Holland92].

      Crossover is a very important process to generate

    new individual. Crossover probability should bemore than mutation probability to get betterindividual. It is a very practical method of sharingthe information between two chromosomes. InGAs operator, crossover is most valuable featureespecially where building blocks (i.e. schemas)exchange is necessary [Arabas94]. Itsimplementation and representation is closelyrelated to problem domain or problem dependent.Single - point crossover   is most importantcrossover operator. In this type of operator

     position is chosen by randomly and element oftwo parents before and after mutually exchangedto produce a better individual.

      Mutation is a process to trap the local optima and

     pruning on dead state. Its probability is alwaysless than crossover to give better outcome.

     Mutation – operator  alters one or more bit value inthe chromosomes to enhance the structural

     probability. Mutation operator play the best role to protect the population against pre-matureconvergence at any particular area of the entiresearch space[Mitchell96]. It works only on onechromosome at a time not more than one like incrossover.

    Most common methods of mutation are as follow:

    1.  Bit-flip mutation: chromosome’s bit value ischanged with a mutation probability.

    2.  Uniform-mutation: bit select randomly andchange its value.

    Evaluate function or fitness function is also calledobjective function, it calculates the quality of candidate

    solution. Based on fitness function, measurement of singlechromosome to rest of the population. This function givesthe value of specific chromosome. It is not necessary that itwill reach to its fitness value. The fitness value is typically

    obtained by a transformation function called  scaling  and itis worthwhile to simplify the evaluation function as muchas possible because the evaluation process itself has beenfound to be very expensive due to the time and resources itconsumes [Arabas94].

    Upon completion of crossover and mutation operation,there will be original parent population and new individual population. A fitness function determines which of these parents and offspring will survive in next generation. Theseoperations are iterated until the expected goal is achieved.

    V.  PROPOSED APPROACH

    To generate appropriate test data for testing process.We will have to follow these steps:

    I.  Draw the sequence diagram.

    II.  Convert the sequence diagram into sequence graph.

    For every conditional message two edges takes place. One edge for true condition and another edgefor false condition.

    III.  Generate set of path from sequence diagram with theintent to cover every branch of graph. Suppose someloop occurs

    in the diagram, it becomes very difficult and puzzling.So we give our best to try to find critical path in graphusing the stack weight assignment approach by thisalgorithm:

    Algorithm:

    1.  For every node of graph i =1….n; 

    2.  By DFS approach, Push node of graph onstack.

    3.  Determine smax of stack( the maximum size);

    4.  For = 1 to smax, assign weight w=smax-k toeach node of graph, where smax ismaximum size of stack and k is pathfollowed by nodes of graph.

    5.  For each decision node d.

    6.  Assign the same weight to branching nodes.

    7.  Updates loops by Inserting the next neighbornode of branching nodes.

    8.  End

    IV.  Fitness value of each node is calculating of graph byusing addition of flow of information and poppingoperation require to a node. Flow of information isdetermined by using this equation:

    Flow of information = incoming (a) * outgoing (b)

    Incoming means how many edges are inserting into anode and outgoing means how many edges are leaving anode.

    Fitness Value = Stack based weight approach + Flow ofinformation

  • 8/16/2019 IJCS_2016_0302012.pdf

    5/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    135 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

    V.  Selection of chromosome bits or test data dependsupon conditional nodes of graph.

    VI.  Calculate the fitness value of each possible path thatis followed by conditional nodes of graph.

    VII.   Now, probability of selection for each path is

    calculated by Roulette wheel selection :

    Pi= F(xi) /  F(xi)

    After probability, calculate cumulative probability Cifor each path:

    Ci =  Pi

    VIII.  Generate random number for each test-data.

    IX.  To select the chromosomes determine value ofcolumn N where need to find how many test datanumber that has cumulative probability is greaterthan random number.

    X. 

    The value of mating pool column is determiningnumber of times a test-data appear in N column.

    XI.  Select the corresponding chromosome or test datathat has higher value appear in N column.

    XII.  Pair-wise single point crossover is applied and selectthose child that has maximum fitness value. The

     probability of crossover operator is 0.8. Crossover iscarried out only if the random number is less than0.8 otherwise mutation operator s applied.

    XIII.  Bit-flip mutation is applied to interchanging ofsingle bit in test-data or chromosome.

    XIV. 

    Recalculate the fitness value of new generation.XV.  Repeat this process until maximum fitness value is

    reached or all paths are covered in graph or nostopping criteria is met.

    VI.  CASE STUDY

    In this section, we study an approach by using sequencediagram of on-line appointment in hospital. In Onlineappointment user will have to follow this step:

    1. The patient requests for appointment.

    2. The receptionist checks the appointment,appointment is available or not according todoctor’s schedule. 

    3. If appointment is not available, then systemgenerate message and we can’t take theappointment.

    4.  If appointment is available, then the user canconsult to the doctor. If patient has a minor

     problem, the doctor suggests some prescription.

    5.  If the patient has a major problem, the doctorchecks his or her record.

    6.  According to the patient’s record, the doctor

    suggests more prescription and gives appointmentagain.

    7.  If the patient becomes ok after next appointment,then patient can leave, otherwise can takeappointment again.

    8. If no need of appointment any more, then theappointment will be available for next the patient.

    Sequence diagram is constructed according to thesesteps. In this diagram, patient, receptionist, doctor andnurse play the role of objects, they will exchange themessages among themselves for giving and taking onlineappointments. Sequence diagram shown in figure 3.Further, Sequence diagram is converted into sequencegraph as shown in figure 4.

    : Patient : Receptionist : Doctor : Nurse

    Take Appointment

    Check Appointment

    Cannot meet

    Consult Doctor 

    Check Patient

    Patient need more treatment

    Patient Ok 

    Check Patient Record

    Patient OK 

    If not OK appoint again

    Treat again

    Leave

     

    Fig.3 Sequence diagram of on-line appointment

  • 8/16/2019 IJCS_2016_0302012.pdf

    6/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    136 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

    1

    2

    3

    45

    6

    7

    8

    9

    10 1112

    13

    14 

    Fig 4. Sequence graph of online-appointment.

     Now critical path is determine by stack weightassignment approach as shown below in this table:

    Table 1. Critical path is determined

     Node Pathfollowed bynode, k

    Stacksize, smax

    Weight=smax-k

    1 0 1 12

    2 1 2 11

    3 2 3 10

    4,12 3 4 95,6 4 5 8

    7,12 5 6 7

    8,13 6 7 6

    9,14 7 8 5

    10 8 9 4

    11,12,13

    9 10 3

    13,14 10 11 2

    14 11 12 1

     Now complexity of each node is determined by usingthis table:

    Table 2. Complexity of each node calculated

     Node Poppingoperation, a

    Information Flow, b

    Fitnessvalue= a+b

    1 12 0*1=0 12

    2 11,8,6,4 1*2=2 13,10,8,6

    3 10 1*1=1 11

    4 9 1*2=2 11

    5 8 2*1=2 10

    6 8 1*1=1 9

    7 7 1*1=1 8

    8 6 1*2=2 8

    9 5 1*1=1 6

    10 4 1*2=2 6

    11 6,3 1*1=1 7,4

    12 7,5,3 2*2=4 11,9,7

    13 1 1*1=1 2

    14 1 1*1=1 2

    Initial possible populations are: 1000, 1010, 1011,1111, and 0000. The path 1,2,3,4,6,7,8,9,10,12,13,14 isfollowed by the 1000 chromosome and corresponding

    fitness value is 12+13+11+11+9+8+ 8+6+6+11+2+2=99.The next chromosome 1010 follow the path1,2,3,4,6,7,8,9,10,11,13,14 and corresponding fitness valueis 12+13+11+11+9+8+8+6+6+7+2+2=95.

    The chromosome 1011 follow the path is1,2,3,4,5,12,13,14 and corresponding fitness value is12+13+11+11+10+11+2+2=72. The chromosome 1001follow the path is 1,2,5,12,13,14 and corresponding fitnessvalue is 12+13+10+11+2+2=50. The chromosome 0000follow the path is 1, 2, 3, 4, 6, 7,8 14 and correspondingfitness value is 12+13+11+11+10+9+8+2=76.

    The chromosome 1111 follow the path1,2,3,4,6,7,8.9,10,12 and corresponding fitness value is12+13+11+11+9+8+8+6+11=89.

    Selection of new generation are shown in tables where,X is test data, F(X) is fitness value if test data, Pi is

     probability, Ci is cumulative probability, S is Selection, Cis Crossover and M is Mutation.

    Table 1. Fitness value of initial population

    S. No. X F(x) Pi Ci R

    1 1000 99 0.2757 0.2757 0.245

    2 1010 95 0.2646 0.5403 0.257

    3 1111 89 0.2479 0.7882 0.667

    4 0000 76 0.2116 0.9998 .9999

  • 8/16/2019 IJCS_2016_0302012.pdf

    7/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    137 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

    Table 2. New generation selection

    S.No.

    Selection

    Crossover point

    Crossover

    Mutation

    F(x)

    1 1000 3 1000 1000 99

    2 1000 3 1010 1010 95

    3 1010 2 1011 1011 72

    4 1111 2 1011 1011 95

    Table3. Fitness Value of initial population

    S.No X F(X) Pi Ci R

    1 1000 99 0.2742 0.2742 0.2622

    2 1010 95 0.2631 0.5373 0.1240

    3 1011 72 0.1994 0.7367 0.8760

    4 1010 95 0.2631 0.9998 0.6790

    Table 4. New Generation Selection

    S.no.

    Selection

    Crossover point

    Crossover

    Mutation

    F’(X)

    1 1010 3 1010 1000 99

    2 1000 3 1000 1010 95

    3 1011 2 1011 1111 89

    4 1011 2 1010 1000 99

    Table 5. Fitness Value of initial population

    S.NoX F(X) Pi Ci R

    1 1000 99 0.2591 0.2591 0.2486

    2 1010 95 0.2486 0.5077 0.4706

    3 1111 89 0.2329 0.7406 0.6880

    4 1000 99 0.2591 0.9997 0.8990

    Table 6.New Generation Selection

    S. No.

    Selection

    Crossover point

    Crossover

    Mutation

    F’(X)

    1 1010 3 1010 1000 99

    2 1011 3 1000 1000 99

    3 1011 2 1000 1000 99

    4 1010 2 1010 1010 95

    Table 7.Fitness Value of initial Population

    S.No. X F(X) Pi Ci R

    1 1000 99 0.2525 0.2525 0.345

    2 1000 99 0.2525 0.505 0.624

    3 1000 99 0.2525 0.7575 0.867

    4 1010 95 0.2423 0.9998 0.894

    Table 8. New Generation Selection

    S. N

    Selection

    Crossover point

    Crossover Mutation F’(x) 

    1 1000 3 1000 1000 99

    2 1000 3 1000 1000 99

    3 1000 3 1000 1000 99

    4 1010 3 1010 1000 99

    After 8th

     iteration as shown in table 8, we find test data1010 has highest fitness value 85 among all of them. So

     path corresponding to this chromosome is1,2,3,4,6,7,8,9,10,12,13 tested first.

    This paper makes an efforts, to extend the previouswork that is also related to test data generation by activityand state chart diagram using prioritization geneticalgorithm. In this paper, we adopt sequence diagram fortest-data generation with comparison to activity diagram.

    Sequence diagram is very convenient, easy to draw andunderstand and gives fast result than activity diagram.Sequence diagram has most challenging features to givesus all details i.e. order of message between objects, assignresponsibilities and timer. With the help of sequencediagram, changing can be made very easily and efficientlywith well understanding. Naïve user can makes thecorrection easily in real time environment. Sequencediagram is one of the popular than others UML diagrams

     because it is the most formal level of refinement. So onecan say that sequence diagram is more acceptable than theactivity or the state chart diagram. Besides in this article,selection of test data for next generation is based Roulette –  Wheel Selection ( comparison between cumulative

     probability and random number generation) which help inreducing the iterations of tables.

    VII.  CONCLUSION

    This paper presents the test data generation by usingUML sequence diagram. Genetic algorithm is used forselection of those test data that have highest fitness value.Roulette – Wheel Selection is used to select next test data.Stack based weight approach is used to calculate critical

     path in graph. Genetic Algorithm technique also helps inincreasing the software testing efficiency and GA alsouseful to solve trivial problem. Operators (mutation and

    crossover) are the best to pruning the population and give best individual. In future, we try our best to find moreconvenient way to make easy in generation of test data andtest cases. Operators of genetic algorithm that can apply on

  • 8/16/2019 IJCS_2016_0302012.pdf

    8/8

     Anju Bala et al Automatic Test Data Generation using Genetic Algorithm using Sequence Diagram

    138 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016

    software testing and help in improving the more testingefficiency.

    R EFERENCES 

    [1] 

    R. Blanco, J.Tuya and B. Adenso-Díaz, “Automated test datageneration using scatter-search approach”, Information andSoftware technology, vol. 51, Issue 4, (2009), pp. 708-720.

    [2]  Xanthakis S, Ellis C,Skourlas C, Le Gall A, “Application ofGenetic algorithms to Software Testing”. In 5th InternationalConference on Software Engineering and its Applications pp. 625-636.

    [3]  T. Blickle, L. Thiele, A Comparison of Selection Schemes used inGenetic Algorithms. TIK-Report, Zurich, 1995.

    [4]  B. N. Biswal, S. S. Barpanda and D. P. Mohapatra, InternationalJournal of Computer Applications, vol. 1, Issue 14, (2010).

    [5]  Bo Zhang, Chen Wang, “Automatic Generation of Test Data forPath Testing by Adaptive Genetic Simulated AnnealingAlgorithm”, IEEE, 2011, pp. 38-42.

    [6]  M. A. Ahmed, I. Hermadi, “Genetic Algorithm based multiple paths test data generator”, Computer and operations Research(2007).

    [7]  Parveen Ranjan Srivastava, Tai-hoon Kim, “Application of GeneticAlgorithm in Software Testing”, International Journal of Softwareengineering and its Application, Vol. 3, No.4, October 2009, pp.87-95.

    [8]  Snageeta Sabharwal, Ritu Sibal, Chanyanika Sharma,“Prioritization of test cases scenarios derived from activity diagramusing genetic algorithm”, ICCCT, IEEE, 2010, pp. 481-485.

    [9]  Sangeeta Sabharwal et al., “Applying Genetic algorithm forPrioritization of test cases Scenario derived from UML diagrams”,International journal of computer science, Vol.8, Issue 3, No.2,May 2011.

    [10]  Sultan H. Alijahdali et al, “The Limitation of Genetic Algorithm inSoftware Testing”, pp. 1-8.

    [11]  V. Mary Sumalatha, G.S.V.P. Raju, “Object Oriented Test CasesGeneration Techniques using Genetic Algorithms”, InternationalJournal of Computer Applications Vol. 61- No.20, January 2013, pp20-26.