SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Implementation of Algorithm for
Logic Based Testing
Dissertation
Submitted in fulfillment of the
Requirement for the award of the Degree
Master of Technology (IT)
Of
Banasthali Vidyapith
Jaipur Campus
2009-2011
Under The Supervision Of: Submitted By:
Mrs. Usha Badhera Priyanka Gaur
Astt. Professor(AIM & ACT) M.Tech. (IT)
Banasthali Vidyapith, Jaipur Campus Roll No. - 11428
Overview
• Logic Based Testing
• Cause Effect Graphing Technique
• Application of Genetic Algorithm in Software Testing
• Test cases
• Decision table
• Commonly used Process for CEG
• Analysis of Myer’s CEG Approach
• Possible Solution to Drawback of Myers’Approach
• Implementation of Converting a Cause Effect Graph into Decision-
Table
•Implementation of Algorithm on Cases
• Screenshots
• Advantages of CEG Technique
• Implementation of Algorithm on Cases
• Screenshots
• Advantages of CEG Technique
• Analysis of Previous and Implemented Algorithm
•Weighted Graph and Path Testing
• Genetic Algorithm
• Advantage of GA in Software Testing
• Generating Effective Test Cases with GA
• Code with weighted Control Flow Diagram
• Working of Algorithm for Control Flow Graph
• Results
• Conclusion
• References
Logic Based Testing
• The functional requirement of many programs can be specified by decision
table , which provide the useful basis for program and test case Design.
• Consistency and completeness can be analyzed by Boolean Algebra, which
can also be used as a basis for test Design.
• Logic based testing translates the specification that are dominated by logic
and combination of test cases into either Decision Table and develop
functional test cases from those representation.
• Cause Effect Graphing technique is used for develops test cases to
represents input events (Causes) and the corresponding actions(output).
Cause Effect Graphing Technique
• A cause Effect Graphing is basically a hardware testing technique
adapted to software testing .The CEG technique is a black box
method. This is a testing technique that aids in selecting test cases
that logically relate causes to effect to produce test cases.
• Cause – “A Cause is any distinct input condition in the
requirements that may affect the programs output. A cause is
always positive and atomic”.
• Effect – “An Effect is the response of the program to some
combination of input conditions”.
• Constraints - “ Constraint represent external constraints on the
system”.
Application of Genetic Algorithm in
Software Testing
• Automatic Test Case Generation. This Technique extends the random
testing by the use of genetic algorithm.
• GA technique can be applied for finding the most critical path for
software testing efficiency.
• The fitness function of GA for selecting the best possible Test Suit.
• This technique is useful where
(i) a program may contain an infinite number of paths when the
program has loops.
(ii) The number of paths in a program is exponential to the number of
branches in it and many of them is unfeasible.
(iii) the number of test cases is too large
It is impossible to cover all possible paths in Software, The problem
of path testing selects a subset of paths to execute and find test data
to cover it.
Decision table
• Test Cases: A Good test case is a test case whose chances to
finding a bug are more.
• A Decision Table is the method used to build a complete set of
test cases without using the internal structure of the program in
question. In order to create test cases we use a table to contain
the input and output values of a program.
Basically Decision Table has three parts:
• Condition stubs: Lists condition relevant to decision
• Action stubs: Actions that result from a given set of conditions
• Rules: Specify which actions are to be followed for a given set
of conditions.
Commonly used Process for CEG
The commonly used process for CEG can be described in the
following six steps:
• Step 1: Break the specification down into workable pieces.
• Step 2: Identify the causes and effects.
(a) Identify the causes and assign each one a unique number.
(b) Identify the effects or system transformation and assign each
one a unique number.
• Step 3: The semantic content of the specification is analyzed and
transformed into a Boolean graph linking the causes and effects.
This is the cause-effect graph.
Commonly used Process for CEG
• Step 4: Annotate the graph with constraints describing
combinations of causes and/or effects .
• Step 5: Methodically trace state conditions in the graphs,
converting them into a limited-entry decision table. Each column
in the table represents a test case.
• Step 6: The columns in the decision table are converted into test
cases.
Commonly used Process for CEG
Analysis of Myers’ CEG Approach
• Some inconsistencies in
Myers’ CEG Techniques-
i. Difficulty in
identifying causes &
effects because of their
vague description in
Natural language
specification .
ii. Error proneness based
on semantics of natural
language specification
Example – Send file Command
• Each column in the decision
table is converted into a test
case.
• Suppose file f, server r, and
user u are all correct
arguments, then the test case
derived from column 1 in the
decision table will be send and
the expected result is that file f
is successfully sent.
Problem in Myers’ approach -
Observation 1
• Tracing back through an and node
whose output should be 0 all
combination of input leading to a 0
output must be enumerated ,except in
the case where one input is 0 and one
or more of others are 1.
1) If we consider cause c is set to 1 all
the combinations of causes a and b
leading to output 0 at node d should
be considered.
2) Cause c is set to 1 only one situation
where output d is set to zero is
considered(in fig 2.4(c) ).
Ambiguity occurred which misleads
the user.
Observation 2
• Decision table is different If
the syntax is different of the
Cause Effect Graph but the
semantic is same.
• Therefore with these rules,
the set of test cases obtained
from CEG will depend on
how effect e is formulated
thus the rules contradict a
reasonable requirement for
logical inconsistency.
Observation 3
• When building a Decision table , if often happens that some
entries are left blank meaning that irrelevant for presence/
absent of given effect.
• Don’t care conditions are unspecified.
Observation 4
• Missing in the description in
of the CEG Technique is
nothing is said about verifying
conformance of CEG to its
corresponding-natural
language specification may
lead to faulty and incomplete
test cases.
Problems in Myers’ approach –
Observation 5
• Myers’ does not consider when deriving test cases is the forcing of
effects to be absent. He concentrate only on their present.
Possible Solution to Drawbacks in
Myers’Approach
• Cause Set – A cause set of an effect is the set of causes that can affect the
presence or absence of that effect.
• Path Sensitization Technique – In path sensitization Technique
combination of causes are derived from the CEG by sensitizing each
effect of the system to each cause in its corresponding cause set. The
combination of causes obtained can be used to derive actual test data
when the implementation of the system is tested
• Advantage of Path sensitization method:
• They all are algorithmic & they consist of Straightforward and
ambiguous rules for deriving a DT from a CEG.
Implementation of CEG into Decision-
Table
Procedure for generating a decision table from Cause-effect graph.
1. input: A template containing causes C1,C2.....Cp, effects
E1,E2.....Eq then relationship and constraints.
2. output: A decision table DT containing N = p + q rows and M
columns, where M depends on the relationship between the
causes –effect as captured in the cause effect graph.
Procedure CEG_TO_DT:
• Step 1: Read causes and effects from template and for each of the
effect construct binary tree that specifies that effect in terms of
cause’s relationship.
• Step 2: Initialize DT to an empty decision table.
• Step 3: For each of the E, Create Decision Table EDTi as empty
decision table.
Step 4: Execute the following steps for i=1 to q
4.1 – Select the next effect to be processed, Let e = E
4.2 – Starting at e, traverse the effect tree created in previously step and
identify the causes C1, C2 ........etc that are there in tree. Identify all
possible combinations of these causes that lead e to be present. Make
sure that the combinations satisfy any constraints.
4.3 – Add all these possible entries into the decision t able EDTi .
Step 5: Do OR-Operation between all effects that gives all combination of
effects do following:
5.1 Select the decision tables EDTi for all effects that are present in this
combination.
5.2 Take all possible combination of entries of different tables. In this
combination if there is a cause that is there in two or more effect
decision table then take combination in which.
5.3 Enter all these entries into decision table that satisfy all constrain.
End of Procedure: CEG_TO_DT
Implementation Of Algorithm On
Cases
We consider the following set of requirements for implementing the
algorithm:
Requirements for Calculating Car Insurance Premiums:
• r1 For females less than 65 years of age, the premium is $500
• r2 For males less than 25 years of age, the premium is $3000
• r3 For males between 25 and 64 years of age, the premium is $1000
• r4 For anyone 65 years of age or more, the premium is $1500
There are two variables that will determine what the premium will be:
Gender and age. Therefore there are 5 distinct causes or input conditions:
Sex is either male or female, and age is either less than 25, between 25
and 64 inclusive or 65 or more. There are also 4 distinct effects or output
conditions: the premium is$500, $1000, $1500, or $3000.
Screenshots
Cause Effect Graph
Entry of Causes
Entry of Effects
Entry of Cases
CEG_TO_DT
Advantages of CEG Technique
• CEG technique is a useful testing technique to test the
implementation of the system by using test cases derived from
the natural language specification of the system.
• Technique is valid only for Natural language specification that
satisfies the customer intention.
Analysis of Previous and Implemented
Algorithm
• In existing algorithm for each effect binary tree is
generated so complexity for finding all possible
combination is less in comparison with previous
algorithm. Algorithm given is not generating all
possible test cases in all case whereas our algorithm
generates all possible test cases in all the cases.
• Decision Table show in is generated by existing
algorithm which has all possible test cases where as
Decision Table generated according to previous
algorithm has less number of cases.
Weighted Graph and Path Testing
• Weighted Graph : A graph is a weighted graph if a number
(weight) is assigned to each edge. Such weights might
represent, for example, costs, lengths or capacities, etc.
depending on the problem. The weight of the graph is the sum
of the weights given to all edges.
• Path Testing : Testing in which all paths in the program source
code are tested at least once.
Genetic Algorithm
A genetic algorithm (GA) is a heuristic used in computer
science to find an approximate solutions to combinatorial
optimization problems. Genetic algorithms are a particular
class of evolutionary algorithms that use techniques inspired
by evolutionary biology such as inheritance, mutation, natural
selection, and recombination (or crossover).
Advantage of GA in Software-
Testing
• One major advantage of GA is that other searches do not cover ,is
that of a false solution. A problem may have several solutions, some
are better than others. If another type of search finds that one path is
worth pursuing, and discards the other, it may be leading to a
solution which is not best, or even not to solution at all.
• GA have several individuals in its population, each one of which
could be a potential solution to a problem. Which means that it is
even possible for the search to find more than one solution.
Generating Effective Test Cases
with GA
• The problem of test set generation is a typical optimization problem
in a combinatorial search space: we are looking for a minimal set of
test cases that are most likely to reveal faults presenting in a given
program.
• Representation: Each test case can be represented as a vector of
binary or continuous values related to the inputs of the tested
software.
• Initialization: An initial test set can be generated randomly in the
space of possible input values.
• Genetic Operators: Selection, crossover, and mutation operators can
be adapted to representation of test cases for a specific program.
• Evaluation function: Test cases can be evaluated by their fault-
exposing-potential using mutated versions of the original program.
Code with weighted Control Flow
Diagram 0. gcd(int m, int n)
{
int r;
1. if(n>m) {
2. r = m;
3. m = n;
4. n = r;
}
5. r = m % n ;
6. while(r!=0) {
7. m = n ;
8. n = r ;
9. r = m % n;
10. }
11. return n;
12. }
Working of Algorithm for Control
Flow Graph
• Selection : selection for parents for reproduction is done according
to probability distribution based on individual’s fitness values. First
the fitness value is calculated. Here X denotes the test data.
• F(x) : corresponding fitness value calculated for each data set, by
adding the weights of the path followed by it in the CFG.
n
• F=∑ Wi (where Wi weight assigned to ith edge on the path under consideration)
i=1
• Probability of selection pj for each path j
• Pj = F(xi)/ ∑ F(xi) (where i=1 to n and n = initial population size)
k
• Calculate cumulative probability Ci = ∑ pj
j=1
• Ran: Random number generated for the test data
• Ns : Test data numbers that has cumulative probability just greater
than the corresponding random number.
• Mating pool : This column contains the number of times a test
data appears in the Ns column.
• Steps for carrying out cross over and mutation:
• Mutation: For each entry in the new data set, bit-wise random
number are generated. And for random number values less than
0.3, that corresponding bit is flipped to obtain a new data entry.
• Same procedure is carried out for the new data set obtained for
further crossover and mutation until we start getting better values
of the fitness function F(x).
Example 1: Initial population: (n, m) (15, 4), (5, 6), (6, 2), (4, 12)
Fitness function used: Summation of weights of path traversed by
a given input data in CFG For example (15, 4) will travel the path
0-1-2-3-4-5-6-7-8-9-6-7-8-9-6-10-11-12 and therefore its fitness
value is 108 Since the mating pool consists of only (15, 4) therefore
this is the test data that should be used for the testing of the code
during execution. This is because the mating pool depicts the
population that will mate in the next iteration. Here since the only
value in mating pool is (15, 4), this shows that no further
improvement in the fitness function value can be achieved with
further reproduction and mutation. Thus (15, 4) is the test data that
should be used as input for software testing.
Results
S.No X F(x) Pi Ci Ran Ns Mating
pool
1 (12,8) 76 0.228 0.228 0.934 4 0
2 (2,3) 106 0.317 0.545 0.474 2 2
3 (6,2) 44 0.132 0.677 0.374 2 1
4 (15,4) 108 0.323 1.000 0.618 3 1
Iteration 1: Table 7 and Table 8
S.No Ns Mating pool Crossover Mutation
1 4 (15,4)
11110100
(15,4)
11110100
(15,5)
11110101
2 2 (2,3)
00100011
(2,3)
00100011
(3,3)
00110011
3 2 (2,3)
00100011
(2,2)
00100010
(2,2)
00100010
4 3 (6,2)
01100010
(6,2)
01100010
(10,3)
10100011
Iteration 2: Table 9 and Table 10
S.No X F(x) Pi Ci Ran Ns Mating
pool
1 (15,5) 44 0.212 0.212 0.217 2 0
2 (3,3) 44 0.212 0.424 0.999 4 1
3 (2,2) 44 0.212 0.636 0.979 4 1
4 (10,3) 76 0.364 1.000 0.533 3 2
S.No Ns Mating pool Crossover Mutation
1 2 (3,3)
00110011
(3,2)
00110010
(5,10)
01011010
2 4 (10,3)
10100011
(10,3)
10100010
(9,10)
10010101
3 4 (10,3)
10100011
(10,3)
10100010
(11,6)
10110110
4 3 (2,2)
00100010
(2,3)
00100011
(2,2)
00100010
S.No X F(x) Pi Ci Ran Ns Mating
pool
1 (5,10) 74 0.223 0.223 0.934 4 0
2 (9,10) 106 0.319 0.542 0.474 2 2
3 (11,6) 108 0.325 0.867 0.374 2 1
4 (2,2) 44 0.133 1.000 0.618 3 1
S.No Ns Mating pool Crossover Mutation
1 4 (2,2)
00100010
(2,2)
00100010
(4,3)
00100011
2 2 (9,10)
10011010
(9,10)
10011010
(7,12)
01111100
3 2 (9,10)
10011010
(9,10)
10011010
(13,10)
11011010
4 3 (11,6)
10110110
(11,6)
10110110
(2,6)
00100110
Iteration 3: Table 11 and Table 12
S.No X F(x) Pi Ci Ran Ns Mating
pool
1 (4,3) 76 0.178 0.178 0.098 1 1
2 (7,12) 170 0.399 0.577 0.275 2 3
3 (13,10) 106 0.249 0.826 0.325 2 0
4 (2,6) 74 0.174 1.000 0.487 2 0
Iteration 4: Table 13
Result : From the Table 13 the optimized path 170 because its rank is high which is 3.
Conclusion
• The goal is to validate the informal specification is well. We
developed a tool to derive the decision table and the customer-
directed scenarios automatically from a given Cause-Effect Graph
specification. The CEG is input in a text format; our tool gives
outputs the decision table and the customer directed scenarios.
• we applied some optimization approach for more effective software
Testing. Genetic algorithms are often used for optimization
problems in which the evolution of a population is a search for a
satisfactory solution given a set of constraints.
• We have demonstrated that it is possible to apply Genetic Algorithm
techniques for finding the most critical paths for improving software
testing efficiency. The Genetic Algorithms also outperforms the
exhaustive search and local search techniques.
References
[1] Aditya P mathur, “Foundation of Software Testing”, 1st edition Pearson Education 2008.
[2] Alander, J.T., Mantere, T., and Turunen, P, “Genetic Algorithm Based Software Testing,”
http://citeseer.ist.psu.edu/40769.html, 1997.
[3] Berndt, D.J., Fisher, J., Johnson, L., Pinglikar, J., and Watkins, A., “High Volume
Software Testing with Genetic Algorithms,” In Proceedings of the Thirty-Eighth Hawaii
International Conference on System Sciences (HICSS-38), Hawaii, January 2005.
[4] Cai Ferriday, “A Review paper on Decision Table Based Testing”, 2007
[5] Goldberg, D.E, “Genetic Algorithms: in Search, Optimization & Machine Learning,”
Addison Wesley, MA. 1989.
[6] Khenaidoo Nursimulu, Robert L. Probert,“Cause-Effect Graphing Analysis and
validation of Requirements”, CASCON '95 Proceedings of the 1995 conference of the
Centre for Advanced Studies on Collaborative research.
[7] Kuo-Chang Tai 1, Amit Paradkar 2, Husn Kang Su and Mladen A. Vouk, “Fault
BasedTest Generation for Cause-Effect Graphs”, CASCON '93 Proceedings of the 1993
conference of the Centre for Advanced Studies on Collaborative research.
[8] Myers, G.L., “The Art of Software Testing ”,Wiley-Interscience , New-York.
[9] Praveen Ranjan Srivastava, Parshad Patel, Siddharth Chatrola “Converting Cause Effect
Graph to Decision Table.” Vol. 2, No.4, October 2009
[10] Praveen Ranjan Srivastava, Tai-hoon Kim, “Application of Genetic Algorithm in
software Testing” International Journal of Software Engineering and Its Applications
Vol. 3, No.4, October 2009
[11] Reeves, C. R.: Using Genetic Algorithms with Small Populations, Proc. of the Fifth
International Conference on Genetic Algorithms and Their Applications, Morgan
Kaufmann, (1993) 92-99.
[12] Rex Black,“Advanced Software Test Design Techniques, Decision Tables and
cause-Effect Graphs”, Advanced Software Testing: Vol. 1, 2009
[13] Schroeder P. J., and Korel, B. “Black-Box Test Reduction Using Input-Output
Analysis”. In Proc. of ISSTA '00 (2000),173-177.
[14] Vouk, M.A. and R.E. Coyle (1989), “BGG: A Testing Coverage Tool,” In
Proceedings of 7th Annual Pacific Northwest Software Quality Conference,
Lawrence and Craig, Inc., Portland, OR, pp. 212–233.
[15] The Westfall Team, “Cause-Effect Graphing by Theresa Hunt”, 2007.
Thank You.

Weitere ähnliche Inhalte

Was ist angesagt?

Decision Support Analyss for Software Effort Estimation by Analogy
Decision Support Analyss for Software Effort Estimation by AnalogyDecision Support Analyss for Software Effort Estimation by Analogy
Decision Support Analyss for Software Effort Estimation by AnalogyTim Menzies
 
Feature enginnering and selection
Feature enginnering and selectionFeature enginnering and selection
Feature enginnering and selectionDavis David
 
Taguchi design of experiments nov 24 2013
Taguchi design of experiments nov 24 2013Taguchi design of experiments nov 24 2013
Taguchi design of experiments nov 24 2013Charlton Inao
 
ScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScio Consulting
 
Cukic Promise08 V3
Cukic Promise08 V3Cukic Promise08 V3
Cukic Promise08 V3gregoryg
 
Steps In Experimental Design ( QE )
Steps In Experimental Design ( QE )Steps In Experimental Design ( QE )
Steps In Experimental Design ( QE )Pandya Kartik
 
Timetable management system(chapter 3)
Timetable management system(chapter 3)Timetable management system(chapter 3)
Timetable management system(chapter 3)Emeer95
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniquesM Branikno Ramadhan
 
Sensitivity analysis
Sensitivity analysisSensitivity analysis
Sensitivity analysissunilgv06
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniquesIrvan Febry
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniquesmuhammad afif
 
Design of experiments
Design of experimentsDesign of experiments
Design of experimentsCynthia Cumby
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniquesAji Pamungkas Prasetio
 
Design of experiments
Design of experimentsDesign of experiments
Design of experimentsUpendra K
 
Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...
Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...
Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...ESEM 2014
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniquesYoga Setiawan
 
Specification based or black box techniques (andika m)
Specification based or black box techniques (andika m)Specification based or black box techniques (andika m)
Specification based or black box techniques (andika m)Andika Mardanu
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniquesDinul
 

Was ist angesagt? (20)

Output analysis of a single model
Output analysis of a single modelOutput analysis of a single model
Output analysis of a single model
 
Decision Support Analyss for Software Effort Estimation by Analogy
Decision Support Analyss for Software Effort Estimation by AnalogyDecision Support Analyss for Software Effort Estimation by Analogy
Decision Support Analyss for Software Effort Estimation by Analogy
 
Feature enginnering and selection
Feature enginnering and selectionFeature enginnering and selection
Feature enginnering and selection
 
Taguchi design of experiments nov 24 2013
Taguchi design of experiments nov 24 2013Taguchi design of experiments nov 24 2013
Taguchi design of experiments nov 24 2013
 
Model checking With ATM
Model checking With ATM Model checking With ATM
Model checking With ATM
 
ScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScioTalks | Coverage Based Testing
ScioTalks | Coverage Based Testing
 
Cukic Promise08 V3
Cukic Promise08 V3Cukic Promise08 V3
Cukic Promise08 V3
 
Steps In Experimental Design ( QE )
Steps In Experimental Design ( QE )Steps In Experimental Design ( QE )
Steps In Experimental Design ( QE )
 
Timetable management system(chapter 3)
Timetable management system(chapter 3)Timetable management system(chapter 3)
Timetable management system(chapter 3)
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniques
 
Sensitivity analysis
Sensitivity analysisSensitivity analysis
Sensitivity analysis
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniques
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniques
 
Design of experiments
Design of experimentsDesign of experiments
Design of experiments
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniques
 
Design of experiments
Design of experimentsDesign of experiments
Design of experiments
 
Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...
Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...
Effect of Temporal Collaboration Network, Maintenance Activity, and Experienc...
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniques
 
Specification based or black box techniques (andika m)
Specification based or black box techniques (andika m)Specification based or black box techniques (andika m)
Specification based or black box techniques (andika m)
 
Specification based or black box techniques
Specification based or black box techniquesSpecification based or black box techniques
Specification based or black box techniques
 

Ähnlich wie Gaur11428

Test Case Design
Test Case DesignTest Case Design
Test Case DesignVidya-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueFayis-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueANKUR-BA
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & TechniqueRajesh-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueSachin-QA
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxPraneethBhai1
 
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESSTHE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESSVESIT/University of Mumbai
 
Istqb exam sample_paper_1
Istqb exam sample_paper_1Istqb exam sample_paper_1
Istqb exam sample_paper_1TestingGeeks
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.pptabdulbasetalselwi
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented SoftwarePraveen Penumathsa
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Praveen Penumathsa
 
Planning of experiment in industrial research
Planning of experiment in industrial researchPlanning of experiment in industrial research
Planning of experiment in industrial researchpbbharate
 
Final Exam Questions Fall03
Final Exam Questions Fall03Final Exam Questions Fall03
Final Exam Questions Fall03Radu_Negulescu
 
Test Optimization With Design of Experiment
Test Optimization With Design of ExperimentTest Optimization With Design of Experiment
Test Optimization With Design of Experimentajitbkulkarni
 
Sample Paper 1233140926359988 2
Sample Paper 1233140926359988 2Sample Paper 1233140926359988 2
Sample Paper 1233140926359988 2mnassef
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing FundamentalsKiran Kumar
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategyijseajournal
 

Ähnlich wie Gaur11428 (20)

Testing
TestingTesting
Testing
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & Technique
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptx
 
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESSTHE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
 
Blackbox
BlackboxBlackbox
Blackbox
 
Istqb exam sample_paper_1
Istqb exam sample_paper_1Istqb exam sample_paper_1
Istqb exam sample_paper_1
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
Planning of experiment in industrial research
Planning of experiment in industrial researchPlanning of experiment in industrial research
Planning of experiment in industrial research
 
Blackbox
BlackboxBlackbox
Blackbox
 
Final Exam Questions Fall03
Final Exam Questions Fall03Final Exam Questions Fall03
Final Exam Questions Fall03
 
Test Optimization With Design of Experiment
Test Optimization With Design of ExperimentTest Optimization With Design of Experiment
Test Optimization With Design of Experiment
 
Sample Paper 1233140926359988 2
Sample Paper 1233140926359988 2Sample Paper 1233140926359988 2
Sample Paper 1233140926359988 2
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategy
 

Kürzlich hochgeladen

Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 

Kürzlich hochgeladen (20)

Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 

Gaur11428

  • 1. Implementation of Algorithm for Logic Based Testing Dissertation Submitted in fulfillment of the Requirement for the award of the Degree Master of Technology (IT) Of Banasthali Vidyapith Jaipur Campus 2009-2011 Under The Supervision Of: Submitted By: Mrs. Usha Badhera Priyanka Gaur Astt. Professor(AIM & ACT) M.Tech. (IT) Banasthali Vidyapith, Jaipur Campus Roll No. - 11428
  • 2. Overview • Logic Based Testing • Cause Effect Graphing Technique • Application of Genetic Algorithm in Software Testing • Test cases • Decision table • Commonly used Process for CEG • Analysis of Myer’s CEG Approach • Possible Solution to Drawback of Myers’Approach • Implementation of Converting a Cause Effect Graph into Decision- Table •Implementation of Algorithm on Cases • Screenshots • Advantages of CEG Technique
  • 3. • Implementation of Algorithm on Cases • Screenshots • Advantages of CEG Technique • Analysis of Previous and Implemented Algorithm •Weighted Graph and Path Testing • Genetic Algorithm • Advantage of GA in Software Testing • Generating Effective Test Cases with GA • Code with weighted Control Flow Diagram • Working of Algorithm for Control Flow Graph • Results • Conclusion • References
  • 4. Logic Based Testing • The functional requirement of many programs can be specified by decision table , which provide the useful basis for program and test case Design. • Consistency and completeness can be analyzed by Boolean Algebra, which can also be used as a basis for test Design. • Logic based testing translates the specification that are dominated by logic and combination of test cases into either Decision Table and develop functional test cases from those representation. • Cause Effect Graphing technique is used for develops test cases to represents input events (Causes) and the corresponding actions(output).
  • 5. Cause Effect Graphing Technique • A cause Effect Graphing is basically a hardware testing technique adapted to software testing .The CEG technique is a black box method. This is a testing technique that aids in selecting test cases that logically relate causes to effect to produce test cases. • Cause – “A Cause is any distinct input condition in the requirements that may affect the programs output. A cause is always positive and atomic”. • Effect – “An Effect is the response of the program to some combination of input conditions”. • Constraints - “ Constraint represent external constraints on the system”.
  • 6. Application of Genetic Algorithm in Software Testing • Automatic Test Case Generation. This Technique extends the random testing by the use of genetic algorithm. • GA technique can be applied for finding the most critical path for software testing efficiency. • The fitness function of GA for selecting the best possible Test Suit. • This technique is useful where (i) a program may contain an infinite number of paths when the program has loops. (ii) The number of paths in a program is exponential to the number of branches in it and many of them is unfeasible. (iii) the number of test cases is too large It is impossible to cover all possible paths in Software, The problem of path testing selects a subset of paths to execute and find test data to cover it.
  • 7. Decision table • Test Cases: A Good test case is a test case whose chances to finding a bug are more. • A Decision Table is the method used to build a complete set of test cases without using the internal structure of the program in question. In order to create test cases we use a table to contain the input and output values of a program. Basically Decision Table has three parts: • Condition stubs: Lists condition relevant to decision • Action stubs: Actions that result from a given set of conditions • Rules: Specify which actions are to be followed for a given set of conditions.
  • 8. Commonly used Process for CEG The commonly used process for CEG can be described in the following six steps: • Step 1: Break the specification down into workable pieces. • Step 2: Identify the causes and effects. (a) Identify the causes and assign each one a unique number. (b) Identify the effects or system transformation and assign each one a unique number. • Step 3: The semantic content of the specification is analyzed and transformed into a Boolean graph linking the causes and effects. This is the cause-effect graph.
  • 9. Commonly used Process for CEG • Step 4: Annotate the graph with constraints describing combinations of causes and/or effects . • Step 5: Methodically trace state conditions in the graphs, converting them into a limited-entry decision table. Each column in the table represents a test case. • Step 6: The columns in the decision table are converted into test cases.
  • 11. Analysis of Myers’ CEG Approach • Some inconsistencies in Myers’ CEG Techniques- i. Difficulty in identifying causes & effects because of their vague description in Natural language specification . ii. Error proneness based on semantics of natural language specification
  • 12. Example – Send file Command • Each column in the decision table is converted into a test case. • Suppose file f, server r, and user u are all correct arguments, then the test case derived from column 1 in the decision table will be send and the expected result is that file f is successfully sent.
  • 13. Problem in Myers’ approach - Observation 1 • Tracing back through an and node whose output should be 0 all combination of input leading to a 0 output must be enumerated ,except in the case where one input is 0 and one or more of others are 1. 1) If we consider cause c is set to 1 all the combinations of causes a and b leading to output 0 at node d should be considered. 2) Cause c is set to 1 only one situation where output d is set to zero is considered(in fig 2.4(c) ). Ambiguity occurred which misleads the user.
  • 14. Observation 2 • Decision table is different If the syntax is different of the Cause Effect Graph but the semantic is same. • Therefore with these rules, the set of test cases obtained from CEG will depend on how effect e is formulated thus the rules contradict a reasonable requirement for logical inconsistency.
  • 15. Observation 3 • When building a Decision table , if often happens that some entries are left blank meaning that irrelevant for presence/ absent of given effect. • Don’t care conditions are unspecified.
  • 16. Observation 4 • Missing in the description in of the CEG Technique is nothing is said about verifying conformance of CEG to its corresponding-natural language specification may lead to faulty and incomplete test cases.
  • 17. Problems in Myers’ approach – Observation 5 • Myers’ does not consider when deriving test cases is the forcing of effects to be absent. He concentrate only on their present.
  • 18. Possible Solution to Drawbacks in Myers’Approach • Cause Set – A cause set of an effect is the set of causes that can affect the presence or absence of that effect. • Path Sensitization Technique – In path sensitization Technique combination of causes are derived from the CEG by sensitizing each effect of the system to each cause in its corresponding cause set. The combination of causes obtained can be used to derive actual test data when the implementation of the system is tested • Advantage of Path sensitization method: • They all are algorithmic & they consist of Straightforward and ambiguous rules for deriving a DT from a CEG.
  • 19. Implementation of CEG into Decision- Table Procedure for generating a decision table from Cause-effect graph. 1. input: A template containing causes C1,C2.....Cp, effects E1,E2.....Eq then relationship and constraints. 2. output: A decision table DT containing N = p + q rows and M columns, where M depends on the relationship between the causes –effect as captured in the cause effect graph. Procedure CEG_TO_DT: • Step 1: Read causes and effects from template and for each of the effect construct binary tree that specifies that effect in terms of cause’s relationship. • Step 2: Initialize DT to an empty decision table. • Step 3: For each of the E, Create Decision Table EDTi as empty decision table.
  • 20. Step 4: Execute the following steps for i=1 to q 4.1 – Select the next effect to be processed, Let e = E 4.2 – Starting at e, traverse the effect tree created in previously step and identify the causes C1, C2 ........etc that are there in tree. Identify all possible combinations of these causes that lead e to be present. Make sure that the combinations satisfy any constraints. 4.3 – Add all these possible entries into the decision t able EDTi . Step 5: Do OR-Operation between all effects that gives all combination of effects do following: 5.1 Select the decision tables EDTi for all effects that are present in this combination. 5.2 Take all possible combination of entries of different tables. In this combination if there is a cause that is there in two or more effect decision table then take combination in which. 5.3 Enter all these entries into decision table that satisfy all constrain. End of Procedure: CEG_TO_DT
  • 21. Implementation Of Algorithm On Cases We consider the following set of requirements for implementing the algorithm: Requirements for Calculating Car Insurance Premiums: • r1 For females less than 65 years of age, the premium is $500 • r2 For males less than 25 years of age, the premium is $3000 • r3 For males between 25 and 64 years of age, the premium is $1000 • r4 For anyone 65 years of age or more, the premium is $1500 There are two variables that will determine what the premium will be: Gender and age. Therefore there are 5 distinct causes or input conditions: Sex is either male or female, and age is either less than 25, between 25 and 64 inclusive or 65 or more. There are also 4 distinct effects or output conditions: the premium is$500, $1000, $1500, or $3000.
  • 27. Advantages of CEG Technique • CEG technique is a useful testing technique to test the implementation of the system by using test cases derived from the natural language specification of the system. • Technique is valid only for Natural language specification that satisfies the customer intention.
  • 28. Analysis of Previous and Implemented Algorithm • In existing algorithm for each effect binary tree is generated so complexity for finding all possible combination is less in comparison with previous algorithm. Algorithm given is not generating all possible test cases in all case whereas our algorithm generates all possible test cases in all the cases. • Decision Table show in is generated by existing algorithm which has all possible test cases where as Decision Table generated according to previous algorithm has less number of cases.
  • 29. Weighted Graph and Path Testing • Weighted Graph : A graph is a weighted graph if a number (weight) is assigned to each edge. Such weights might represent, for example, costs, lengths or capacities, etc. depending on the problem. The weight of the graph is the sum of the weights given to all edges. • Path Testing : Testing in which all paths in the program source code are tested at least once.
  • 30. Genetic Algorithm A genetic algorithm (GA) is a heuristic used in computer science to find an approximate solutions to combinatorial optimization problems. Genetic algorithms are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, natural selection, and recombination (or crossover).
  • 31. Advantage of GA in Software- Testing • One major advantage of GA is that other searches do not cover ,is that of a false solution. A problem may have several solutions, some are better than others. If another type of search finds that one path is worth pursuing, and discards the other, it may be leading to a solution which is not best, or even not to solution at all. • GA have several individuals in its population, each one of which could be a potential solution to a problem. Which means that it is even possible for the search to find more than one solution.
  • 32. Generating Effective Test Cases with GA • The problem of test set generation is a typical optimization problem in a combinatorial search space: we are looking for a minimal set of test cases that are most likely to reveal faults presenting in a given program. • Representation: Each test case can be represented as a vector of binary or continuous values related to the inputs of the tested software. • Initialization: An initial test set can be generated randomly in the space of possible input values. • Genetic Operators: Selection, crossover, and mutation operators can be adapted to representation of test cases for a specific program. • Evaluation function: Test cases can be evaluated by their fault- exposing-potential using mutated versions of the original program.
  • 33. Code with weighted Control Flow Diagram 0. gcd(int m, int n) { int r; 1. if(n>m) { 2. r = m; 3. m = n; 4. n = r; } 5. r = m % n ; 6. while(r!=0) { 7. m = n ; 8. n = r ; 9. r = m % n; 10. } 11. return n; 12. }
  • 34. Working of Algorithm for Control Flow Graph • Selection : selection for parents for reproduction is done according to probability distribution based on individual’s fitness values. First the fitness value is calculated. Here X denotes the test data. • F(x) : corresponding fitness value calculated for each data set, by adding the weights of the path followed by it in the CFG. n • F=∑ Wi (where Wi weight assigned to ith edge on the path under consideration) i=1 • Probability of selection pj for each path j • Pj = F(xi)/ ∑ F(xi) (where i=1 to n and n = initial population size) k • Calculate cumulative probability Ci = ∑ pj j=1
  • 35. • Ran: Random number generated for the test data • Ns : Test data numbers that has cumulative probability just greater than the corresponding random number. • Mating pool : This column contains the number of times a test data appears in the Ns column. • Steps for carrying out cross over and mutation: • Mutation: For each entry in the new data set, bit-wise random number are generated. And for random number values less than 0.3, that corresponding bit is flipped to obtain a new data entry. • Same procedure is carried out for the new data set obtained for further crossover and mutation until we start getting better values of the fitness function F(x).
  • 36. Example 1: Initial population: (n, m) (15, 4), (5, 6), (6, 2), (4, 12) Fitness function used: Summation of weights of path traversed by a given input data in CFG For example (15, 4) will travel the path 0-1-2-3-4-5-6-7-8-9-6-7-8-9-6-10-11-12 and therefore its fitness value is 108 Since the mating pool consists of only (15, 4) therefore this is the test data that should be used for the testing of the code during execution. This is because the mating pool depicts the population that will mate in the next iteration. Here since the only value in mating pool is (15, 4), this shows that no further improvement in the fitness function value can be achieved with further reproduction and mutation. Thus (15, 4) is the test data that should be used as input for software testing.
  • 37. Results S.No X F(x) Pi Ci Ran Ns Mating pool 1 (12,8) 76 0.228 0.228 0.934 4 0 2 (2,3) 106 0.317 0.545 0.474 2 2 3 (6,2) 44 0.132 0.677 0.374 2 1 4 (15,4) 108 0.323 1.000 0.618 3 1 Iteration 1: Table 7 and Table 8 S.No Ns Mating pool Crossover Mutation 1 4 (15,4) 11110100 (15,4) 11110100 (15,5) 11110101 2 2 (2,3) 00100011 (2,3) 00100011 (3,3) 00110011 3 2 (2,3) 00100011 (2,2) 00100010 (2,2) 00100010 4 3 (6,2) 01100010 (6,2) 01100010 (10,3) 10100011
  • 38. Iteration 2: Table 9 and Table 10 S.No X F(x) Pi Ci Ran Ns Mating pool 1 (15,5) 44 0.212 0.212 0.217 2 0 2 (3,3) 44 0.212 0.424 0.999 4 1 3 (2,2) 44 0.212 0.636 0.979 4 1 4 (10,3) 76 0.364 1.000 0.533 3 2 S.No Ns Mating pool Crossover Mutation 1 2 (3,3) 00110011 (3,2) 00110010 (5,10) 01011010 2 4 (10,3) 10100011 (10,3) 10100010 (9,10) 10010101 3 4 (10,3) 10100011 (10,3) 10100010 (11,6) 10110110 4 3 (2,2) 00100010 (2,3) 00100011 (2,2) 00100010
  • 39. S.No X F(x) Pi Ci Ran Ns Mating pool 1 (5,10) 74 0.223 0.223 0.934 4 0 2 (9,10) 106 0.319 0.542 0.474 2 2 3 (11,6) 108 0.325 0.867 0.374 2 1 4 (2,2) 44 0.133 1.000 0.618 3 1 S.No Ns Mating pool Crossover Mutation 1 4 (2,2) 00100010 (2,2) 00100010 (4,3) 00100011 2 2 (9,10) 10011010 (9,10) 10011010 (7,12) 01111100 3 2 (9,10) 10011010 (9,10) 10011010 (13,10) 11011010 4 3 (11,6) 10110110 (11,6) 10110110 (2,6) 00100110 Iteration 3: Table 11 and Table 12
  • 40. S.No X F(x) Pi Ci Ran Ns Mating pool 1 (4,3) 76 0.178 0.178 0.098 1 1 2 (7,12) 170 0.399 0.577 0.275 2 3 3 (13,10) 106 0.249 0.826 0.325 2 0 4 (2,6) 74 0.174 1.000 0.487 2 0 Iteration 4: Table 13 Result : From the Table 13 the optimized path 170 because its rank is high which is 3.
  • 41. Conclusion • The goal is to validate the informal specification is well. We developed a tool to derive the decision table and the customer- directed scenarios automatically from a given Cause-Effect Graph specification. The CEG is input in a text format; our tool gives outputs the decision table and the customer directed scenarios. • we applied some optimization approach for more effective software Testing. Genetic algorithms are often used for optimization problems in which the evolution of a population is a search for a satisfactory solution given a set of constraints. • We have demonstrated that it is possible to apply Genetic Algorithm techniques for finding the most critical paths for improving software testing efficiency. The Genetic Algorithms also outperforms the exhaustive search and local search techniques.
  • 42. References [1] Aditya P mathur, “Foundation of Software Testing”, 1st edition Pearson Education 2008. [2] Alander, J.T., Mantere, T., and Turunen, P, “Genetic Algorithm Based Software Testing,” http://citeseer.ist.psu.edu/40769.html, 1997. [3] Berndt, D.J., Fisher, J., Johnson, L., Pinglikar, J., and Watkins, A., “High Volume Software Testing with Genetic Algorithms,” In Proceedings of the Thirty-Eighth Hawaii International Conference on System Sciences (HICSS-38), Hawaii, January 2005. [4] Cai Ferriday, “A Review paper on Decision Table Based Testing”, 2007 [5] Goldberg, D.E, “Genetic Algorithms: in Search, Optimization & Machine Learning,” Addison Wesley, MA. 1989. [6] Khenaidoo Nursimulu, Robert L. Probert,“Cause-Effect Graphing Analysis and validation of Requirements”, CASCON '95 Proceedings of the 1995 conference of the Centre for Advanced Studies on Collaborative research.
  • 43. [7] Kuo-Chang Tai 1, Amit Paradkar 2, Husn Kang Su and Mladen A. Vouk, “Fault BasedTest Generation for Cause-Effect Graphs”, CASCON '93 Proceedings of the 1993 conference of the Centre for Advanced Studies on Collaborative research. [8] Myers, G.L., “The Art of Software Testing ”,Wiley-Interscience , New-York. [9] Praveen Ranjan Srivastava, Parshad Patel, Siddharth Chatrola “Converting Cause Effect Graph to Decision Table.” Vol. 2, No.4, October 2009 [10] Praveen Ranjan Srivastava, Tai-hoon Kim, “Application of Genetic Algorithm in software Testing” International Journal of Software Engineering and Its Applications Vol. 3, No.4, October 2009 [11] Reeves, C. R.: Using Genetic Algorithms with Small Populations, Proc. of the Fifth International Conference on Genetic Algorithms and Their Applications, Morgan Kaufmann, (1993) 92-99.
  • 44. [12] Rex Black,“Advanced Software Test Design Techniques, Decision Tables and cause-Effect Graphs”, Advanced Software Testing: Vol. 1, 2009 [13] Schroeder P. J., and Korel, B. “Black-Box Test Reduction Using Input-Output Analysis”. In Proc. of ISSTA '00 (2000),173-177. [14] Vouk, M.A. and R.E. Coyle (1989), “BGG: A Testing Coverage Tool,” In Proceedings of 7th Annual Pacific Northwest Software Quality Conference, Lawrence and Craig, Inc., Portland, OR, pp. 212–233. [15] The Westfall Team, “Cause-Effect Graphing by Theresa Hunt”, 2007.