SlideShare a Scribd company logo
1 of 10
White Box Testing
Software Testing
Consider a program for the classification of a triangle. Its input is a
triple of positive integers (say a,b,c) from the interval [1,100]. The output may be
[Scalene, Isosceles, Equilateral, Not a triangle].
Draw the flow graph & DD Path graph. Also find the independent paths from the DD
Path graph.
Software Testing
Software Testing
Code of triangle classification problem
Software Testing
Solution :
Flow graph of
triangle problem is:
Program flow graph
Software Testing
The mapping table for DD path graph is:
Remarks
Flow graph
nodes
DD Path graph
corresponding
node
1 TO 9 Sequential nodes
Decision node
10
11
12, 13
14
15, 16, 17
18
19
Decision node
Sequential nodes
Two edges are joined here
Sequential nodes
Decision nodes plus joining of two edges
Decision node
Sequential nodes
Decision node
Sequential nodes
20, 21
22
23, 24
25, 26, 27
A
B
C
D
E
F
G
H
I
J
K
L Sequential nodes
Cont….
Software Testing
Remarks
Flow graph DD Path graph
nodes corresponding
node
28 M Three edges are combined here
29 N Decision node
30, 31 O Sequential nodes
32, 33, 34 P Sequential nodes
35 Q Three edges are combined here
36, 37 R Sequential nodes with exit node
DD Path graph
Software Testing
DD Path graph is given below:
Independent paths are:
(i) ABFGNPQR
(ii) ABFGNOQR
(iii) ABCEGNPQR
(iv) ABCDEGNOQR
(v) ABFGHIMQR
(vi) ABFGHJKMQR
(vii)ABFGHJLMQR
DD Path graph
Software Testing
Consider the classification of triangle problem. Find
the cyclomatic complexity.
Software Testing
Solution
Number of edges (e) = 23
Number of nodes (n) =18
(i) V(G) = e - n + 2P = 23 - 18 + 2 = 7
(ii) V(G) = π + 1 = 6 + 1 = 7
(iii) V(G) = Number of regions = 7
The cyclomatic complexity is 7. Hence, there are seven independent paths

More Related Content

Similar to WINSEM2021-22_ITE2004_ETH_VL2021220500452_Reference_Material_I_08-02-2022_White_Box_Testing (4).pptx

An Analysis of Graph Cut Size for Transductive Learning
An Analysis of Graph Cut Size for Transductive LearningAn Analysis of Graph Cut Size for Transductive Learning
An Analysis of Graph Cut Size for Transductive Learning
butest
 

Similar to WINSEM2021-22_ITE2004_ETH_VL2021220500452_Reference_Material_I_08-02-2022_White_Box_Testing (4).pptx (20)

software eng by raj mishra
software eng by raj mishrasoftware eng by raj mishra
software eng by raj mishra
 
Support Vector Machine
Support Vector MachineSupport Vector Machine
Support Vector Machine
 
Computer Science Assignment Help
Computer Science Assignment Help Computer Science Assignment Help
Computer Science Assignment Help
 
Soln dc05
Soln dc05Soln dc05
Soln dc05
 
Visual Techniques
Visual TechniquesVisual Techniques
Visual Techniques
 
Chapter one
Chapter oneChapter one
Chapter one
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
 
AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
 
An Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked ExamplesAn Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked Examples
 
1672734902268_Slice based testing.pptx
1672734902268_Slice based testing.pptx1672734902268_Slice based testing.pptx
1672734902268_Slice based testing.pptx
 
R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro
 
Mcs 011 solved assignment 2015-16
Mcs 011 solved assignment 2015-16Mcs 011 solved assignment 2015-16
Mcs 011 solved assignment 2015-16
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
An Analysis of Graph Cut Size for Transductive Learning
An Analysis of Graph Cut Size for Transductive LearningAn Analysis of Graph Cut Size for Transductive Learning
An Analysis of Graph Cut Size for Transductive Learning
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Representing and visiting graphs
Representing and visiting graphsRepresenting and visiting graphs
Representing and visiting graphs
 
Monitoring Processes
Monitoring ProcessesMonitoring Processes
Monitoring Processes
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 

Recently uploaded

Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
Kira Dess
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
rahulmanepalli02
 
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
AshwaniAnuragi1
 

Recently uploaded (20)

Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
DBMS-Report on Student management system.pptx
DBMS-Report on Student management system.pptxDBMS-Report on Student management system.pptx
DBMS-Report on Student management system.pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
01-vogelsanger-stanag-4178-ed-2-the-new-nato-standard-for-nitrocellulose-test...
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptx
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Geometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdfGeometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdf
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Circuit Breakers for Engineering Students
Circuit Breakers for Engineering StudentsCircuit Breakers for Engineering Students
Circuit Breakers for Engineering Students
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 

WINSEM2021-22_ITE2004_ETH_VL2021220500452_Reference_Material_I_08-02-2022_White_Box_Testing (4).pptx

  • 2. Software Testing Consider a program for the classification of a triangle. Its input is a triple of positive integers (say a,b,c) from the interval [1,100]. The output may be [Scalene, Isosceles, Equilateral, Not a triangle]. Draw the flow graph & DD Path graph. Also find the independent paths from the DD Path graph.
  • 4. Software Testing Code of triangle classification problem
  • 5. Software Testing Solution : Flow graph of triangle problem is: Program flow graph
  • 6. Software Testing The mapping table for DD path graph is: Remarks Flow graph nodes DD Path graph corresponding node 1 TO 9 Sequential nodes Decision node 10 11 12, 13 14 15, 16, 17 18 19 Decision node Sequential nodes Two edges are joined here Sequential nodes Decision nodes plus joining of two edges Decision node Sequential nodes Decision node Sequential nodes 20, 21 22 23, 24 25, 26, 27 A B C D E F G H I J K L Sequential nodes Cont….
  • 7. Software Testing Remarks Flow graph DD Path graph nodes corresponding node 28 M Three edges are combined here 29 N Decision node 30, 31 O Sequential nodes 32, 33, 34 P Sequential nodes 35 Q Three edges are combined here 36, 37 R Sequential nodes with exit node DD Path graph
  • 8. Software Testing DD Path graph is given below: Independent paths are: (i) ABFGNPQR (ii) ABFGNOQR (iii) ABCEGNPQR (iv) ABCDEGNOQR (v) ABFGHIMQR (vi) ABFGHJKMQR (vii)ABFGHJLMQR DD Path graph
  • 9. Software Testing Consider the classification of triangle problem. Find the cyclomatic complexity.
  • 10. Software Testing Solution Number of edges (e) = 23 Number of nodes (n) =18 (i) V(G) = e - n + 2P = 23 - 18 + 2 = 7 (ii) V(G) = π + 1 = 6 + 1 = 7 (iii) V(G) = Number of regions = 7 The cyclomatic complexity is 7. Hence, there are seven independent paths