Software Quality Assurance
HNDIT-4022
White Box Testing
White Box Testing
White box testing techniques analyze the internal structures the
used data structures, internal design, code structure, and the
working of the software rather than just the functionality as in
black box testing. It is also called glass box testing or clear box
testing or structural testing. White Box Testing is also known as
transparent testing or open box testing.
White Box Testing
White box testing is a verification technique where software
engineers can use to examine if the code works as expected or
not.
It is the strategy testing is based on
- Software’s internal paths
- Design and coding
- Logics
- Structures
- Implementation of software under test
Process of White Box Testing
1. Input: Requirements, Functional specifications, design
documents, source code.
2. Processing: Performing risk analysis to guide through the
entire process.
3. Proper test planning: Designing test cases to cover the entire
code. Execute rinse-repeat until error-free software is
reached. Also, the results are communicated.
4. Output: Preparing final report of the entire testing process.
Techniques in White Box Testing
Testing Techniques…
1. Statement Coverage
In this technique, the aim is to traverse all statements at least
once. Hence, each line of code is tested. In the case of a
flowchart, every node must be traversed at least once. Since all
lines of code are covered, it helps in pointing out faulty code.
1. Statement Coverage…
2. Branch Coverage:
In this technique, test cases are designed so that each branch
from all decision points is traversed at least once. In a flowchart,
all edges must be traversed at least once.
2. Branch Coverage…
3. Condition Coverage
In this technique, all individual conditions must be covered
as shown in the following example:
● READ X, Y
● IF(X == 0 || Y == 0)
● PRINT ‘0’
● #TC1 – X = 0, Y = 55
● #TC2 – X = 5, Y = 0
Other White Box Testing Techniques
4. Multiple Condition Coverage
5. Basic Path Testing
6. Loop Testing
❏ Simple loops
❏ Nested loops
❏ Concatenated loops
White Testing is performed in 2 Steps;
1. Tester should understand the code well
2. Tester should write some code for test cases and
Tools required for White box testing:
● PyUnit ● Fiddler
● Sqlmap ● [Link]
● Nmap ● OpenGrok
● Parasoft Jtest ● Wireshark
● Nunit ● HP Fortify
● VeraUnit ● CSUnit
● CppUnit
● Bugzilla
Features of White box Testing:
● Code coverage analysis
● Access to the source code
● Knowledge of programming languages
● Identifying logical errors
● Integration testing
● Unit testing
● Optimization of code
● Security testing
● Verification of Design
● Check for Accurate Code
● Identifying Coding Mistakes
● Path Examination
● Determining the Dead Code
Advantages of Whitebox Testing:
● Thorough Testing:
● Code Optimization:
● Early Detection of Defects:
● Integration with SDLC:
● Detection of Complex Defects:
● Comprehensive Test Cases:
● Testers can ensure that the code meets coding standards and is
optimized for performance.
Disadvantages of White box Testing:
● Programming Knowledge and Source Code Access:
● Overemphasis on Internal Workings:
● Bias in Testing:
● Test Case Overhead:
● Dependency on Tester Expertise:
● Inability to Detect Missing Functionalities:
● Increased Production Errors:
Q&A’s ?
Thank you !