SlideShare une entreprise Scribd logo
1  sur  14
White-Box Testing
Eshcar Hillel
Michael Beder
White Box Testing2
Tutorial Outline
 What is White Box Testing?
 Flow Graph and Coverage Types
 Symbolic Execution:
– Formal Definition
– Examples
White Box Testing3
White-Box means
Testing by Implementation
 Execution-based testing that uses the program’s
inner structure and logical properties
– A.K.A Clear Box, Glass Box and Structural Testing
 There are different types of white-box testing
– For example statement coverage where each statement is
executed at least once
 Flow Graph helps us model an analyze different
types of coverage
White Box Testing4
Flow Graph
G = (V, E) where
- V is the set of basic blocks
- E is the set of control branches
Example:
1. a = Read(b)
2. c = 0
3. while (a > 1)
4. If (a^2 > c)
5. c = c + a
6. a = a - 2
1, 2
3
4
5
end
start
T
T
6
F
F
Input:
b = 2
Output:
a = 0, c = 2
White Box Testing5
White Box Coverage Types
 Statement Coverage: Every statement is executed
 Branch Coverage: Every branch option is chosen
 Path Coverage: Every path is executed
 Basic Path Coverage:
– We need to define basic path set first
Loops?
White Box Testing6
Basic Path Set
 An execution path is a set of nodes and directed
edges in a flow graph that connects (in a directed
fashion) the start node to a terminal node.
 Two execution paths are said to be independent if
they do not include the same set of nodes and
edges.
 A basic set of execution paths for a flow graph is an
independent maximum set of paths in which all
nodes and edges of the graph are included at least
once.
White Box Testing7
Basic Path Coverage
 The number of Basic paths is
E – N + 2 (Linear Complexity)
 Example
p1 = start – 1,2 – 3 – end
p2 = start – 1,2 – 3 – 4 – 6 – 3 – end
p3 = start – 1,2 – 3 – 4 – 5 – 6 – 3 – end
E – N + 2 = 8 – 7 + 2 = 3
1, 2
3
4
5
end
start
T
T
6
F
F
White Box Testing8
Path Function
 A function represents the current values of the
variables as function of their initial values
 Each variable X is represented by a projection function
 Function composition
– For example
: n n
f D D→
: n
Xf D D→
1
( )( ) ( ( ),..., ( ))nX Xg f v g f v f v=o
( , , ) ( , , )
( , , ) ( , , ) ( , , )X Y Z
f X Y Z X Y X Y XZ
f X Y Z X Y f X Y Z X Y f X Y Z XZ
= + −
= + = − =
( , , ) ( , , )
( )( , , ) ( ( , , ), ( , , ), ( , , ))
( , , ) (( )( ),( ) , )
X Y Z
g X Y Z XY X Z Z
g f X Y Z g f X Y Z f X Y Z f X Y Z
g X Y X Y XZ X Y X Y X Y XZ XZ
= +
= =
= + − = + − + +
o
White Box Testing9
Path Condition
 A condition that ensures the execution of a path
 A constraint on the initial values of the variables
For Example: p = start – 1,2 – 3 – end.
1. a = Read(b)
2. c = 0
3. while (a > 1)
4. if (a^2 > c)
5. c = c + a
6. a = a – 2
The path condition is B <= 1, where B is the initial value of b
1, 2
3
4
5
end
start
T
T
6
F
F
White Box Testing10
Symbolic Execution
 A method for deriving test cases which satisfy a given path
– Outputs path condition (input) and path function (expected result)
 Initially
– Path function is the Identity function
– Path condition is true
 Each step in the path induce a symbolic composition on the
path function or a logical constraint on the path condition
– Simple block g(x):
– Control branch: C C branch condition
f g f¬ o
¬ ∧
White Box Testing11
Example: Symbolic Execution
1. a = Read(b)
2. c = 0
3. while (a > 1)
4. if (a^2 > c)
5. c = c + a
6. a = a – 2
Find test case for path:
p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end
1, 2
3
4
5
end
start
T
T
6
F
F
White Box Testing12
1. a = Read(b)
2. c = 0
3. while (a > 1)
4. if (a^2 > c)
5. c = c + a
6. a = a – 2
p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end
vertex path function path condition
start: (A, B, C) true
1,2 (A, B, C) true
3 (B, B, 0) true
4 (B, B, 0) (true Λ B>1) ↔ B>1
5 (B, B, 0) (B>1 Λ B^2>0) ↔ B>1
1, 2
3
4
5
end
start
T
T
6
F
F
Example: Symbolic Execution
White Box Testing13
1. a = Read(b)
2. c = 0
3. while (a > 1)
4. if (a^2 > c)
5. c = c + a
6. a = a – 2
p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end
vertex path function path condition
6 (B, B, B) B>1
3 (B-2, B, B) B>1
4 (B-2, B, B) (B>1 Λ B-2>1) ↔ B>3
5 (B-2, B, B) (B>3 Λ (B-2)^2>B) ↔ B>4
6 (B-2, B, 2B-2) B>4
3 (B-4, B, 2B-2) B>4
end (B-4, B, 2B-2) (B>4 Λ B-4<=1) ↔ B=5
1, 2
3
4
5
end
start
T
T
6
F
F
Example: Symbolic Execution
White Box Testing14
1. a = Read(b)
2. c = 0
3. while (a > 1)
4. if (a^2 > c)
5. c = c + a
6. a = a – 2
p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end
end (B-4, B, 2B-2) B=5
Hence the test case is B = 5
and the expected result is 2B-2 = 8
1, 2
3
4
5
end
start
T
T
6
F
F
Is there a test case for
p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end ?
Example: Symbolic Execution

Contenu connexe

Tendances

Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model Checking
Quoc-Sang Phan
 

Tendances (20)

Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statements
 
Symbolic Execution (introduction and hands-on)
Symbolic Execution (introduction and hands-on)Symbolic Execution (introduction and hands-on)
Symbolic Execution (introduction and hands-on)
 
Automatically Documenting Program Changes
Automatically Documenting Program ChangesAutomatically Documenting Program Changes
Automatically Documenting Program Changes
 
Ppt on java basics
Ppt on java basicsPpt on java basics
Ppt on java basics
 
3 Function & Storage Class.pptx
3 Function & Storage Class.pptx3 Function & Storage Class.pptx
3 Function & Storage Class.pptx
 
Static analysis
Static analysisStatic analysis
Static analysis
 
SQL / PL
SQL / PLSQL / PL
SQL / PL
 
11. java methods
11. java methods11. java methods
11. java methods
 
User Defined Functions in MATLAB part 2
User Defined Functions in MATLAB part 2User Defined Functions in MATLAB part 2
User Defined Functions in MATLAB part 2
 
Indus Valley Partner aptitude questions and answers
Indus Valley Partner aptitude questions and answersIndus Valley Partner aptitude questions and answers
Indus Valley Partner aptitude questions and answers
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 
TMPA-2017: Evolutionary Algorithms in Test Generation for digital systems
TMPA-2017: Evolutionary Algorithms in Test Generation for digital systemsTMPA-2017: Evolutionary Algorithms in Test Generation for digital systems
TMPA-2017: Evolutionary Algorithms in Test Generation for digital systems
 
CONTROL STMTS.pptx
CONTROL STMTS.pptxCONTROL STMTS.pptx
CONTROL STMTS.pptx
 
Procedure n functions
Procedure n functionsProcedure n functions
Procedure n functions
 
Control statements in java programmng
Control statements in java programmngControl statements in java programmng
Control statements in java programmng
 
Coding verilog
Coding verilogCoding verilog
Coding verilog
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scripts
 
PLSQL CURSOR
PLSQL CURSORPLSQL CURSOR
PLSQL CURSOR
 
Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model Checking
 
Pi j1.3 operators
Pi j1.3 operatorsPi j1.3 operators
Pi j1.3 operators
 

En vedette (10)

White box ppt
White box pptWhite box ppt
White box ppt
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
White box testing-200709
White box testing-200709White box testing-200709
White box testing-200709
 
White box testing
White box testingWhite box testing
White box testing
 
White Box Testing V0.2
White Box Testing V0.2White Box Testing V0.2
White Box Testing V0.2
 
Introduction to White box testing
Introduction to White box testingIntroduction to White box testing
Introduction to White box testing
 
Test Levels & Techniques
Test Levels & TechniquesTest Levels & Techniques
Test Levels & Techniques
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
 

Similaire à 12 white box testing-fixed

Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
Natalia
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
Natalia
 
Save and Submit Q U E S T I O N 1 Use the given c.docx
Save and Submit Q U E S T I O N  1   Use the given c.docxSave and Submit Q U E S T I O N  1   Use the given c.docx
Save and Submit Q U E S T I O N 1 Use the given c.docx
kenjordan97598
 
Storyboard math
Storyboard mathStoryboard math
Storyboard math
shandex
 
Higher revision 1, 2 & 3
Higher revision 1, 2 & 3Higher revision 1, 2 & 3
Higher revision 1, 2 & 3
Calum Blair
 

Similaire à 12 white box testing-fixed (20)

Calculator technique session 1
Calculator technique session 1Calculator technique session 1
Calculator technique session 1
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
 
Infix prefix postfix
Infix prefix postfixInfix prefix postfix
Infix prefix postfix
 
7-NFA to Minimized DFA.pptx
7-NFA to Minimized DFA.pptx7-NFA to Minimized DFA.pptx
7-NFA to Minimized DFA.pptx
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
 
Save and Submit Q U E S T I O N 1 Use the given c.docx
Save and Submit Q U E S T I O N  1   Use the given c.docxSave and Submit Q U E S T I O N  1   Use the given c.docx
Save and Submit Q U E S T I O N 1 Use the given c.docx
 
Storyboard math
Storyboard mathStoryboard math
Storyboard math
 
10b- Rabin Karp String Matching Problem.pptx
10b- Rabin Karp String Matching Problem.pptx10b- Rabin Karp String Matching Problem.pptx
10b- Rabin Karp String Matching Problem.pptx
 
Higher revision 1, 2 & 3
Higher revision 1, 2 & 3Higher revision 1, 2 & 3
Higher revision 1, 2 & 3
 
discrete-hmm
discrete-hmmdiscrete-hmm
discrete-hmm
 
Lp presentations fnctions
Lp presentations fnctionsLp presentations fnctions
Lp presentations fnctions
 
Add math may june 2016 p1
Add math may june 2016 p1Add math may june 2016 p1
Add math may june 2016 p1
 
Obj. 7 Midpoint and Distance Formulas
Obj. 7 Midpoint and Distance FormulasObj. 7 Midpoint and Distance Formulas
Obj. 7 Midpoint and Distance Formulas
 
String kmp
String kmpString kmp
String kmp
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 
PARSING.ppt
PARSING.pptPARSING.ppt
PARSING.ppt
 
Counting Sort and Radix Sort Algorithms
Counting Sort and Radix Sort AlgorithmsCounting Sort and Radix Sort Algorithms
Counting Sort and Radix Sort Algorithms
 

Dernier

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Dernier (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

12 white box testing-fixed

  • 2. White Box Testing2 Tutorial Outline  What is White Box Testing?  Flow Graph and Coverage Types  Symbolic Execution: – Formal Definition – Examples
  • 3. White Box Testing3 White-Box means Testing by Implementation  Execution-based testing that uses the program’s inner structure and logical properties – A.K.A Clear Box, Glass Box and Structural Testing  There are different types of white-box testing – For example statement coverage where each statement is executed at least once  Flow Graph helps us model an analyze different types of coverage
  • 4. White Box Testing4 Flow Graph G = (V, E) where - V is the set of basic blocks - E is the set of control branches Example: 1. a = Read(b) 2. c = 0 3. while (a > 1) 4. If (a^2 > c) 5. c = c + a 6. a = a - 2 1, 2 3 4 5 end start T T 6 F F Input: b = 2 Output: a = 0, c = 2
  • 5. White Box Testing5 White Box Coverage Types  Statement Coverage: Every statement is executed  Branch Coverage: Every branch option is chosen  Path Coverage: Every path is executed  Basic Path Coverage: – We need to define basic path set first Loops?
  • 6. White Box Testing6 Basic Path Set  An execution path is a set of nodes and directed edges in a flow graph that connects (in a directed fashion) the start node to a terminal node.  Two execution paths are said to be independent if they do not include the same set of nodes and edges.  A basic set of execution paths for a flow graph is an independent maximum set of paths in which all nodes and edges of the graph are included at least once.
  • 7. White Box Testing7 Basic Path Coverage  The number of Basic paths is E – N + 2 (Linear Complexity)  Example p1 = start – 1,2 – 3 – end p2 = start – 1,2 – 3 – 4 – 6 – 3 – end p3 = start – 1,2 – 3 – 4 – 5 – 6 – 3 – end E – N + 2 = 8 – 7 + 2 = 3 1, 2 3 4 5 end start T T 6 F F
  • 8. White Box Testing8 Path Function  A function represents the current values of the variables as function of their initial values  Each variable X is represented by a projection function  Function composition – For example : n n f D D→ : n Xf D D→ 1 ( )( ) ( ( ),..., ( ))nX Xg f v g f v f v=o ( , , ) ( , , ) ( , , ) ( , , ) ( , , )X Y Z f X Y Z X Y X Y XZ f X Y Z X Y f X Y Z X Y f X Y Z XZ = + − = + = − = ( , , ) ( , , ) ( )( , , ) ( ( , , ), ( , , ), ( , , )) ( , , ) (( )( ),( ) , ) X Y Z g X Y Z XY X Z Z g f X Y Z g f X Y Z f X Y Z f X Y Z g X Y X Y XZ X Y X Y X Y XZ XZ = + = = = + − = + − + + o
  • 9. White Box Testing9 Path Condition  A condition that ensures the execution of a path  A constraint on the initial values of the variables For Example: p = start – 1,2 – 3 – end. 1. a = Read(b) 2. c = 0 3. while (a > 1) 4. if (a^2 > c) 5. c = c + a 6. a = a – 2 The path condition is B <= 1, where B is the initial value of b 1, 2 3 4 5 end start T T 6 F F
  • 10. White Box Testing10 Symbolic Execution  A method for deriving test cases which satisfy a given path – Outputs path condition (input) and path function (expected result)  Initially – Path function is the Identity function – Path condition is true  Each step in the path induce a symbolic composition on the path function or a logical constraint on the path condition – Simple block g(x): – Control branch: C C branch condition f g f¬ o ¬ ∧
  • 11. White Box Testing11 Example: Symbolic Execution 1. a = Read(b) 2. c = 0 3. while (a > 1) 4. if (a^2 > c) 5. c = c + a 6. a = a – 2 Find test case for path: p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end 1, 2 3 4 5 end start T T 6 F F
  • 12. White Box Testing12 1. a = Read(b) 2. c = 0 3. while (a > 1) 4. if (a^2 > c) 5. c = c + a 6. a = a – 2 p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end vertex path function path condition start: (A, B, C) true 1,2 (A, B, C) true 3 (B, B, 0) true 4 (B, B, 0) (true Λ B>1) ↔ B>1 5 (B, B, 0) (B>1 Λ B^2>0) ↔ B>1 1, 2 3 4 5 end start T T 6 F F Example: Symbolic Execution
  • 13. White Box Testing13 1. a = Read(b) 2. c = 0 3. while (a > 1) 4. if (a^2 > c) 5. c = c + a 6. a = a – 2 p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end vertex path function path condition 6 (B, B, B) B>1 3 (B-2, B, B) B>1 4 (B-2, B, B) (B>1 Λ B-2>1) ↔ B>3 5 (B-2, B, B) (B>3 Λ (B-2)^2>B) ↔ B>4 6 (B-2, B, 2B-2) B>4 3 (B-4, B, 2B-2) B>4 end (B-4, B, 2B-2) (B>4 Λ B-4<=1) ↔ B=5 1, 2 3 4 5 end start T T 6 F F Example: Symbolic Execution
  • 14. White Box Testing14 1. a = Read(b) 2. c = 0 3. while (a > 1) 4. if (a^2 > c) 5. c = c + a 6. a = a – 2 p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end end (B-4, B, 2B-2) B=5 Hence the test case is B = 5 and the expected result is 2B-2 = 8 1, 2 3 4 5 end start T T 6 F F Is there a test case for p = start – 1,2 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – 4 – 5 – 6 – 3 – end ? Example: Symbolic Execution