SlideShare a Scribd company logo
CONTROL FLOW TESTING
UNIT - 3
1
Prepared By: Ravi J Khimani, CSE Department, SLTIET, Rajkot
CONCEPTS
 Two kinds of Basic Statements in Program
 Assignment Statements
 Conditional Statements
 Conditional Statements alters the default
sequential control flow of program.
 A program unit must be having a proper entry-point
and exit-point, single or multiple.
 Sequence of instruction from Entry-Point to Exit-
Point is called Path. 2
CONCEPTS
 A specific input value causes a specific path to be
executed.
 That performs desired operations to produce
expected output.
 More execution of higher number of paths, at
higher cost, may not be effective to relieve defaults.
 Control Flow Testing is a kind of Structural Testing
which is performed by programmer to test code
written by them.
3
GENERATE TEST INPUT DATA FOR CFT
4
ACTIVITIES IN GENERATE TEST INPUT DATA
 Over all idea of generation test input data is to
perform control flow testing.
 Those activities performed and intermediate results
are produced.
 Input: Source Code & Set of Path Selection Criteria.
 Generation of a Control Flow Graph:
 aim to visualize all possible paths in program unit.
 Graphical Representation of execution.
5
ACTIVITIES IN GENERATE TEST INPUT DATA
 Selection of Paths:
 Paths are selected from CFG to satisfy Path Selection Criteria.
 Generation of a Test Input Data:
 A Path can be executed if and only if input to program unit
cause all conditional statements to true or false as per CFG.
 Such path is called Feasible Path.
 Otherwise it’s known as Infeasible Path.
6
ACTIVITIES IN GENERATE TEST INPUT DATA
 Feasibility Test of Path:
 Idea behind it to check the path is to meet the path selection
criteria.
 If some path founds to be infeasible, then new paths are
selected to be feasible.
7
CONTROL FLOW GRAPH
 A CFG is graphical representation of a program.
 Three symbols are used.
8
9
PATH REPRESENTATION
10
PATH SELECTION CRITERIA
 A Program Unit with small number of paths,
executing all paths may desirable and achievable.
 But if large number of paths, then executing all
path may not be practical.
 What paths do I select for testing?
 it is more productive for programmers to select a
small number of program paths in an effort to
reveal defects
11
ADVANTAGES OF PATH SELECTION
 Following, advantages of selecting paths based on
defined criteria:
 The programmer needs to observe the outcome of
executing each program construct.
 do not generate test inputs which execute the same
path repeatedly. It’s a waste of resources.
 If same path updates state of program, then repeat
execution of same path is not identical.
 Programmer can know the program features that have
been tested and those not tested
12
TECHNIQUES FOR PATH SELECTION
 All-Path coverage criteria
 If all-path are selected in CFG, then one can detect all
faults.
 Except those due to missing path error.
 Program may contain infinite number of paths.
 So, if all paths are selected to perform testing, then all-
path selection criteria has been satisfied.
13
FOR EXAMPLE - ALL-PATH COVERAGE CRITERIA
14
CFG
FOR
OPENFILES()
FUNCTION
15
INPUT DOMAIN AND PATHS
16
TECHNIQUES FOR PATH SELECTION [CONT…]
 Statement Coverage Criteria
 Refers to the individual program statement and
measure the outcome.
 100% achieved if all statements are executed.
 Its weakest coverage criteria.
 All program statements must be represent in CFG with
proper representation.
 So, basic problem is to select few feasible path for
covering all nodes in CFG.
 So, path length should be longer in increasingly
manner.
17
TECHNIQUES FOR PATH SELECTION [CONT…]
 Branch Coverage Criteria
 Each node in CFG may have one or two branches.
 Covering branch means selecting path that includes
that branch.
 Complete branch coverage means selecting a number
of paths such a way that all possible branches must be
included in those path.
18
TECHNIQUES FOR PATH SELECTION [CONT…]
 Predicate Coverage
Criteria
 Includes logic check
inside program, that
covers all
statements and
branch coverage
criteria.
19
TECHNIQUES FOR PATH SELECTION [CONT…]
 So need to design test cases that covers all the
possible conditions (logic).
 The False branch of node 5 (Figure 4.9a) is
executed under exactly one condition, namely,
when OB1 = False, OB2 = False, and OB3 = False,
whereas the true branch executes under seven 20
TECHNIQUES FOR PATH SELECTION [CONT…]
 If all possible combinations of truth values of the
conditions affecting a selected path have been
explored under some tests, then we say that
predicate coverage has been achieved.
 For Example, The path taking the true branch of
node 5 in Figure 4.9a must be executed for all
seven possible combinations of truth values of
OB1, OB2, and OB3 which result in OB = True.
21
GENERATING TEST INPUT
 After having an identified path, main question is
how to select input values?
 Such that, when program is executed with such
input values, the selected path gets executed.
 So, it needs to identify input to force path
execution.
22
GENERATING TEST INPUT
 For that some terms need to go through,
 1. Input Vector
 Collection of all data entities
 Fixed prior entering to routine / program.
 Like, input arguments, global variables, files, network
connections, timers, etc…
 For example, input vector for OPENFILE() function is
presence or absence of file1, file2, file3 and so on.
23
GENERATING TEST INPUT
 2. Predicate
 It’s a logical function evaluated at decision point.
 In this figure, OB is a predicate at decision point
24
GENERATING TEST INPUT
 3. Path Predicate
 It’s a set of predicates associated with the path.
25
GENERATING TEST INPUT
 4. Predicate Interpretation
 Predicate interpretation is defined as the process of
symbolically substituting operations along a path in
order to express the predicates solely in terms of the
input vector and a constant vector.
 Means, there is no role play of local variables inside
functions because they are not visible to outside
functions.
 Those local variables can be easily substituted by the
elements of input vector using symbolic substitution.
26
GENERATING TEST INPUT
27
GENERATING TEST INPUT
 5. Path Predicate Expression
 An interpreted path predicate is called a path predicate
expression with following properties.
 composed of input vector and constant vector
 set of constraints composed from input vector
 Forcing input values can be generated from constraints in path
predicate expression.
 If set of constraint can not be solved, then selected path can
not be executed.
 An infeasible path is not responsible for path predicate
expression, that dissatisfied.
 infeasibility of path forces to choose other path which meet
proper criteria. 28
GENERATING TEST INPUT
29
GENERATING TEST INPUT
 6. Generating Input Data from PPE
 The respective Path Predicate Expression must be
solved in order to generate input data which can force a
program to execute a selected path.
30
COINCIDENTAL CORRECTNESS
 In spite of the fault available in the code, some test
data produces the correct result, that’s known as
Coincidental Correctness.
 For Example,
31
Produces correct result in
CFG at slide number 9
CONTAIN INFEASIBLE PATH
 A CFG may contain number of paths, shorter or
longer.
 Not practical to execute or analyze all paths.
 So, define strategy like,
 Select as many as sort paths which are feasible
 Choose longer path to achieve coverage of statements,
predicates and branches.
 Reduce number of infeasible paths through language
design, program design, program transformations.
CONTAIN INFEASIBLE PATH
 Bertoline and Marre,
 gave an algorithm which generate set of feasible paths.
 Based on idea, Reduced Flow Graph, called ddgraph.
 Yates & Malevries,
 Suggests a strategy to select a path with minimum
number of predicates.
Ad

More Related Content

What's hot (20)

Software Testing
Software TestingSoftware Testing
Software Testing
Mousmi Pawar
 
Software testing & Quality Assurance
Software testing & Quality Assurance Software testing & Quality Assurance
Software testing & Quality Assurance
Webtech Learning
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Nishant Worah
 
Black box software testing
Black box software testingBlack box software testing
Black box software testing
Rana Muhammad Asif
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)
Mani Kanth
 
White box ppt
White box pptWhite box ppt
White box ppt
Chintakunta Hariteja
 
Testing
TestingTesting
Testing
Sonali Chauhan
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
Komal Garg
 
Software Testing or Quality Assurance
Software Testing or Quality AssuranceSoftware Testing or Quality Assurance
Software Testing or Quality Assurance
Trimantra Software Solutions
 
Integration testing
Integration testingIntegration testing
Integration testing
queen jemila
 
Software testing
Software testingSoftware testing
Software testing
balamurugan.k Kalibalamurugan
 
SOFTWARE TESTING
SOFTWARE TESTINGSOFTWARE TESTING
SOFTWARE TESTING
Priyanka Karancy
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
Chankey Pathak
 
Software quality
Software qualitySoftware quality
Software quality
Sara Mehmood
 
Test cases
Test casesTest cases
Test cases
Chandra Maddigapu
 
Test Levels & Techniques
Test Levels & TechniquesTest Levels & Techniques
Test Levels & Techniques
Dhanasekaran Nagarajan
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenance
Indu Sharma Bhardwaj
 
Software Testing and Quality Assurance Assignment 3
Software Testing and Quality Assurance Assignment 3Software Testing and Quality Assurance Assignment 3
Software Testing and Quality Assurance Assignment 3
Gurpreet singh
 
Alpha beta and acceptance testing
Alpha beta and acceptance testing Alpha beta and acceptance testing
Alpha beta and acceptance testing
shah baadshah
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
Himanshu
 

Viewers also liked (16)

Basis path testing
Basis path testingBasis path testing
Basis path testing
Hoa Le
 
Path testing
Path testingPath testing
Path testing
Mohamed Ali
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow Analysis
Edgar Barbosa
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
Kiran Kumar
 
Chapter 9 software maintenance
Chapter 9 software maintenanceChapter 9 software maintenance
Chapter 9 software maintenance
despicable me
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
Heritage Institute Of Tech,India
 
Green Path Criteria
Green Path CriteriaGreen Path Criteria
Green Path Criteria
cabq
 
An automatic test data generation for data flow
An automatic test data generation for data flowAn automatic test data generation for data flow
An automatic test data generation for data flow
WafaQKhan
 
CALIDAD ESPERA
CALIDAD ESPERACALIDAD ESPERA
CALIDAD ESPERA
German Mancheño Sanchez
 
Ab testing work flow
Ab testing work flowAb testing work flow
Ab testing work flow
Jainul Khan
 
Data flowtesting doc
Data flowtesting docData flowtesting doc
Data flowtesting doc
vamshi batchu
 
C++ material
C++ materialC++ material
C++ material
vamshi batchu
 
software testing
software testingsoftware testing
software testing
vamshi batchu
 
Transactionflow
TransactionflowTransactionflow
Transactionflow
vamshi batchu
 
Stm unit1
Stm unit1Stm unit1
Stm unit1
Chaitanya Kn
 
Testing
Testing Testing
Testing
vamshi batchu
 
Ad

Similar to Unit 3 Control Flow Testing (20)

1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt
abdulbasetalselwi
 
Software Testing Part 3.pptx or black box tsting
Software Testing Part 3.pptx or black box tstingSoftware Testing Part 3.pptx or black box tsting
Software Testing Part 3.pptx or black box tsting
MaryamMahjabeenYouni
 
Sta unit 4(abimanyu)
Sta unit 4(abimanyu)Sta unit 4(abimanyu)
Sta unit 4(abimanyu)
Abhimanyu Mishra
 
7-White Box Testing.ppt
7-White Box Testing.ppt7-White Box Testing.ppt
7-White Box Testing.ppt
HirenderPal
 
Software Testing Tecniques
Software Testing TecniquesSoftware Testing Tecniques
Software Testing Tecniques
ersanbilik
 
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTINGA WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
Journal For Research
 
Software Testing and Quality Assurance Software Testing and Quality Assurance
Software Testing and Quality Assurance Software Testing and Quality AssuranceSoftware Testing and Quality Assurance Software Testing and Quality Assurance
Software Testing and Quality Assurance Software Testing and Quality Assurance
badutjayus
 
Ch4-ControlFlowTesting.ppt
Ch4-ControlFlowTesting.pptCh4-ControlFlowTesting.ppt
Ch4-ControlFlowTesting.ppt
BUSHRASHAIKH804312
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07u
Shubham Sharma
 
A Path-Oriented Automatic Random Testing Based on Double Constraint Propagation
A Path-Oriented Automatic Random Testing Based on Double Constraint PropagationA Path-Oriented Automatic Random Testing Based on Double Constraint Propagation
A Path-Oriented Automatic Random Testing Based on Double Constraint Propagation
ijseajournal
 
2. Lect 27 to 28 White box s/w testing.ppt
2. Lect 27 to 28 White box s/w testing.ppt2. Lect 27 to 28 White box s/w testing.ppt
2. Lect 27 to 28 White box s/w testing.ppt
KomalSinghGill
 
Software quality assurance,eTesting.pptx
Software quality assurance,eTesting.pptxSoftware quality assurance,eTesting.pptx
Software quality assurance,eTesting.pptx
singbling
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
Ankit Mulani
 
Calculation of Cyclomatic complexity
Calculation of Cyclomatic complexityCalculation of Cyclomatic complexity
Calculation of Cyclomatic complexity
nikshaikh786
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
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
PraneethBhai1
 
testing(2).pptjjsieieo2i33kejjskskosowwiwk
testing(2).pptjjsieieo2i33kejjskskosowwiwktesting(2).pptjjsieieo2i33kejjskskosowwiwk
testing(2).pptjjsieieo2i33kejjskskosowwiwk
mhuzaifasultan8
 
ST Module 3 vtu prescribed syllabus and scheme
ST Module 3 vtu prescribed syllabus and schemeST Module 3 vtu prescribed syllabus and scheme
ST Module 3 vtu prescribed syllabus and scheme
Shivakumar M
 
Chapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineeringChapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineering
AnasHassan52
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt
abdulbasetalselwi
 
Software Testing Part 3.pptx or black box tsting
Software Testing Part 3.pptx or black box tstingSoftware Testing Part 3.pptx or black box tsting
Software Testing Part 3.pptx or black box tsting
MaryamMahjabeenYouni
 
7-White Box Testing.ppt
7-White Box Testing.ppt7-White Box Testing.ppt
7-White Box Testing.ppt
HirenderPal
 
Software Testing Tecniques
Software Testing TecniquesSoftware Testing Tecniques
Software Testing Tecniques
ersanbilik
 
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTINGA WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
A WHITE BOX TESTING TECHNIQUE IN SOFTWARE TESTING : BASIS PATH TESTING
Journal For Research
 
Software Testing and Quality Assurance Software Testing and Quality Assurance
Software Testing and Quality Assurance Software Testing and Quality AssuranceSoftware Testing and Quality Assurance Software Testing and Quality Assurance
Software Testing and Quality Assurance Software Testing and Quality Assurance
badutjayus
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07u
Shubham Sharma
 
A Path-Oriented Automatic Random Testing Based on Double Constraint Propagation
A Path-Oriented Automatic Random Testing Based on Double Constraint PropagationA Path-Oriented Automatic Random Testing Based on Double Constraint Propagation
A Path-Oriented Automatic Random Testing Based on Double Constraint Propagation
ijseajournal
 
2. Lect 27 to 28 White box s/w testing.ppt
2. Lect 27 to 28 White box s/w testing.ppt2. Lect 27 to 28 White box s/w testing.ppt
2. Lect 27 to 28 White box s/w testing.ppt
KomalSinghGill
 
Software quality assurance,eTesting.pptx
Software quality assurance,eTesting.pptxSoftware quality assurance,eTesting.pptx
Software quality assurance,eTesting.pptx
singbling
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
Ankit Mulani
 
Calculation of Cyclomatic complexity
Calculation of Cyclomatic complexityCalculation of Cyclomatic complexity
Calculation of Cyclomatic complexity
nikshaikh786
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
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
PraneethBhai1
 
testing(2).pptjjsieieo2i33kejjskskosowwiwk
testing(2).pptjjsieieo2i33kejjskskosowwiwktesting(2).pptjjsieieo2i33kejjskskosowwiwk
testing(2).pptjjsieieo2i33kejjskskosowwiwk
mhuzaifasultan8
 
ST Module 3 vtu prescribed syllabus and scheme
ST Module 3 vtu prescribed syllabus and schemeST Module 3 vtu prescribed syllabus and scheme
ST Module 3 vtu prescribed syllabus and scheme
Shivakumar M
 
Chapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineeringChapter 8 Testing Tactics.ppt Software engineering
Chapter 8 Testing Tactics.ppt Software engineering
AnasHassan52
 
Ad

Recently uploaded (20)

DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 

Unit 3 Control Flow Testing

  • 1. CONTROL FLOW TESTING UNIT - 3 1 Prepared By: Ravi J Khimani, CSE Department, SLTIET, Rajkot
  • 2. CONCEPTS  Two kinds of Basic Statements in Program  Assignment Statements  Conditional Statements  Conditional Statements alters the default sequential control flow of program.  A program unit must be having a proper entry-point and exit-point, single or multiple.  Sequence of instruction from Entry-Point to Exit- Point is called Path. 2
  • 3. CONCEPTS  A specific input value causes a specific path to be executed.  That performs desired operations to produce expected output.  More execution of higher number of paths, at higher cost, may not be effective to relieve defaults.  Control Flow Testing is a kind of Structural Testing which is performed by programmer to test code written by them. 3
  • 4. GENERATE TEST INPUT DATA FOR CFT 4
  • 5. ACTIVITIES IN GENERATE TEST INPUT DATA  Over all idea of generation test input data is to perform control flow testing.  Those activities performed and intermediate results are produced.  Input: Source Code & Set of Path Selection Criteria.  Generation of a Control Flow Graph:  aim to visualize all possible paths in program unit.  Graphical Representation of execution. 5
  • 6. ACTIVITIES IN GENERATE TEST INPUT DATA  Selection of Paths:  Paths are selected from CFG to satisfy Path Selection Criteria.  Generation of a Test Input Data:  A Path can be executed if and only if input to program unit cause all conditional statements to true or false as per CFG.  Such path is called Feasible Path.  Otherwise it’s known as Infeasible Path. 6
  • 7. ACTIVITIES IN GENERATE TEST INPUT DATA  Feasibility Test of Path:  Idea behind it to check the path is to meet the path selection criteria.  If some path founds to be infeasible, then new paths are selected to be feasible. 7
  • 8. CONTROL FLOW GRAPH  A CFG is graphical representation of a program.  Three symbols are used. 8
  • 9. 9
  • 11. PATH SELECTION CRITERIA  A Program Unit with small number of paths, executing all paths may desirable and achievable.  But if large number of paths, then executing all path may not be practical.  What paths do I select for testing?  it is more productive for programmers to select a small number of program paths in an effort to reveal defects 11
  • 12. ADVANTAGES OF PATH SELECTION  Following, advantages of selecting paths based on defined criteria:  The programmer needs to observe the outcome of executing each program construct.  do not generate test inputs which execute the same path repeatedly. It’s a waste of resources.  If same path updates state of program, then repeat execution of same path is not identical.  Programmer can know the program features that have been tested and those not tested 12
  • 13. TECHNIQUES FOR PATH SELECTION  All-Path coverage criteria  If all-path are selected in CFG, then one can detect all faults.  Except those due to missing path error.  Program may contain infinite number of paths.  So, if all paths are selected to perform testing, then all- path selection criteria has been satisfied. 13
  • 14. FOR EXAMPLE - ALL-PATH COVERAGE CRITERIA 14
  • 16. INPUT DOMAIN AND PATHS 16
  • 17. TECHNIQUES FOR PATH SELECTION [CONT…]  Statement Coverage Criteria  Refers to the individual program statement and measure the outcome.  100% achieved if all statements are executed.  Its weakest coverage criteria.  All program statements must be represent in CFG with proper representation.  So, basic problem is to select few feasible path for covering all nodes in CFG.  So, path length should be longer in increasingly manner. 17
  • 18. TECHNIQUES FOR PATH SELECTION [CONT…]  Branch Coverage Criteria  Each node in CFG may have one or two branches.  Covering branch means selecting path that includes that branch.  Complete branch coverage means selecting a number of paths such a way that all possible branches must be included in those path. 18
  • 19. TECHNIQUES FOR PATH SELECTION [CONT…]  Predicate Coverage Criteria  Includes logic check inside program, that covers all statements and branch coverage criteria. 19
  • 20. TECHNIQUES FOR PATH SELECTION [CONT…]  So need to design test cases that covers all the possible conditions (logic).  The False branch of node 5 (Figure 4.9a) is executed under exactly one condition, namely, when OB1 = False, OB2 = False, and OB3 = False, whereas the true branch executes under seven 20
  • 21. TECHNIQUES FOR PATH SELECTION [CONT…]  If all possible combinations of truth values of the conditions affecting a selected path have been explored under some tests, then we say that predicate coverage has been achieved.  For Example, The path taking the true branch of node 5 in Figure 4.9a must be executed for all seven possible combinations of truth values of OB1, OB2, and OB3 which result in OB = True. 21
  • 22. GENERATING TEST INPUT  After having an identified path, main question is how to select input values?  Such that, when program is executed with such input values, the selected path gets executed.  So, it needs to identify input to force path execution. 22
  • 23. GENERATING TEST INPUT  For that some terms need to go through,  1. Input Vector  Collection of all data entities  Fixed prior entering to routine / program.  Like, input arguments, global variables, files, network connections, timers, etc…  For example, input vector for OPENFILE() function is presence or absence of file1, file2, file3 and so on. 23
  • 24. GENERATING TEST INPUT  2. Predicate  It’s a logical function evaluated at decision point.  In this figure, OB is a predicate at decision point 24
  • 25. GENERATING TEST INPUT  3. Path Predicate  It’s a set of predicates associated with the path. 25
  • 26. GENERATING TEST INPUT  4. Predicate Interpretation  Predicate interpretation is defined as the process of symbolically substituting operations along a path in order to express the predicates solely in terms of the input vector and a constant vector.  Means, there is no role play of local variables inside functions because they are not visible to outside functions.  Those local variables can be easily substituted by the elements of input vector using symbolic substitution. 26
  • 28. GENERATING TEST INPUT  5. Path Predicate Expression  An interpreted path predicate is called a path predicate expression with following properties.  composed of input vector and constant vector  set of constraints composed from input vector  Forcing input values can be generated from constraints in path predicate expression.  If set of constraint can not be solved, then selected path can not be executed.  An infeasible path is not responsible for path predicate expression, that dissatisfied.  infeasibility of path forces to choose other path which meet proper criteria. 28
  • 30. GENERATING TEST INPUT  6. Generating Input Data from PPE  The respective Path Predicate Expression must be solved in order to generate input data which can force a program to execute a selected path. 30
  • 31. COINCIDENTAL CORRECTNESS  In spite of the fault available in the code, some test data produces the correct result, that’s known as Coincidental Correctness.  For Example, 31 Produces correct result in CFG at slide number 9
  • 32. CONTAIN INFEASIBLE PATH  A CFG may contain number of paths, shorter or longer.  Not practical to execute or analyze all paths.  So, define strategy like,  Select as many as sort paths which are feasible  Choose longer path to achieve coverage of statements, predicates and branches.  Reduce number of infeasible paths through language design, program design, program transformations.
  • 33. CONTAIN INFEASIBLE PATH  Bertoline and Marre,  gave an algorithm which generate set of feasible paths.  Based on idea, Reduced Flow Graph, called ddgraph.  Yates & Malevries,  Suggests a strategy to select a path with minimum number of predicates.