Automatic Test Data Generation of Character String Zhao Ruilian.
An automatic test data generation for data flow
description
Transcript of An automatic test data generation for data flow
![Page 1: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/1.jpg)
AN AUTOMATIC TEST DATA GENERATION FOR DATA FLOW
COVERAGE USING SOFT COMPUTING APPROACH
SANJAY SINGLA, PRITI SINGLA AND H M RAI
Vol. 2, No. 2, April 2011
![Page 2: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/2.jpg)
PRESENTED BY
WAFA QAISER KHAN
MS(SE)-2
![Page 3: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/3.jpg)
ABSTRACT
Testing is the most important quality assurance measure for software.
Testing is time consuming and laborious process.
Automatic test data generation would be useful to reduce the cost and time.
![Page 4: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/4.jpg)
Paper presents an automatic test data generation technique that uses a particle swarm optimization (PSO) to generate test data that satisfy data flow coverage criteria.
![Page 5: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/5.jpg)
INTRODUCTIONAlmost every service/system we
use today has an element of software in it.
To make the system reliable, predictable and to run all the time and every time, software has to tested before delivery.
Generally the goal of software testing is to design a set of minimal number of test cases such that it reveals as many faults as possible.
![Page 6: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/6.jpg)
An automated software testing can significantly reduce time and cost of developing software.
![Page 7: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/7.jpg)
DATA FLOW ANALYSIS TECHNIQUE
This section uses the all-uses criterion and the data flow analysis technique.
The example program determines the middle value of three given integers I, J, K.
![Page 8: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/8.jpg)
EXAMPLE PROGRAM
![Page 9: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/9.jpg)
![Page 10: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/10.jpg)
Defs and c-uses are associated with nodes.
p-uses are associated with edges.Two sets dcu(i) and dpu(i,j) are
determined. The def-clear paths are
constructed from the dcu and dpu sets.
![Page 11: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/11.jpg)
![Page 12: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/12.jpg)
![Page 13: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/13.jpg)
ALGORITHMSGENETIC ALGORITHMSInspired by Darwin’s theory of
evolution.It generates useful solutions.Operates on strings called
chromosomes.Each digit that makes up a
chromosome is called a gene.Each chromosome has a fitness
value associated with it, which is the probability of survival of an individual chromosome in the next generation.
![Page 14: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/14.jpg)
A basic pseudo algorithm for a GA:
![Page 15: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/15.jpg)
The fitness function used is mathematically expressed as:
![Page 16: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/16.jpg)
![Page 17: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/17.jpg)
PARTICLE SWARM OPTIMIZATIONDeveloped by Kennedy and
Eberhart.Simulates the behaviour of bird
flocking by which they find food sources.
PSO algorithm works by having a population (called a swarm) of candidate solutions (called particles).
These particles are moved around in the search-space according to a few simple formulae.
![Page 18: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/18.jpg)
For each particle i = 1, ..., S do: Initialize the particle's position with a uniformly distributed random vector:
xi =[xi1 , xi2, … xid ] Initialize the particle's best known
position to its initial position: pi ← xi
If (f(pi) < f(g)) update the swarm's best known position: g ← pi
Initialize the particle's velocity: vi =[vi1 , vi2, … vid ]
![Page 19: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/19.jpg)
◦ For each particle i = 1, ..., S do: For each dimension d = 1, ..., n do:
Update the particle's velocity: vi,d ← ω vi,d + cp rp (pi,d-xi,d) + cg rg (gd-xi,d)
ω is the inertia weight and cp cg are the acceleration constants and rp rg are two random values in range [0,1]
Update the particle's position: xi ← xi + vi
If (f(xi) < f(pi)) do: Update the particle's best known position: pi ← xi
If (f(pi) < f(g)) update the swarm's best known position: g ← pi
Now g holds the best found solution.
Stopping criterion: If the number of iterations exceeds the maximum number of iteration or accumulated coverage is 100% then stop.
![Page 20: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/20.jpg)
![Page 21: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/21.jpg)
CONCLUSIONA set of 12 small FORTRAN programs is used in the experiments.
![Page 22: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/22.jpg)
PSO is able to generate test data automatically that cover successfully the sample program under all du path criteria.
It requires less number of generation to achieve def- use percentage.
![Page 23: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/23.jpg)
REFERENCES
1.http://www.sciacademypublisher.com/journals/index.php/IJRRCS/article/view/457
2.http://en.wikipedia.org/wiki/Particle_swarm_optimization
![Page 24: An automatic test data generation for data flow](https://reader035.fdocuments.us/reader035/viewer/2022062514/558b027cd8b42aaa688b4596/html5/thumbnails/24.jpg)
THANKYOU