SlideShare a Scribd company logo
Unit 2
Chapter 1 White Box Testing
By
Ms.R.Vasuki
Asst.Professor & Head
Department of Artificial Intelligence
R.VASUKI
ASST.PROFESSOR & HEAD
DEPARTMENT OF ARTIFICIAL INTELLIGENCE
Definition
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 used to test the software’s internal
logic, flow, and structure.
It is also called glass box testing clear box testing or
structural testing. White Box Testing is also known as
transparent testing or open box testing.
Black diagram
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 the final report of the entire testing process.
White Testing is performed in 2 Steps
5. Tester should understand the code well
6. Tester should write some code for test cases and execute them
What Does White Box Testing Focus On?
● Path Checking: Examines the different routes the program can take when it runs.
Ensures that all decisions made by the program are correct, necessary, and efficient.
● Output Validation: Tests different inputs to see if the function gives the right output
each time.
● Security Testing: Uses techniques like static code analysis to find and fix potential
security issues in the software. Ensures the software is developed using secure
practices.
● Loop Testing: Checks the loops in the program to make sure they work correctly and
efficiently. Ensures that loops handle variables properly within their scope.
● Data Flow Testing: Follows the path of variables through the program to ensure they
Types Of White Box Testing
Unit Testing
● Checks if each part or function of the application works correctly.
● Ensures the application meets design requirements during development.
Eg:Imagine you’re building a bicycle. Unit testing would be like checking each
part separately – testing the brakes, the gears, the pedals, etc., to ensure they all
work correctly before assembling the whole bicycle.
Integration Testing
● Examines how different parts of the application work together.
● Done after unit testing to make sure components work well both alone and together.
● Integration testing ensures that every integrated module functions
correctly
● Testers can initiate integration testing once a module is completed and
doesn’t require waiting for another module to be done and ready for
testing
Regression Testing
● Verifies that changes or updates don’t break existing functionality.
● Ensures the application still passes all existing tests after updates.
Example
def Printme(a, b):
result = a + b
if result > 0:
print("Positive",
result)
else:
print("Negative",
result)
The goal of White Box Testing here is to verify all the
decision branches (the if-else condition) in the code.
To exercise the statements in this code, we would
create the following test cases:
Test Case 1: a = 1, b = 1
This would test the “Positive” branch of the
if-else condition.
Test Case 2: a = -1, b = -3
This would test the “Negative” branch of the
if-else condition.
Different Techniques in White Box Testing
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.This is like making sure you
read every sentence in a book. In code, it means ensuring every line or statement of the
code is executed at least once during testing.
2. Branch Coverage
● In code, it means
testing every
possible outcome
of the code’s
decision points
(like if-else
conditions).
● In a flowchart, all
edges must be
traversed at least
once.
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
4. Multiple Condition Coverage
In this technique, all the possible combinations of
the possible outcomes of conditions are tested at
least once. Let’s consider the following example:
● READ X, Y
● IF(X == 0 || Y == 0)
● PRINT ‘0’
● #TC1: X = 0, Y = 0
● #TC2: X = 0, Y = 5
● #TC3: X = 55, Y = 0
● #TC4: X = 55, Y = 5
5. Basis Path Testing
In this technique, control flow graphs are made from code or flowchart and then Cyclomatic complexity
is calculated which defines the number of independent paths so that the minimal number of test cases
can be designed for each independent path. Steps:
● Make the corresponding control flow graph
● Calculate the cyclomatic complexity
● Find the independent paths
● Design test cases corresponding to each independent path
● V(G) = P + 1, where P is the number of predicate nodes in the flow graph
● V(G) = E – N + 2, where E is the number of edges and N is the total number of nodes
● V(G) = Number of non-overlapping regions in the graph ● #P1: 1 – 2 – 4 – 7 – 8
● #P2: 1 – 2 – 3 – 5 – 7 – 8
● #P3: 1 – 2 – 3 – 6 – 7 – 8
● #P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8
6.Loop Testing
Loops are widely used and these are fundamental to many algorithms hence, their testing is very
important. Errors often occur at the beginnings and ends of loops.
● Simple loops: For simple loops of size n, test cases are designed that:
1. Skip the loop entirely
2. Only one pass through the loop
3. 2 passes
4. m passes, where m < n
5. n-1 ans n+1 passes
Whitebox Testing,Types,Different techniques
1. Limited Scope of Testing
One of the significant challenges of white box testing is its limited scope. Since white box testing
involves examining the internal structure and code of a software application, it can only evaluate
the specific areas that are accessible for analysis. This means that certain aspects of the system,
such as external dependencies or third-party integrations, may not be fully tested using white
box techniques.
2. Time-consuming and Resource-intensive
White box testing requires detailed knowledge of the internal workings of the software,
including the codebase, algorithms, and data structures. This level of understanding can be
time-consuming and resource-intensive, especially for complex applications.
3. Incomplete Coverage
While white box testing allows for a deep analysis of the internal components of a software
application, it is still susceptible to incomplete coverage.
4. Lack of Real-world Conditions
White box testing operates at the code level, where the focus is on verifying the correctness
and reliability of individual functions or modules. However, this approach often fails to
replicate real-world conditions and user interactions.
white box testing may not adequately simulate concurrent user access, network latency, or
database load, which can significantly impact the performance and behavior of an
application.
5. Maintenance Challenges
As software applications evolve over time, the codebase undergoes changes and updates.
This poses a challenge for white box testing since any modifications to the code may require
a reassessment of the testing strategy. Test cases that were previously designed based on
the original code structure may no longer be valid or effective.
1.What is white box testing?
a)Testing the software's user interface b)Testing the software's internal logic and code structure
c)Testing the software's performance d)Testing the software for security vulnerabilities
2.What is the primary focus of white box testing?
a)Functionalities of the software b)User interface design
c)Code execution paths and internal structures d)System integration testing
3.Which testing technique is commonly not used in white box testing?
a)Basis path testing b) boundary value analysis
c)Branch coverage d)Loop testing
4.Which of the following testing is also known as white-box testing?
a) Structural testing b)Error guessing technique
c)Design based testing d)None of the above
Find the Answer

More Related Content

PPTX
oose ppt white box testing and black box
PPT
Chapter 8 Testing Tactics.ppt
PPT
Chapter 8 Testing Tactics.ppt Software engineering
PPT
Unit 2 Unit level testing.ppt
PPT
Testing
PPTX
Introduction to White box testing
PPT
1414_lecturueueueueuueueeueueueuusuee_7.ppt
PPT
Software testing & its technology
oose ppt white box testing and black box
Chapter 8 Testing Tactics.ppt
Chapter 8 Testing Tactics.ppt Software engineering
Unit 2 Unit level testing.ppt
Testing
Introduction to White box testing
1414_lecturueueueueuueueeueueueuusuee_7.ppt
Software testing & its technology

Similar to Whitebox Testing,Types,Different techniques (20)

PPT
PPTX
Software testing introduction
PPT
Testing chapter updated (1)
PPTX
BLACK BOX & WHITE BOX TESTING.pptx
PPT
CS8494 SOFTWARE ENGINEERING Unit-4
PPT
Software testing for biginners
PPTX
White-box testing.pptx
DOCX
Se unit 4
PPT
Software Engineering (Testing techniques)
PPT
Software Engineering (Testing techniques)
PPT
Software testing
PPTX
SE UNIT 5 part 2 (1).pptx
DOC
Testing
PPT
11 whiteboxtesting
PPTX
WHITE BOX TESTING ashu.pptx
PDF
Tools and techniques of code coverage testing
PPTX
Software_Testing_Techniques_undergraduate.pptx
PDF
Automock: Interaction-Based Mock Code Generation
PDF
Class9_SW_Testing_Strategies.pdf
PPTX
19 Software Testing Techniques presentation file.pptx
Software testing introduction
Testing chapter updated (1)
BLACK BOX & WHITE BOX TESTING.pptx
CS8494 SOFTWARE ENGINEERING Unit-4
Software testing for biginners
White-box testing.pptx
Se unit 4
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
Software testing
SE UNIT 5 part 2 (1).pptx
Testing
11 whiteboxtesting
WHITE BOX TESTING ashu.pptx
Tools and techniques of code coverage testing
Software_Testing_Techniques_undergraduate.pptx
Automock: Interaction-Based Mock Code Generation
Class9_SW_Testing_Strategies.pdf
19 Software Testing Techniques presentation file.pptx
Ad

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
System and Network Administration Chapter 2
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
L1 - Introduction to python Backend.pptx
PDF
Nekopoi APK 2025 free lastest update
PPT
Introduction Database Management System for Course Database
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
history of c programming in notes for students .pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
ai tools demonstartion for schools and inter college
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Transform Your Business with a Software ERP System
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms II-SECS-1021-03
System and Network Administration Chapter 2
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
L1 - Introduction to python Backend.pptx
Nekopoi APK 2025 free lastest update
Introduction Database Management System for Course Database
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
2025 Textile ERP Trends: SAP, Odoo & Oracle
Upgrade and Innovation Strategies for SAP ERP Customers
history of c programming in notes for students .pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
ai tools demonstartion for schools and inter college
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Transform Your Business with a Software ERP System
CHAPTER 2 - PM Management and IT Context
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
How to Migrate SBCGlobal Email to Yahoo Easily
Ad

Whitebox Testing,Types,Different techniques

  • 1. Unit 2 Chapter 1 White Box Testing By Ms.R.Vasuki Asst.Professor & Head Department of Artificial Intelligence R.VASUKI ASST.PROFESSOR & HEAD DEPARTMENT OF ARTIFICIAL INTELLIGENCE
  • 2. Definition 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 used to test the software’s internal logic, flow, and structure. It is also called glass box testing clear box testing or structural testing. White Box Testing is also known as transparent testing or open box testing.
  • 4. 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 the final report of the entire testing process. White Testing is performed in 2 Steps 5. Tester should understand the code well 6. Tester should write some code for test cases and execute them
  • 5. What Does White Box Testing Focus On? ● Path Checking: Examines the different routes the program can take when it runs. Ensures that all decisions made by the program are correct, necessary, and efficient. ● Output Validation: Tests different inputs to see if the function gives the right output each time. ● Security Testing: Uses techniques like static code analysis to find and fix potential security issues in the software. Ensures the software is developed using secure practices. ● Loop Testing: Checks the loops in the program to make sure they work correctly and efficiently. Ensures that loops handle variables properly within their scope. ● Data Flow Testing: Follows the path of variables through the program to ensure they
  • 6. Types Of White Box Testing
  • 7. Unit Testing ● Checks if each part or function of the application works correctly. ● Ensures the application meets design requirements during development. Eg:Imagine you’re building a bicycle. Unit testing would be like checking each part separately – testing the brakes, the gears, the pedals, etc., to ensure they all work correctly before assembling the whole bicycle. Integration Testing ● Examines how different parts of the application work together. ● Done after unit testing to make sure components work well both alone and together.
  • 8. ● Integration testing ensures that every integrated module functions correctly ● Testers can initiate integration testing once a module is completed and doesn’t require waiting for another module to be done and ready for testing Regression Testing ● Verifies that changes or updates don’t break existing functionality. ● Ensures the application still passes all existing tests after updates.
  • 9. Example def Printme(a, b): result = a + b if result > 0: print("Positive", result) else: print("Negative", result) The goal of White Box Testing here is to verify all the decision branches (the if-else condition) in the code. To exercise the statements in this code, we would create the following test cases: Test Case 1: a = 1, b = 1 This would test the “Positive” branch of the if-else condition. Test Case 2: a = -1, b = -3 This would test the “Negative” branch of the if-else condition.
  • 10. Different Techniques in White Box Testing
  • 11. 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.This is like making sure you read every sentence in a book. In code, it means ensuring every line or statement of the code is executed at least once during testing.
  • 12. 2. Branch Coverage ● In code, it means testing every possible outcome of the code’s decision points (like if-else conditions). ● In a flowchart, all edges must be traversed at least once.
  • 13. 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 4. Multiple Condition Coverage In this technique, all the possible combinations of the possible outcomes of conditions are tested at least once. Let’s consider the following example: ● READ X, Y ● IF(X == 0 || Y == 0) ● PRINT ‘0’ ● #TC1: X = 0, Y = 0 ● #TC2: X = 0, Y = 5 ● #TC3: X = 55, Y = 0 ● #TC4: X = 55, Y = 5
  • 14. 5. Basis Path Testing In this technique, control flow graphs are made from code or flowchart and then Cyclomatic complexity is calculated which defines the number of independent paths so that the minimal number of test cases can be designed for each independent path. Steps: ● Make the corresponding control flow graph ● Calculate the cyclomatic complexity ● Find the independent paths ● Design test cases corresponding to each independent path ● V(G) = P + 1, where P is the number of predicate nodes in the flow graph ● V(G) = E – N + 2, where E is the number of edges and N is the total number of nodes ● V(G) = Number of non-overlapping regions in the graph ● #P1: 1 – 2 – 4 – 7 – 8 ● #P2: 1 – 2 – 3 – 5 – 7 – 8 ● #P3: 1 – 2 – 3 – 6 – 7 – 8 ● #P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8
  • 15. 6.Loop Testing Loops are widely used and these are fundamental to many algorithms hence, their testing is very important. Errors often occur at the beginnings and ends of loops. ● Simple loops: For simple loops of size n, test cases are designed that: 1. Skip the loop entirely 2. Only one pass through the loop 3. 2 passes 4. m passes, where m < n 5. n-1 ans n+1 passes
  • 17. 1. Limited Scope of Testing One of the significant challenges of white box testing is its limited scope. Since white box testing involves examining the internal structure and code of a software application, it can only evaluate the specific areas that are accessible for analysis. This means that certain aspects of the system, such as external dependencies or third-party integrations, may not be fully tested using white box techniques. 2. Time-consuming and Resource-intensive White box testing requires detailed knowledge of the internal workings of the software, including the codebase, algorithms, and data structures. This level of understanding can be time-consuming and resource-intensive, especially for complex applications.
  • 18. 3. Incomplete Coverage While white box testing allows for a deep analysis of the internal components of a software application, it is still susceptible to incomplete coverage. 4. Lack of Real-world Conditions White box testing operates at the code level, where the focus is on verifying the correctness and reliability of individual functions or modules. However, this approach often fails to replicate real-world conditions and user interactions. white box testing may not adequately simulate concurrent user access, network latency, or database load, which can significantly impact the performance and behavior of an application.
  • 19. 5. Maintenance Challenges As software applications evolve over time, the codebase undergoes changes and updates. This poses a challenge for white box testing since any modifications to the code may require a reassessment of the testing strategy. Test cases that were previously designed based on the original code structure may no longer be valid or effective.
  • 20. 1.What is white box testing? a)Testing the software's user interface b)Testing the software's internal logic and code structure c)Testing the software's performance d)Testing the software for security vulnerabilities 2.What is the primary focus of white box testing? a)Functionalities of the software b)User interface design c)Code execution paths and internal structures d)System integration testing 3.Which testing technique is commonly not used in white box testing? a)Basis path testing b) boundary value analysis c)Branch coverage d)Loop testing 4.Which of the following testing is also known as white-box testing? a) Structural testing b)Error guessing technique c)Design based testing d)None of the above Find the Answer