SlideShare a Scribd company logo
White Box Testing
Purvi Sankhe
Software Testing
Two Techniques:
1. White Box Testing
2. Black Box Testing
2
 White-box testing
 Tests that concentrate on close examination of
procedural details are conducted
 Logical paths through the software are tested
 Test cases exercise specific sets of conditions and
loops
3
Testing Techniques
Testing Techniques contd..
 Black-box testing
 Tests are conducted to see if specified functions for
which product has been designed is fully operational and
error free
 Tests conducted at the software interface
 Tests related to internal logical structure of the software
are not conducted
4
White-box Testing
White-box Testing
 Uses the control structure part of component-level design to derive
the test cases
 These test cases
 Guarantee that all independent paths within a module have
been exercised at least once
 Exercise all logical decisions on their true and false sides
 Execute all loops at their boundaries and within their
operational bounds
 Exercise internal data structures to ensure their validity
6
Basis Path Testing
 White-box testing technique proposed by Tom McCabe
 Enables the test case designer to derive a logical complexity
measure of a procedural design
 Uses this measure as a guide for defining a basis set of execution
paths
 Test cases derived to exercise the basis set are guaranteed to
execute every statement in the program at least one time during
testing
7
Flow Graph Notation
 A circle in a graph represents a node, which stands for a sequence of
one or more procedural statements
 A node containing a simple conditional expression is referred to as a
predicate node
 Each compound condition in a conditional expression containing
one or more Boolean operators (e.g., and, or) is represented by a
separate predicate node
 A predicate node has two edges leading out from it (True and
False)
8
Flow Graph Notation
 An edge, or a link, is a an arrow representing flow of control in a
specific direction
 An edge must start and terminate at a node
 An edge does not intersect or cross over another edge
 Areas bounded by a set of edges and nodes are called regions
 When counting regions, include the area outside the graph as a region,
too
9
Flow Graph Example
10
1
2
0
3
4
5
6
7 8
9
1011
1
2
3
46
7 8 5
9
1011
R1
R2
R3
R4
FLOW CHART FLOW GRAPH
0
Independent Program Paths
 Defined as a path through the program from the start node until the end node that
introduces at least one new set of processing statements or a new condition (i.e., new
nodes)
 Must move along at least one edge that has not been traversed before by a previous
path
 Basis set for flow graph on previous slide
 Path 1: 0-1-11
 Path 2: 0-1-2-3-4-5-10-1-11
 Path 3: 0-1-2-3-6-8-9-10-1-11
 Path 4: 0-1-2-3-6-7-9-10-1-11
 The number of paths in the basis set is determined by the cyclomatic complexity
11
Cyclomatic Complexity
 Provides a quantitative measure of the logical complexity of a program
 Defines the number of independent paths in the basis set
 Provides an upper bound for the number of tests that must be conducted to ensure all
statements have been executed at least once
 Can be computed three ways
 The number of regions
 V(G) = E – N + 2, where E is the number of edges and N is the number of nodes in graph
G
 V(G) = P + 1, where P is the number of predicate nodes in the flow graph G
 Results in the following equations for the example flow graph
 Number of regions = 4
 V(G) = 14 edges – 12 nodes + 2 = 4
 V(G) = 3 predicate nodes + 1 = 4 12
Deriving the Basis Set and Test
Cases
1) Using the design or code as a foundation, draw a corresponding
flow graph
2) Determine the cyclomatic complexity of the resultant flow graph
3) Determine a basis set of linearly independent paths
4) Prepare test cases that will force execution of each path in the
basis set
13
A Second Flow Graph Example
14
1 int functionY(void)
2 {
3 int x = 0;
4 int y = 19;
5 A: x++;
6 if (x > 999)
7 goto D;
8 if (x % 11 == 0)
9 goto B;
10 else goto A;
11 B: if (x % y == 0)
12 goto C;
13 else goto A;
14 C: printf("%dn", x);
15 goto A;
16 D: printf("End of listn");
17 return 0;
18 }
3
4
5
6
7
16
17
8
9
11
12
14
15
13
10
A Sample Function to Diagram and Analyze
15
1 int functionZ(int y)
2 {
3 int x = 0;
4 while (x <= (y * y))
5 {
6 if ((x % 11 == 0) &&
7 (x % y == 0))
8 {
9 printf(“%d”, x);
0 x++;
1 } // End if
2 else if ((x % 7 == 0) ||
3 (x % y == 1))
4 {
5 printf(“%d”, y);
6 x = x + 2;
7 } // End else
8 printf(“n”);
9 } // End while
0 printf("End of listn");
1 return 0;
2 } // End functionZ
A Sample Function to Diagram and Analyze
16
1 int functionZ(int y)
2 {
3 int x = 0;
4 while (x <= (y * y))
5 {
6 if ((x % 11 == 0) &&
7 (x % y == 0))
8 {
9 printf(“%d”, x);
0 x++;
1 } // End if
2 else if ((x % 7 == 0) ||
3 (x % y == 1))
4 {
5 printf(“%d”, y);
6 x = x + 2;
7 } // End else
8 printf(“n”);
9 } // End while
0 printf("End of listn");
1 return 0;
2 } // End functionZ
3
4
6 7
9
10
12 13
15
16
18
20
21
Graph Matrices
17
 To develop s/w tool that assist in basis path testing, a DS called graph
matrix is quite useful.
 Is a square matrix whose size is equal to no of nodes on the flow
graph
 Each node is identified by nos. & each edge is identified by letters
 Letter entry is made to correspond to a connection between two
nodes.
 Link weights is a 1 or 0. (connection matrix)
 Provides other way to determine cyclomatic complexity

More Related Content

What's hot

Path testing
Path testingPath testing
Path testing
Mohamed Ali
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesPragya Rastogi
 
Path Testing
Path TestingPath Testing
Path Testing
Sun Technlogies
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Ryan Tran
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesOksana
 
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 TestingAnkit Mulani
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniquesFincy V.J
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
niharika5412
 
Seii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesSeii unit6 software-testing-techniques
Seii unit6 software-testing-techniques
Ahmad sohail Kakar
 
Pi j1.3 operators
Pi j1.3 operatorsPi j1.3 operators
Pi j1.3 operators
mcollison
 
Basis path testing
Basis path testingBasis path testing
Basis path testing
Hoa Le
 
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesNirav Desai
 
Unit 5. Control Statement
Unit 5. Control StatementUnit 5. Control Statement
Unit 5. Control Statement
Ashim Lamichhane
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
Neha Singh
 
Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model CheckingQuoc-Sang Phan
 
Ch6 Loops
Ch6 LoopsCh6 Loops
Ch6 Loops
SzeChingChen
 

What's hot (20)

White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
Path testing
Path testingPath testing
Path testing
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Path Testing
Path TestingPath Testing
Path Testing
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
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
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Seii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesSeii unit6 software-testing-techniques
Seii unit6 software-testing-techniques
 
Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
 
Pi j1.3 operators
Pi j1.3 operatorsPi j1.3 operators
Pi j1.3 operators
 
Basis path testing
Basis path testingBasis path testing
Basis path testing
 
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
 
White box
White boxWhite box
White box
 
Unit 5. Control Statement
Unit 5. Control StatementUnit 5. Control Statement
Unit 5. Control Statement
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
 
Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model Checking
 
Ch6 Loops
Ch6 LoopsCh6 Loops
Ch6 Loops
 

Similar to White box testing

7-White Box Testing.ppt
7-White Box Testing.ppt7-White Box Testing.ppt
7-White Box Testing.ppt
HirenderPal
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
Mr. Jhon
 
AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
SusieMaestre1
 
Structural testing
Structural testingStructural testing
Structural testing
Raheemaparveen
 
Structural testing
Structural testingStructural testing
Structural testing
rahi20
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt
abdulbasetalselwi
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
moazwinner
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
ReshuReshma8
 
Lecture#6 functions in c++
Lecture#6 functions in c++Lecture#6 functions in c++
Lecture#6 functions in c++
NUST Stuff
 
Chapter 14 software testing techniques
Chapter 14 software testing techniquesChapter 14 software testing techniques
Chapter 14 software testing techniques
SHREEHARI WADAWADAGI
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
Samuel Igbanogu
 
Matlab Nn Intro
Matlab Nn IntroMatlab Nn Intro
Matlab Nn Intro
Imthias Ahamed
 
Software Verification, Validation and Testing
Software Verification, Validation and TestingSoftware Verification, Validation and Testing
Software Verification, Validation and Testing
Dr Sukhpal Singh Gill
 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow Analysis
Eelco Visser
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdf
AmanPratik11
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
Jordan Delacruz
 
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NoSuchCon
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
Soham Kulkarni
 
Reverse Engineering automation
Reverse Engineering automationReverse Engineering automation
Reverse Engineering automationPositive Hack Days
 
Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01
VincentAcapen1
 

Similar to White box testing (20)

7-White Box Testing.ppt
7-White Box Testing.ppt7-White Box Testing.ppt
7-White Box Testing.ppt
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
 
AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
 
Structural testing
Structural testingStructural testing
Structural testing
 
Structural testing
Structural testingStructural testing
Structural testing
 
1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt1414_lecturueueueueuueueeueueueuusuee_7.ppt
1414_lecturueueueueuueueeueueueuusuee_7.ppt
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Lecture#6 functions in c++
Lecture#6 functions in c++Lecture#6 functions in c++
Lecture#6 functions in c++
 
Chapter 14 software testing techniques
Chapter 14 software testing techniquesChapter 14 software testing techniques
Chapter 14 software testing techniques
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Matlab Nn Intro
Matlab Nn IntroMatlab Nn Intro
Matlab Nn Intro
 
Software Verification, Validation and Testing
Software Verification, Validation and TestingSoftware Verification, Validation and Testing
Software Verification, Validation and Testing
 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow Analysis
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdf
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
 
Reverse Engineering automation
Reverse Engineering automationReverse Engineering automation
Reverse Engineering automation
 
Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01Introductiontoflowchart 110630082600-phpapp01
Introductiontoflowchart 110630082600-phpapp01
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 

White box testing

  • 2. Software Testing Two Techniques: 1. White Box Testing 2. Black Box Testing 2
  • 3.  White-box testing  Tests that concentrate on close examination of procedural details are conducted  Logical paths through the software are tested  Test cases exercise specific sets of conditions and loops 3 Testing Techniques
  • 4. Testing Techniques contd..  Black-box testing  Tests are conducted to see if specified functions for which product has been designed is fully operational and error free  Tests conducted at the software interface  Tests related to internal logical structure of the software are not conducted 4
  • 6. White-box Testing  Uses the control structure part of component-level design to derive the test cases  These test cases  Guarantee that all independent paths within a module have been exercised at least once  Exercise all logical decisions on their true and false sides  Execute all loops at their boundaries and within their operational bounds  Exercise internal data structures to ensure their validity 6
  • 7. Basis Path Testing  White-box testing technique proposed by Tom McCabe  Enables the test case designer to derive a logical complexity measure of a procedural design  Uses this measure as a guide for defining a basis set of execution paths  Test cases derived to exercise the basis set are guaranteed to execute every statement in the program at least one time during testing 7
  • 8. Flow Graph Notation  A circle in a graph represents a node, which stands for a sequence of one or more procedural statements  A node containing a simple conditional expression is referred to as a predicate node  Each compound condition in a conditional expression containing one or more Boolean operators (e.g., and, or) is represented by a separate predicate node  A predicate node has two edges leading out from it (True and False) 8
  • 9. Flow Graph Notation  An edge, or a link, is a an arrow representing flow of control in a specific direction  An edge must start and terminate at a node  An edge does not intersect or cross over another edge  Areas bounded by a set of edges and nodes are called regions  When counting regions, include the area outside the graph as a region, too 9
  • 10. Flow Graph Example 10 1 2 0 3 4 5 6 7 8 9 1011 1 2 3 46 7 8 5 9 1011 R1 R2 R3 R4 FLOW CHART FLOW GRAPH 0
  • 11. Independent Program Paths  Defined as a path through the program from the start node until the end node that introduces at least one new set of processing statements or a new condition (i.e., new nodes)  Must move along at least one edge that has not been traversed before by a previous path  Basis set for flow graph on previous slide  Path 1: 0-1-11  Path 2: 0-1-2-3-4-5-10-1-11  Path 3: 0-1-2-3-6-8-9-10-1-11  Path 4: 0-1-2-3-6-7-9-10-1-11  The number of paths in the basis set is determined by the cyclomatic complexity 11
  • 12. Cyclomatic Complexity  Provides a quantitative measure of the logical complexity of a program  Defines the number of independent paths in the basis set  Provides an upper bound for the number of tests that must be conducted to ensure all statements have been executed at least once  Can be computed three ways  The number of regions  V(G) = E – N + 2, where E is the number of edges and N is the number of nodes in graph G  V(G) = P + 1, where P is the number of predicate nodes in the flow graph G  Results in the following equations for the example flow graph  Number of regions = 4  V(G) = 14 edges – 12 nodes + 2 = 4  V(G) = 3 predicate nodes + 1 = 4 12
  • 13. Deriving the Basis Set and Test Cases 1) Using the design or code as a foundation, draw a corresponding flow graph 2) Determine the cyclomatic complexity of the resultant flow graph 3) Determine a basis set of linearly independent paths 4) Prepare test cases that will force execution of each path in the basis set 13
  • 14. A Second Flow Graph Example 14 1 int functionY(void) 2 { 3 int x = 0; 4 int y = 19; 5 A: x++; 6 if (x > 999) 7 goto D; 8 if (x % 11 == 0) 9 goto B; 10 else goto A; 11 B: if (x % y == 0) 12 goto C; 13 else goto A; 14 C: printf("%dn", x); 15 goto A; 16 D: printf("End of listn"); 17 return 0; 18 } 3 4 5 6 7 16 17 8 9 11 12 14 15 13 10
  • 15. A Sample Function to Diagram and Analyze 15 1 int functionZ(int y) 2 { 3 int x = 0; 4 while (x <= (y * y)) 5 { 6 if ((x % 11 == 0) && 7 (x % y == 0)) 8 { 9 printf(“%d”, x); 0 x++; 1 } // End if 2 else if ((x % 7 == 0) || 3 (x % y == 1)) 4 { 5 printf(“%d”, y); 6 x = x + 2; 7 } // End else 8 printf(“n”); 9 } // End while 0 printf("End of listn"); 1 return 0; 2 } // End functionZ
  • 16. A Sample Function to Diagram and Analyze 16 1 int functionZ(int y) 2 { 3 int x = 0; 4 while (x <= (y * y)) 5 { 6 if ((x % 11 == 0) && 7 (x % y == 0)) 8 { 9 printf(“%d”, x); 0 x++; 1 } // End if 2 else if ((x % 7 == 0) || 3 (x % y == 1)) 4 { 5 printf(“%d”, y); 6 x = x + 2; 7 } // End else 8 printf(“n”); 9 } // End while 0 printf("End of listn"); 1 return 0; 2 } // End functionZ 3 4 6 7 9 10 12 13 15 16 18 20 21
  • 17. Graph Matrices 17  To develop s/w tool that assist in basis path testing, a DS called graph matrix is quite useful.  Is a square matrix whose size is equal to no of nodes on the flow graph  Each node is identified by nos. & each edge is identified by letters  Letter entry is made to correspond to a connection between two nodes.  Link weights is a 1 or 0. (connection matrix)  Provides other way to determine cyclomatic complexity