SlideShare a Scribd company logo
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
Introduction
Each specific technique enables test cases to be derived systematically and focuses on a particular aspect of the
structure to be considered. The techniques provide coverage criteria which have to be measured and associated
with an objective defined by each project or organization.
Achieving full coverage does not mean that the entire set of tests is complete, but rather that the technique being
used no longer suggests any useful tests for the structure under consideration.
The following techniques are considered in this syllabus:
 Statement testing
 Decision testing
 Modified Condition/Decision Coverage (MC/DC) testing
 Multiple Condition testing
 Basis Path testing
 API testing
Neeraj Kumar Singh
White Box Test Techniques
Statement Testing
Neeraj Kumar Singh
True
False?
Read A
Read B
If A>B then
Print “A is Bigger”
Else
Print “B is Bigger”
End If
Statement Testing or Coverage is a measure of the number of
executable statements in the source code exercised by tests.
Start
End
Branch
Nodes
A,B
A>B
A
B
End If
White Box Test Techniques
Statement Testing
True
False?
Read A
Read B
If A>B then
Print “A is Bigger”
Else
Print “B is Bigger”
End If
Start
End
A Path is the executable path which reaches the end of
the code starting from the start point.
2
1
A,B
A>B
A
B
End If
Example
Statement Testing
Neeraj Kumar Singh
T
IF sufficient water THEN
Boil water
Add tea
Show message “milk?”
IF milk = yes THEN
Show message “low fat?”
IF low fat = yes THEN
Add low fat milk
ELSE
Add normal milk
ENDIF
ENDIF
Show message “sugar?”
IF sugar = yes THEN
Add sugar
ENDIF
Stir
Wait 3 minutes
Show message “please take your tea”
ELSE
Show message “please fill up water”
ENDIF
Sufficient
Water
Boil
Water
Add
Tea
Milk?
Milk=Yes
Low
Fat?
Low Fat
= Yes
Low fat
Milk
Normal
Milk
End If
Sugar?
Sugar
=Yes
End If
Add
Sugar?
End If
Please fill
up water
Stir, wait
Please take your tea.
End If
F
F
T
T
F
F
T
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
Decision Testing
Neeraj Kumar Singh
True
False?
Read A
Read B
If A>B then
Print “A is Bigger”
Else
Print “B is Bigger”
End If
Decision Testing or Coverage is a measure of the number of executable
decisions in the source code exercised by tests.
Start
End
Branch/
Decisions
Nodes/
Statements
A,B
A>B
A
B
End If
White Box Test Techniques
Decision Testing
True
False?
Read A
Read B
If A>B then
Print “A is Bigger”
Else
Print “B is Bigger”
End If
Start
End
A Path is the executable path which reaches the end of
the code starting from the start point.
2
1
A,B
A>B
A
B
End If
Example
Decision Testing
Neeraj Kumar Singh
TStatement P
IF A THEN
IF B THEN
Statement Q
ELSE
Statement R
ENDIF
ELSE
Statement S
IF C THEN
Statement T
ELSE
Statement U
ENDIF
ENDIF
Statement V
How many test cases would you design to achieve 100%
decision coverage?
A
STMT P
END IF
F
F F
B
STMT Q
T
STMT R
STMT S
C
T
STMT T
STMT U
END IF
END IF
STMT V
Min TC for 100% DC = 4
#TIP – No of If +1
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Compared to Decision testing, which considers the entire decision as a whole and evaluates the TRUE and FALSE
outcomes in separate test cases, MC/DC testing considers how a decision is made when it includes multiple
conditions
Each decision predicate is made up of one or more simple atomic conditions, each of which evaluates to a discrete
Boolean value. These are logically combined to determine the final outcome of the decision. This technique checks
that each of the atomic conditions independently and correctly affects the outcome of the overall decision.
This technique provides a stronger level of coverage than statement and decision coverage when there are
decisions containing multiple conditions.
Assuming N unique, independent atomic conditions, MC/DC can usually be achieved with N+1 unique test cases.
MC/DC requires pairs of test cases that show a single atomic condition can independently affect the result of a
decision.
Neeraj Kumar Singh
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
Min TC for 100% MC/DC Coverage is N+1
Where N is no of conditions
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
A = {1,5} {2,6} {3,7}
B = {2,4}
C = {3,4}
White Box Test Techniques
Modified Condition/Decision Coverage(MC/DC)
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
Min TC for 100% MC/DC Coverage is N+1
Where N is no of conditions
A = {1,5} {2,6} {3,7}
B = {2,4}
C = {3,4}
TC = {2,3,4,6}
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
Multiple Condition Testing
In rare instances, it might be required to test all possible combinations of atomic conditions that a decision may
contain. This exhaustive level of testing is called multiple condition testing.
The number of required tests is dependent on the number of atomic conditions in the decision statement and can
be determined by calculating 2N where N is the number of uncoupled atomic conditions.
Coverage is measured as the number of unique condition combinations executed by the tests divided by the total
number of condition combinations in the test object, normally expressed as a percentage.
The number of test cases can be derived directly from a truth table containing all of the atomic conditions, this
level of coverage can easily be determined. However, the sheer number of test cases required makes MC/DC
coverage more feasible for most situations.
Neeraj Kumar Singh
White Box Test Techniques
Multiple Condition Testing
Tests A B C Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C))
(A AND (B OR C))
Min TC for 100% MCT Coverage is 2N
Where N is no of conditions
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
Basis Path Testing
Path testing in general consists of identifying paths through the code and then creating tests to cover them.
Conceptually, it would be useful to test every unique path through the system. In any non-trivial system, however,
the number of test cases could become excessively large due to the nature of looping structures.
The technique is applied by the following steps:
1. Create a control flow graph for a given specification item (e.g., code or functional design specification). Note
that this may also be the first step in performing control flow analysis.
2. Select a baseline path through the code (not an exception path). This baseline path should be the most
important path to test – risk could be used to make this judgment.
3. Generate the second path by changing the outcome of the first decision on the path, while keeping the
maximum number of decision outcomes the same as the baseline path.
4. Generate the third path by again starting with the baseline path and changing the outcome of the second
decision on the path. When multiway decisions are encountered (e.g., a case statement), each outcome of the
decision should be exercised before moving on to the next decision.
5. Generate further paths by changing each of the outcomes on the baseline path. When new decisions are
encountered, the most important outcome should be followed first.
6. Once all the decision outcomes on the baseline path have been covered, apply the same approach to
subsequent paths until all the decision outcomes in the specification item have been exercised.
Neeraj Kumar Singh
White Box Test Techniques
Basis Path Testing
Tests Paper Pen Pencil Outcome
1 T T T T
2 T T F T
3 T F T T
4 T F F F
5 F T T F
6 F T F F
7 F F T F
8 F F F F
Neeraj Kumar Singh
(A && (B | C)) = Write
(Paper AND (Pen OR Pencil))
Neeraj Kumar Singh
White Box Test Techniques
Basis Path Testing
TStatement P
IF A THEN
IF B THEN
Statement Q
ELSE
Statement R
ENDIF
ELSE
Statement S
IF C THEN
Statement T
ELSE
Statement U
ENDIF
ENDIF
Statement V
A
STMT P
END IF
F
F F
B
STMT Q
T
STMT R
STMT S
C
T
STMT T
STMT U
END IF
END IF
STMT V
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
API Testing
An Application Programming Interface (API) is code which enables communication between different processes,
programs and/or systems. APIs are often utilized in a client/server relationship where one process supplies some
kind of functionality to other processes.
API Testing is a type of testing rather than a technique. In certain respects, API testing is quite similar to testing a
graphical user interface (GUI). The focus is on the evaluation of input values and returned data.
Negative testing is often crucial when dealing with APIs. Programmers who use APIs to access services external to
their own code may try to use API interfaces in ways for which they were not intended. That means that robust
error handling is essential to avoid incorrect operation.
Combinatorial testing of many different interfaces may be required because APIs are often used in conjunction
with other APIs, and because a single interface may contain several parameters, where values of these may be
combined in many ways.
APIs frequently are loosely coupled, resulting in the very real possibility of lost transactions or timing glitches. This
necessitates thorough testing of the recovery and retry mechanisms. An organization that provides an API interface
must ensure that all services have a very high availability; this often requires strict reliability testing by the API
publisher as well as infrastructure support.
Neeraj Kumar Singh
White Box Test Techniques
API Testing
Applicability
API testing is becoming more important for testing systems of systems as the individual systems become distributed or
use remote processing as a way of off-loading some work to other processors. Examples include:
 Operating systems calls
 Service-oriented architectures (SOA)
 Remote procedure calls (RPC)
 Web services
Software containerization results in the division of a software program into several containers which communicate
with each other using mechanisms such as those listed above. API testing should also target these interfaces.
Limitations/Difficulties
Testing an API directly usually requires a Technical Test Analyst to use specialized tools. Because there is typically no
direct graphical interface associated with an API, tools may be required to setup the initial environment, marshal the
data, invoke the API, and determine the result.
Neeraj Kumar Singh
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Contents
2.1 Introduction
2.2 Statement Testing
2.3 Decision Testing
2.4 Modified Condition/Decision Coverage
(MC/DC) Testing
2.5 Multiple Condition Testing
2.6 Basis Path Testing
2.7 API Testing
2.8 Selecting a White-box Test Technique
Neeraj Kumar Singh
White Box Test Techniques
Selecting a White-box Test Technique
The context of the system under test will have an impact on its product risk and criticality levels ( see below).
These factors influence the required coverage metric (and hence the white-box test technique to use) and the
depth of coverage to be achieved. In general, the more critical the system and the higher the product risk level,
the more rigorous the coverage requirements and the higher the need for time and resources to achieve the
desired coverage.
Sometimes the required coverage metric may be derived from applicable standards that apply to the software
system. For example, if the software were to be used in an airborne environment, it may be required to conform
to standard DO-178C (in Europe, ED-12C.)
This standard contains the following five failure conditions:
A. Catastrophic: failure may cause lack of critical function needed to safely fly or land the plane
B. Hazardous: failure may have a large negative impact on safety or performance efficiency
C. Major: failure is significant, but less serious than A or B
D. Minor: failure is noticeable, but with less impact than C
E. No effect: failure has no impact on safety
Neeraj Kumar Singh
White Box Test Techniques
Selecting a White-box Test Technique
If the software system is categorized as level A, it must be tested to 100% MC/DC coverage. If it is level B, it must
be tested to 100% decision level coverage and MC/DC is optional. Level C requires 100% statement coverage at a
minimum.
Likewise, [IEC61508] is an international standard for the functional safety of programmable, electronic, safety-
related systems. This standard has been adapted in many different areas, including automotive, rail,
manufacturing, nuclear power plants, and machinery. Criticality is defined using a scale of Safety Integrity Levels
(SIL) where SIL1 is the least critical and SIL4 the most critical. The standard gives recommendations for test
coverage, as shown in the following table (note that the exact definitions for each SIL and for the meaning of
“recommended” and “highly recommended” is defined in the standard).
Neeraj Kumar Singh
White Box Test Techniques
1 TTA’s Task in
Risk Based Testing
2 White Box Test
Techniques
3 Analytical
Techniques
Software Testing - ISTQB Advance
Technical Test Analyst Exam Preparation
Chapter 2
Neeraj Kumar Singh
4 Dynamic Analysis 5 Reviews
6 Test Tools &
Automation
White Box Test Techniques
Sample Questions Pattern
Neeraj Kumar Singh
Source : www.istqb.org
Chapter 2 Questions
Distribution
K-Level Number of Questions per
LO(Group)
Summary
TTA-2.2 K3 1
There is a total of questions required
for chapter 2
K3 = 6
K4 = 2
TTA-2.3 K3 1
TTA-2.4 K3 1
TTA-2.5 K3 1
TTA-2.6 K3 1
TTA-2.7 K3 1
TTA-2.8 K4 2
White Box Test Techniques
Sample Questions
1. You are testing a photo-enforcement system for traffic control in an intersection. It has been determined that a photo
should be taken if the signal light is red (RED) or the car is speeding (SPEED) and if the front wheels of the car are over
the line marking the beginning of the intersection (WHEELS).
Consider these sets of test values:
Assume the logic in the code is as follows:
IF ((RED OR SPEED) AND WHEELS) THEN
TAKE THE PHOTO
ELSE
DO NOT TAKE THE PHOTO
Given this information, which sets of values provides the minimum tests to achieve 100% modified condition/decision
coverage?
Select ONE option.
Answer Set
a. 1, 3, and 8.
b. 2 and 8.
c. 3, 4, 5, and 7.
d. 1, 5, 7, and 8.
Neeraj Kumar Singh
1. RED + SPEED + WHEELS
2. RED + SPEED + not WHEELS
3. RED + not SPEED + WHEELS
4. RED + not SPEED + not WHEELS
5. not RED + SPEED + WHEELS
6. not RED + SPEED + not WHEELS
7. not RED + not SPEED + WHEELS
8. not RED + not SPEED + not WHEELS
White Box Test Techniques
Sample Questions
2. You are testing a photo-enforcement system for traffic control in an intersection. It has been determined that a photo
should be taken if the signal light is red (RED) or the car is speeding (SPEED) and if the front wheels of the car are over
the line marking the beginning of the intersection (WHEELS).
Consider these sets of test values:
Assume the logic in the code is as follows:
IF ((RED OR SPEED) AND WHEELS) THEN
TAKE THE PHOTO
ELSE
DO NOT TAKE THE PHOTO
Given this information, which sets of values provide the minimum tests to achieve 100% multiple condition coverage?
Select ONE option.
Answer Set
a. All the sets are needed.
b. 3, 4, 5, and 7.
c. 1, 3, and 8.
d. 1, 5, 7, and 8.
Neeraj Kumar Singh
1. RED + SPEED + WHEELS
2. RED + SPEED + not WHEELS
3. RED + not SPEED + WHEELS
4. RED + not SPEED + not WHEELS
5. not RED + SPEED + WHEELS
6. not RED + SPEED + not WHEELS
7. not RED + not SPEED + WHEELS
8. not RED + not SPEED + not WHEELS
White Box Test Techniques
Sample Questions
3. You are testing a photo-enforcement system for traffic control in an intersection. It has been determined that a photo
should be taken if the signal light is red (RED) or the car is speeding (SPEED) and if the front wheels of the car are over
the line marking the beginning of the intersection (WHEELS).
Consider these sets of test values:
Assume the logic in the code is as follows:
IF ((RED OR SPEED) AND WHEELS) THEN
TAKE THE PHOTO
ELSE
DO NOT TAKE THE PHOTO
Given this information, which sets of values provide the minimum tests to achieve full coverage of basis paths?
Select ONE option.
Answer Set
a. 3, 4, 5, 7
b. 2, 3
c. 1, 3, 8
d. 1
Neeraj Kumar Singh
1. RED + SPEED + WHEELS
2. RED + SPEED + not WHEELS
3. RED + not SPEED + WHEELS
4. RED + not SPEED + not WHEELS
5. not RED + SPEED + WHEELS
6. not RED + SPEED + not WHEELS
7. not RED + not SPEED + WHEELS
8. not RED + not SPEED + not WHEELS
White Box Test Techniques
Sample Questions
4. Which of the following types of defects are targeted by API testing?
Select TWO options.
Answer Set
a. Loss of transactions.
b. Non-conformance to coding standards.
c. Incorrect data handling.
d. Installation defects.
e. GUI faults.
Neeraj Kumar Singh
White Box Test Techniques
Sample Questions
5. You are advising the developers in an agile team on the appropriate test coverage to be achieved in the next
sprint. Three business-critical user stories are on the sprint backlog. Each user story requires that several
sequential actions are performed with some simple error handling routines. Which is the level of test coverage
you would expect to be achieved in the testing of the user stories??
Select ONE option.
Answer Set
a. Decision coverage + Modified Condition/Decision coverage.
b. Decision coverage + Statement coverage.
c. Modified Condition/Decision coverage.
d. Multiple Condition coverage.
Neeraj Kumar Singh

More Related Content

PPTX
Chapter 4 - Quality Characteristics for Technical Testing
Neeraj Kumar Singh
 
PPTX
Chapter 3 - Test Techniques
Neeraj Kumar Singh
 
PPTX
Chapter 1 - Testing Process
Neeraj Kumar Singh
 
PPS
ISTQB Foundation - Chapter 2
Chandukar
 
PPTX
Chapter 2 - Test Management
Neeraj Kumar Singh
 
PPTX
Chapter 3 - Agile Testing Methods, Techniques and Tools
Neeraj Kumar Singh
 
PPTX
Chapter 3 - The Generic Test Automation Architecture
Neeraj Kumar Singh
 
PDF
Chapter 4 - Performance Testing Tasks
Neeraj Kumar Singh
 
Chapter 4 - Quality Characteristics for Technical Testing
Neeraj Kumar Singh
 
Chapter 3 - Test Techniques
Neeraj Kumar Singh
 
Chapter 1 - Testing Process
Neeraj Kumar Singh
 
ISTQB Foundation - Chapter 2
Chandukar
 
Chapter 2 - Test Management
Neeraj Kumar Singh
 
Chapter 3 - Agile Testing Methods, Techniques and Tools
Neeraj Kumar Singh
 
Chapter 3 - The Generic Test Automation Architecture
Neeraj Kumar Singh
 
Chapter 4 - Performance Testing Tasks
Neeraj Kumar Singh
 

What's hot (20)

PPTX
Chapter 3 - Analytical Techniques
Neeraj Kumar Singh
 
PPTX
Chapter 1 - The Technical Test Analyst Tasks in Risk Based Testing
Neeraj Kumar Singh
 
PPTX
Chapter 5 - Reviews
Neeraj Kumar Singh
 
PPTX
Chapter 6 - Transitioning Manual Testing to an Automation Environment
Neeraj Kumar Singh
 
PPTX
Chapter 6 - Test Tools and Automation
Neeraj Kumar Singh
 
PPTX
Chapter 2 - Testing Throughout the Development LifeCycle
Neeraj Kumar Singh
 
PPTX
Chapter 4 - Deployment Risks and Contingencies
Neeraj Kumar Singh
 
PPTX
Chapter 5 - Test Management
Neeraj Kumar Singh
 
PPTX
Chapter 3 - Static Testing
Neeraj Kumar Singh
 
PDF
Chapter 1 - Testing Process
Neeraj Kumar Singh
 
PDF
Chapter 2 - Test Management
Neeraj Kumar Singh
 
PPTX
Chapter 4 - Test Design Techniques
Neeraj Kumar Singh
 
PPTX
Chapter 6 - Test Tools and Automation
Neeraj Kumar Singh
 
PPTX
Chapter 2 - Fundamental Agile Testing Principle, Practices & Process
Neeraj Kumar Singh
 
PPTX
Chapter 3 - Test Automation
Neeraj Kumar Singh
 
PDF
Chapter 1 - Fundamentals of Testing V4.0
Neeraj Kumar Singh
 
PPTX
Chapter 6 - Tool Support for Testing
Neeraj Kumar Singh
 
PPTX
Chapter 4 - Testing Quality Characteristics
Neeraj Kumar Singh
 
PPTX
Chapter 2 - Testing in Agile
Neeraj Kumar Singh
 
PDF
Chapter 7 - People Skills and Team Composition
Neeraj Kumar Singh
 
Chapter 3 - Analytical Techniques
Neeraj Kumar Singh
 
Chapter 1 - The Technical Test Analyst Tasks in Risk Based Testing
Neeraj Kumar Singh
 
Chapter 5 - Reviews
Neeraj Kumar Singh
 
Chapter 6 - Transitioning Manual Testing to an Automation Environment
Neeraj Kumar Singh
 
Chapter 6 - Test Tools and Automation
Neeraj Kumar Singh
 
Chapter 2 - Testing Throughout the Development LifeCycle
Neeraj Kumar Singh
 
Chapter 4 - Deployment Risks and Contingencies
Neeraj Kumar Singh
 
Chapter 5 - Test Management
Neeraj Kumar Singh
 
Chapter 3 - Static Testing
Neeraj Kumar Singh
 
Chapter 1 - Testing Process
Neeraj Kumar Singh
 
Chapter 2 - Test Management
Neeraj Kumar Singh
 
Chapter 4 - Test Design Techniques
Neeraj Kumar Singh
 
Chapter 6 - Test Tools and Automation
Neeraj Kumar Singh
 
Chapter 2 - Fundamental Agile Testing Principle, Practices & Process
Neeraj Kumar Singh
 
Chapter 3 - Test Automation
Neeraj Kumar Singh
 
Chapter 1 - Fundamentals of Testing V4.0
Neeraj Kumar Singh
 
Chapter 6 - Tool Support for Testing
Neeraj Kumar Singh
 
Chapter 4 - Testing Quality Characteristics
Neeraj Kumar Singh
 
Chapter 2 - Testing in Agile
Neeraj Kumar Singh
 
Chapter 7 - People Skills and Team Composition
Neeraj Kumar Singh
 
Ad

Similar to Chapter 2 - White Box Test Techniques (20)

ODP
White box ppt
Chintakunta Hariteja
 
PPT
Black box and white box testing
AWADHESH PRATAP SINGH UNIVERSITY, REWA (M.P.)
 
PPT
blackboxandwhiteboxtesting in software testing.ppt
suchita74
 
PPTX
BLACK BOX & WHITE BOX TESTING.pptx
MohammadShahjalalKha
 
PPTX
WHITE BOX TESTING ashu.pptx
AshutoshKumar899318
 
PPTX
ScioTalks | Coverage Based Testing
Scio Consulting
 
PPTX
White-box testing.pptx
halaalz3by
 
PPTX
ISTQB Foundation Level – Chapter 4: Test Design Techniques
zubair khan
 
PPT
Dynamic Testing
Jimi Patel
 
PPTX
SOFTWARE TESTING PRESENTATION .pptx
Hassan Rasool
 
PPT
Test design techniques
Pragya Rastogi
 
PPTX
oose ppt white box testing and black box
SUJALArora15
 
PPTX
Lavenya Testing.pptx
ssuser94400e
 
PPTX
Introduction to White box testing
Aliaa Monier Ismaail
 
PPTX
White Box Testing
Alisha Roy
 
PPTX
White box testing
Mayuri Verma
 
PDF
Chapter 4 - Test Analysis & Design Techniques V4.0
Neeraj Kumar Singh
 
PPTX
CTFL Module 04
Davis Thomas
 
PPTX
Software engineering
ŐŔaṉģ Zaib
 
PPTX
Whitebox Testing,Types,Different techniques
vasukir11
 
White box ppt
Chintakunta Hariteja
 
Black box and white box testing
AWADHESH PRATAP SINGH UNIVERSITY, REWA (M.P.)
 
blackboxandwhiteboxtesting in software testing.ppt
suchita74
 
BLACK BOX & WHITE BOX TESTING.pptx
MohammadShahjalalKha
 
WHITE BOX TESTING ashu.pptx
AshutoshKumar899318
 
ScioTalks | Coverage Based Testing
Scio Consulting
 
White-box testing.pptx
halaalz3by
 
ISTQB Foundation Level – Chapter 4: Test Design Techniques
zubair khan
 
Dynamic Testing
Jimi Patel
 
SOFTWARE TESTING PRESENTATION .pptx
Hassan Rasool
 
Test design techniques
Pragya Rastogi
 
oose ppt white box testing and black box
SUJALArora15
 
Lavenya Testing.pptx
ssuser94400e
 
Introduction to White box testing
Aliaa Monier Ismaail
 
White Box Testing
Alisha Roy
 
White box testing
Mayuri Verma
 
Chapter 4 - Test Analysis & Design Techniques V4.0
Neeraj Kumar Singh
 
CTFL Module 04
Davis Thomas
 
Software engineering
ŐŔaṉģ Zaib
 
Whitebox Testing,Types,Different techniques
vasukir11
 
Ad

More from Neeraj Kumar Singh (20)

PDF
Chapter 6 - Test Tools Considerations V4.0
Neeraj Kumar Singh
 
PDF
Chapter 5 - Managing Test Activities V4.0
Neeraj Kumar Singh
 
PDF
Chapter 3 - Static Testing (Review) V4.0
Neeraj Kumar Singh
 
PDF
Chapter 2 - Testing Throughout SDLC V4.0
Neeraj Kumar Singh
 
PDF
Chapter 5 - Automating the Test Execution
Neeraj Kumar Singh
 
PDF
Chapter 4 - Mobile Application Platforms, Tools and Environment
Neeraj Kumar Singh
 
PDF
Chapter 3 - Common Test Types and Test Process for Mobile Applications
Neeraj Kumar Singh
 
PDF
Chapter 2 - Mobile Application Test Types
Neeraj Kumar Singh
 
PDF
Chapter 1 - Mobile World - Business and Technology Drivers
Neeraj Kumar Singh
 
PDF
ISTQB Performance Tester Sample Questions
Neeraj Kumar Singh
 
PDF
ISTQB Performance Tester Sample Questions' Answers
Neeraj Kumar Singh
 
PDF
ISTQB Performance Tester Certification Syllabus and Study Material
Neeraj Kumar Singh
 
PDF
Chapter 5 - Tools
Neeraj Kumar Singh
 
PDF
Chapter 3 - Performance Testing in the Software Lifecycle
Neeraj Kumar Singh
 
PDF
Chapter 1 - Basic Concepts
Neeraj Kumar Singh
 
PDF
Chapter 2 - Performance Measurement Fundamentals
Neeraj Kumar Singh
 
PDF
Chapter 6 - Test Tools and Automation
Neeraj Kumar Singh
 
PDF
Chapter 5 - Improving the Testing Process
Neeraj Kumar Singh
 
PDF
Chapter 4 - Defect Management
Neeraj Kumar Singh
 
PDF
Chapter 3 - Reviews
Neeraj Kumar Singh
 
Chapter 6 - Test Tools Considerations V4.0
Neeraj Kumar Singh
 
Chapter 5 - Managing Test Activities V4.0
Neeraj Kumar Singh
 
Chapter 3 - Static Testing (Review) V4.0
Neeraj Kumar Singh
 
Chapter 2 - Testing Throughout SDLC V4.0
Neeraj Kumar Singh
 
Chapter 5 - Automating the Test Execution
Neeraj Kumar Singh
 
Chapter 4 - Mobile Application Platforms, Tools and Environment
Neeraj Kumar Singh
 
Chapter 3 - Common Test Types and Test Process for Mobile Applications
Neeraj Kumar Singh
 
Chapter 2 - Mobile Application Test Types
Neeraj Kumar Singh
 
Chapter 1 - Mobile World - Business and Technology Drivers
Neeraj Kumar Singh
 
ISTQB Performance Tester Sample Questions
Neeraj Kumar Singh
 
ISTQB Performance Tester Sample Questions' Answers
Neeraj Kumar Singh
 
ISTQB Performance Tester Certification Syllabus and Study Material
Neeraj Kumar Singh
 
Chapter 5 - Tools
Neeraj Kumar Singh
 
Chapter 3 - Performance Testing in the Software Lifecycle
Neeraj Kumar Singh
 
Chapter 1 - Basic Concepts
Neeraj Kumar Singh
 
Chapter 2 - Performance Measurement Fundamentals
Neeraj Kumar Singh
 
Chapter 6 - Test Tools and Automation
Neeraj Kumar Singh
 
Chapter 5 - Improving the Testing Process
Neeraj Kumar Singh
 
Chapter 4 - Defect Management
Neeraj Kumar Singh
 
Chapter 3 - Reviews
Neeraj Kumar Singh
 

Recently uploaded (20)

PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Doc9.....................................
SofiaCollazos
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 

Chapter 2 - White Box Test Techniques

  • 1. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 2. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 3. White Box Test Techniques Introduction Each specific technique enables test cases to be derived systematically and focuses on a particular aspect of the structure to be considered. The techniques provide coverage criteria which have to be measured and associated with an objective defined by each project or organization. Achieving full coverage does not mean that the entire set of tests is complete, but rather that the technique being used no longer suggests any useful tests for the structure under consideration. The following techniques are considered in this syllabus:  Statement testing  Decision testing  Modified Condition/Decision Coverage (MC/DC) testing  Multiple Condition testing  Basis Path testing  API testing Neeraj Kumar Singh
  • 4. White Box Test Techniques Statement Testing Neeraj Kumar Singh True False? Read A Read B If A>B then Print “A is Bigger” Else Print “B is Bigger” End If Statement Testing or Coverage is a measure of the number of executable statements in the source code exercised by tests. Start End Branch Nodes A,B A>B A B End If
  • 5. White Box Test Techniques Statement Testing True False? Read A Read B If A>B then Print “A is Bigger” Else Print “B is Bigger” End If Start End A Path is the executable path which reaches the end of the code starting from the start point. 2 1 A,B A>B A B End If
  • 6. Example Statement Testing Neeraj Kumar Singh T IF sufficient water THEN Boil water Add tea Show message “milk?” IF milk = yes THEN Show message “low fat?” IF low fat = yes THEN Add low fat milk ELSE Add normal milk ENDIF ENDIF Show message “sugar?” IF sugar = yes THEN Add sugar ENDIF Stir Wait 3 minutes Show message “please take your tea” ELSE Show message “please fill up water” ENDIF Sufficient Water Boil Water Add Tea Milk? Milk=Yes Low Fat? Low Fat = Yes Low fat Milk Normal Milk End If Sugar? Sugar =Yes End If Add Sugar? End If Please fill up water Stir, wait Please take your tea. End If F F T T F F T
  • 7. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 8. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 9. White Box Test Techniques Decision Testing Neeraj Kumar Singh True False? Read A Read B If A>B then Print “A is Bigger” Else Print “B is Bigger” End If Decision Testing or Coverage is a measure of the number of executable decisions in the source code exercised by tests. Start End Branch/ Decisions Nodes/ Statements A,B A>B A B End If
  • 10. White Box Test Techniques Decision Testing True False? Read A Read B If A>B then Print “A is Bigger” Else Print “B is Bigger” End If Start End A Path is the executable path which reaches the end of the code starting from the start point. 2 1 A,B A>B A B End If
  • 11. Example Decision Testing Neeraj Kumar Singh TStatement P IF A THEN IF B THEN Statement Q ELSE Statement R ENDIF ELSE Statement S IF C THEN Statement T ELSE Statement U ENDIF ENDIF Statement V How many test cases would you design to achieve 100% decision coverage? A STMT P END IF F F F B STMT Q T STMT R STMT S C T STMT T STMT U END IF END IF STMT V Min TC for 100% DC = 4 #TIP – No of If +1
  • 12. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 13. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 14. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Compared to Decision testing, which considers the entire decision as a whole and evaluates the TRUE and FALSE outcomes in separate test cases, MC/DC testing considers how a decision is made when it includes multiple conditions Each decision predicate is made up of one or more simple atomic conditions, each of which evaluates to a discrete Boolean value. These are logically combined to determine the final outcome of the decision. This technique checks that each of the atomic conditions independently and correctly affects the outcome of the overall decision. This technique provides a stronger level of coverage than statement and decision coverage when there are decisions containing multiple conditions. Assuming N unique, independent atomic conditions, MC/DC can usually be achieved with N+1 unique test cases. MC/DC requires pairs of test cases that show a single atomic condition can independently affect the result of a decision. Neeraj Kumar Singh
  • 15. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C)) Min TC for 100% MC/DC Coverage is N+1 Where N is no of conditions
  • 16. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C))
  • 17. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C))
  • 18. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C))
  • 19. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C)) A = {1,5} {2,6} {3,7} B = {2,4} C = {3,4}
  • 20. White Box Test Techniques Modified Condition/Decision Coverage(MC/DC) Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C)) Min TC for 100% MC/DC Coverage is N+1 Where N is no of conditions A = {1,5} {2,6} {3,7} B = {2,4} C = {3,4} TC = {2,3,4,6}
  • 21. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 22. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 23. White Box Test Techniques Multiple Condition Testing In rare instances, it might be required to test all possible combinations of atomic conditions that a decision may contain. This exhaustive level of testing is called multiple condition testing. The number of required tests is dependent on the number of atomic conditions in the decision statement and can be determined by calculating 2N where N is the number of uncoupled atomic conditions. Coverage is measured as the number of unique condition combinations executed by the tests divided by the total number of condition combinations in the test object, normally expressed as a percentage. The number of test cases can be derived directly from a truth table containing all of the atomic conditions, this level of coverage can easily be determined. However, the sheer number of test cases required makes MC/DC coverage more feasible for most situations. Neeraj Kumar Singh
  • 24. White Box Test Techniques Multiple Condition Testing Tests A B C Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) (A AND (B OR C)) Min TC for 100% MCT Coverage is 2N Where N is no of conditions
  • 25. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 26. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 27. White Box Test Techniques Basis Path Testing Path testing in general consists of identifying paths through the code and then creating tests to cover them. Conceptually, it would be useful to test every unique path through the system. In any non-trivial system, however, the number of test cases could become excessively large due to the nature of looping structures. The technique is applied by the following steps: 1. Create a control flow graph for a given specification item (e.g., code or functional design specification). Note that this may also be the first step in performing control flow analysis. 2. Select a baseline path through the code (not an exception path). This baseline path should be the most important path to test – risk could be used to make this judgment. 3. Generate the second path by changing the outcome of the first decision on the path, while keeping the maximum number of decision outcomes the same as the baseline path. 4. Generate the third path by again starting with the baseline path and changing the outcome of the second decision on the path. When multiway decisions are encountered (e.g., a case statement), each outcome of the decision should be exercised before moving on to the next decision. 5. Generate further paths by changing each of the outcomes on the baseline path. When new decisions are encountered, the most important outcome should be followed first. 6. Once all the decision outcomes on the baseline path have been covered, apply the same approach to subsequent paths until all the decision outcomes in the specification item have been exercised. Neeraj Kumar Singh
  • 28. White Box Test Techniques Basis Path Testing Tests Paper Pen Pencil Outcome 1 T T T T 2 T T F T 3 T F T T 4 T F F F 5 F T T F 6 F T F F 7 F F T F 8 F F F F Neeraj Kumar Singh (A && (B | C)) = Write (Paper AND (Pen OR Pencil))
  • 29. Neeraj Kumar Singh White Box Test Techniques Basis Path Testing TStatement P IF A THEN IF B THEN Statement Q ELSE Statement R ENDIF ELSE Statement S IF C THEN Statement T ELSE Statement U ENDIF ENDIF Statement V A STMT P END IF F F F B STMT Q T STMT R STMT S C T STMT T STMT U END IF END IF STMT V
  • 30. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 31. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 32. White Box Test Techniques API Testing An Application Programming Interface (API) is code which enables communication between different processes, programs and/or systems. APIs are often utilized in a client/server relationship where one process supplies some kind of functionality to other processes. API Testing is a type of testing rather than a technique. In certain respects, API testing is quite similar to testing a graphical user interface (GUI). The focus is on the evaluation of input values and returned data. Negative testing is often crucial when dealing with APIs. Programmers who use APIs to access services external to their own code may try to use API interfaces in ways for which they were not intended. That means that robust error handling is essential to avoid incorrect operation. Combinatorial testing of many different interfaces may be required because APIs are often used in conjunction with other APIs, and because a single interface may contain several parameters, where values of these may be combined in many ways. APIs frequently are loosely coupled, resulting in the very real possibility of lost transactions or timing glitches. This necessitates thorough testing of the recovery and retry mechanisms. An organization that provides an API interface must ensure that all services have a very high availability; this often requires strict reliability testing by the API publisher as well as infrastructure support. Neeraj Kumar Singh
  • 33. White Box Test Techniques API Testing Applicability API testing is becoming more important for testing systems of systems as the individual systems become distributed or use remote processing as a way of off-loading some work to other processors. Examples include:  Operating systems calls  Service-oriented architectures (SOA)  Remote procedure calls (RPC)  Web services Software containerization results in the division of a software program into several containers which communicate with each other using mechanisms such as those listed above. API testing should also target these interfaces. Limitations/Difficulties Testing an API directly usually requires a Technical Test Analyst to use specialized tools. Because there is typically no direct graphical interface associated with an API, tools may be required to setup the initial environment, marshal the data, invoke the API, and determine the result. Neeraj Kumar Singh
  • 34. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 35. White Box Test Techniques Contents 2.1 Introduction 2.2 Statement Testing 2.3 Decision Testing 2.4 Modified Condition/Decision Coverage (MC/DC) Testing 2.5 Multiple Condition Testing 2.6 Basis Path Testing 2.7 API Testing 2.8 Selecting a White-box Test Technique Neeraj Kumar Singh
  • 36. White Box Test Techniques Selecting a White-box Test Technique The context of the system under test will have an impact on its product risk and criticality levels ( see below). These factors influence the required coverage metric (and hence the white-box test technique to use) and the depth of coverage to be achieved. In general, the more critical the system and the higher the product risk level, the more rigorous the coverage requirements and the higher the need for time and resources to achieve the desired coverage. Sometimes the required coverage metric may be derived from applicable standards that apply to the software system. For example, if the software were to be used in an airborne environment, it may be required to conform to standard DO-178C (in Europe, ED-12C.) This standard contains the following five failure conditions: A. Catastrophic: failure may cause lack of critical function needed to safely fly or land the plane B. Hazardous: failure may have a large negative impact on safety or performance efficiency C. Major: failure is significant, but less serious than A or B D. Minor: failure is noticeable, but with less impact than C E. No effect: failure has no impact on safety Neeraj Kumar Singh
  • 37. White Box Test Techniques Selecting a White-box Test Technique If the software system is categorized as level A, it must be tested to 100% MC/DC coverage. If it is level B, it must be tested to 100% decision level coverage and MC/DC is optional. Level C requires 100% statement coverage at a minimum. Likewise, [IEC61508] is an international standard for the functional safety of programmable, electronic, safety- related systems. This standard has been adapted in many different areas, including automotive, rail, manufacturing, nuclear power plants, and machinery. Criticality is defined using a scale of Safety Integrity Levels (SIL) where SIL1 is the least critical and SIL4 the most critical. The standard gives recommendations for test coverage, as shown in the following table (note that the exact definitions for each SIL and for the meaning of “recommended” and “highly recommended” is defined in the standard). Neeraj Kumar Singh
  • 38. White Box Test Techniques 1 TTA’s Task in Risk Based Testing 2 White Box Test Techniques 3 Analytical Techniques Software Testing - ISTQB Advance Technical Test Analyst Exam Preparation Chapter 2 Neeraj Kumar Singh 4 Dynamic Analysis 5 Reviews 6 Test Tools & Automation
  • 39. White Box Test Techniques Sample Questions Pattern Neeraj Kumar Singh Source : www.istqb.org Chapter 2 Questions Distribution K-Level Number of Questions per LO(Group) Summary TTA-2.2 K3 1 There is a total of questions required for chapter 2 K3 = 6 K4 = 2 TTA-2.3 K3 1 TTA-2.4 K3 1 TTA-2.5 K3 1 TTA-2.6 K3 1 TTA-2.7 K3 1 TTA-2.8 K4 2
  • 40. White Box Test Techniques Sample Questions 1. You are testing a photo-enforcement system for traffic control in an intersection. It has been determined that a photo should be taken if the signal light is red (RED) or the car is speeding (SPEED) and if the front wheels of the car are over the line marking the beginning of the intersection (WHEELS). Consider these sets of test values: Assume the logic in the code is as follows: IF ((RED OR SPEED) AND WHEELS) THEN TAKE THE PHOTO ELSE DO NOT TAKE THE PHOTO Given this information, which sets of values provides the minimum tests to achieve 100% modified condition/decision coverage? Select ONE option. Answer Set a. 1, 3, and 8. b. 2 and 8. c. 3, 4, 5, and 7. d. 1, 5, 7, and 8. Neeraj Kumar Singh 1. RED + SPEED + WHEELS 2. RED + SPEED + not WHEELS 3. RED + not SPEED + WHEELS 4. RED + not SPEED + not WHEELS 5. not RED + SPEED + WHEELS 6. not RED + SPEED + not WHEELS 7. not RED + not SPEED + WHEELS 8. not RED + not SPEED + not WHEELS
  • 41. White Box Test Techniques Sample Questions 2. You are testing a photo-enforcement system for traffic control in an intersection. It has been determined that a photo should be taken if the signal light is red (RED) or the car is speeding (SPEED) and if the front wheels of the car are over the line marking the beginning of the intersection (WHEELS). Consider these sets of test values: Assume the logic in the code is as follows: IF ((RED OR SPEED) AND WHEELS) THEN TAKE THE PHOTO ELSE DO NOT TAKE THE PHOTO Given this information, which sets of values provide the minimum tests to achieve 100% multiple condition coverage? Select ONE option. Answer Set a. All the sets are needed. b. 3, 4, 5, and 7. c. 1, 3, and 8. d. 1, 5, 7, and 8. Neeraj Kumar Singh 1. RED + SPEED + WHEELS 2. RED + SPEED + not WHEELS 3. RED + not SPEED + WHEELS 4. RED + not SPEED + not WHEELS 5. not RED + SPEED + WHEELS 6. not RED + SPEED + not WHEELS 7. not RED + not SPEED + WHEELS 8. not RED + not SPEED + not WHEELS
  • 42. White Box Test Techniques Sample Questions 3. You are testing a photo-enforcement system for traffic control in an intersection. It has been determined that a photo should be taken if the signal light is red (RED) or the car is speeding (SPEED) and if the front wheels of the car are over the line marking the beginning of the intersection (WHEELS). Consider these sets of test values: Assume the logic in the code is as follows: IF ((RED OR SPEED) AND WHEELS) THEN TAKE THE PHOTO ELSE DO NOT TAKE THE PHOTO Given this information, which sets of values provide the minimum tests to achieve full coverage of basis paths? Select ONE option. Answer Set a. 3, 4, 5, 7 b. 2, 3 c. 1, 3, 8 d. 1 Neeraj Kumar Singh 1. RED + SPEED + WHEELS 2. RED + SPEED + not WHEELS 3. RED + not SPEED + WHEELS 4. RED + not SPEED + not WHEELS 5. not RED + SPEED + WHEELS 6. not RED + SPEED + not WHEELS 7. not RED + not SPEED + WHEELS 8. not RED + not SPEED + not WHEELS
  • 43. White Box Test Techniques Sample Questions 4. Which of the following types of defects are targeted by API testing? Select TWO options. Answer Set a. Loss of transactions. b. Non-conformance to coding standards. c. Incorrect data handling. d. Installation defects. e. GUI faults. Neeraj Kumar Singh
  • 44. White Box Test Techniques Sample Questions 5. You are advising the developers in an agile team on the appropriate test coverage to be achieved in the next sprint. Three business-critical user stories are on the sprint backlog. Each user story requires that several sequential actions are performed with some simple error handling routines. Which is the level of test coverage you would expect to be achieved in the testing of the user stories?? Select ONE option. Answer Set a. Decision coverage + Modified Condition/Decision coverage. b. Decision coverage + Statement coverage. c. Modified Condition/Decision coverage. d. Multiple Condition coverage. Neeraj Kumar Singh