0% found this document useful (0 votes)
9 views24 pages

Lecture 9 BBT & WBT

The document discusses the differences between Black Box Testing and White Box Testing, highlighting their focus, methodology, and requirements. Black Box Testing evaluates software from an external perspective without knowledge of internal workings, while White Box Testing examines the internal structure and requires programming knowledge. It also outlines various testing techniques, tools, and the stages of testing within the Software Development Life Cycle (SDLC).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views24 pages

Lecture 9 BBT & WBT

The document discusses the differences between Black Box Testing and White Box Testing, highlighting their focus, methodology, and requirements. Black Box Testing evaluates software from an external perspective without knowledge of internal workings, while White Box Testing examines the internal structure and requires programming knowledge. It also outlines various testing techniques, tools, and the stages of testing within the Software Development Life Cycle (SDLC).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Software Quality

Assurance & Testing


Lecture 10

Black Box Testing & White Box Testing


FUNCTIONAL VS. STRUCTURAL TESTING

• The main difference between functional and structural testing is the


perspective and the related focus:
• Functional testing focuses on the external behavior of a software
system or its various components, while viewing the object to be
tested as a black-box that prevents us from seeing the contents
inside.
• On the other hand, structural testing focuses on the internal
implementation, while viewing the object to be tested as a white-box
that allows us to see the contents inside.
Level of Abstraction in Software Testing
• At the most detailed level, individual program elements can be tested.
This includes testing of individual statements, decisions, and data items,
typically in a small scale by focusing on an individual program unit or a
small component. (White Box)
• At the intermediate level, various program elements or program
components may be treated as an interconnected group, and tested
accordingly. This could be done at component, sub-system, or system
levels, with the help of some models to capture the interconnection and
other relations among different elements or components. (Grey Box)
• At the most abstract level, the whole software systems can be treated
as a “blackbox”, while we focus on the functions or input-output
relations instead of the internal implementation. (Black Box)
What is Black Box testing?
• In Black-box testing, a tester doesn't have any information about the
internal working of the software system.
• Black box testing is a high level of testing that focuses on the behavior of
the software.
• It involves testing from an external or end-user perspective.
• Black box testing can be applied to virtually every level of software
testing: unit, integration, system, and acceptance.
What is White Box testing?
• White-box testing is a testing technique which checks the internal
functioning of the system. In this method, testing is based on coverage
of code statements, branches, paths or conditions.
• White-Box testing is considered as low-level testing. It is also called glass
box, transparent box, clear box or code base testing.
• The white-box Testing method assumes that the path of the logic in a
unit or program is known.
KEY DIFFERENCE
• In Black Box, testing is done without the knowledge of the internal structure of
program or application whereas in White Box, testing is done with knowledge of
the internal structure of program.
• Black Box test doesn’t require programming knowledge whereas the White Box
test requires programming knowledge.
• Black Box testing has the main goal to test the behavior of the software whereas
White Box testing has the main goal to test the internal operation of the system.
• Black Box testing is focused on external or end-user perspective whereas White
Box testing is focused on code structure, conditions, paths and branches.
• Black Box test provides low granularity reports whereas the White Box test
provides high granularity reports.
• Black Box testing is a not time-consuming process whereas White Box testing is a
time-consuming process.
Difference between Black Box testing and White Box testing
Parameter Black Box testing White Box testing
Definition It is a testing approach which is used to test the It is a testing approach in which internal structure
software without the knowledge of the internal is known to the tester.
structure of program or application.

Alias It also knowns as data-driven, box testing, data-, and It is also called structural testing, clear box testing,
functional testing. code-based testing, or glass box testing.

Base of Testing Testing is based on external expectations; internal Internal working is known, and the tester can test
behavior of the application is unknown. accordingly.

Usage This type of testing is ideal for higher levels of testing Testing is best suited for a lower level of testing
like System Testing, Acceptance testing. like Unit Testing, Integration testing.

Programming knowledge Programming knowledge is not needed to perform Programming knowledge is required to perform
Black Box testing. White Box testing.

Implementation knowledge Implementation knowledge is not requiring doing Complete understanding needs to implement
Black Box testing. White Box testing.
Difference between Black Box
testing and White Box testing
Parameter Black Box testing White Box testing

Objective The main objective of this testing is to check what functionality The main objective of White Box testing is done to
of the system under test. check the quality of the code.

Basis for test cases Testing can start after preparing requirement specification Testing can start after preparing for Detail design
document. document.
Tested by Performed by the end user, developer, and tester. Usually done by tester and developers.
Granularity Granularity is low. Granularity is high.

Testing method It is based on trial and error method. Data domain and internal boundaries can be tested.

Time It is less exhaustive and time-consuming. Exhaustive and time-consuming method.

Algorithm test Not the best method for algorithm testing. Best suited for algorithm testing.

Code Access Code access is not required for Black Box Testing. White box testing requires code access. Thereby, the
code could be stolen if testing is outsourced.
Automation Test and programmer are dependent on each other, so it is White Box testing is easy to automate.
tough to automate.
Difference between Black Box
testing and White Box testing
Parameter Black Box testing White Box testing

Benefit Well suited and efficient for large code segments. It allows removing the extra lines of code, which can bring
in hidden defects.
Skill level Low skilled testers can test the application with Need an expert tester with vast experience to perform
no knowledge of the implementation of white box testing.
programming language or operating system.
Techniques • Equivalence partitioning divides input values • Statement Coverage validates whether every line of the
into valid and invalid partitions and selecting code is executed at least once.
corresponding values from each partition of • Branch coverage validates whether each branch is
the test data. executed at least once.
• Boundary value analysis checks boundaries • Path coverage method tests all the paths of the
for input values. program.
Drawbacks Update to automation test script is essential if Automated test cases can become useless if the code base
you to modify application frequently. is rapidly changing.
Black Box Testing

• The above Black-Box can be any software system you want to test. For
Example, an operating system like Windows, a website like Google, a
database like Oracle or even your own custom application.
• Under Black Box Testing, you can test these applications by just focusing on
the inputs and outputs without knowing their internal code
implementation.
How to do Black Box Testing
• Here are the generic steps followed to carry out any type of Black Box Testing.
• Initially, the requirements and specifications of the system are examined.
• Tester chooses valid inputs (positive test scenario) to check whether System
under test (SUT) processes them correctly. Also, some invalid inputs (negative
test scenario) are chosen to verify that the SUT is able to detect them.
• Tester determines expected outputs for all those inputs.
• Software tester constructs test cases with the selected inputs.
• The test cases are executed.
• Software tester compares the actual outputs with the expected outputs.
• Defects if any are fixed and re-tested.
Types of Black Box Testing
• There are many types of Black Box Testing but the following are the
prominent ones -
• Functional testing - This black box testing type is related to the functional
requirements of a system; it is done by software testers.
• Non-functional testing - This type of black box testing is not related to
testing of specific functionality, but non-functional requirements such as
performance, scalability, usability.
• Regression testing - Regression Testing is done after code fixes, upgrades
or any other system maintenance to check the new code has not affected
the existing code.
Tools used for Black Box Testing:

• Tools used for Black box testing largely depends on the type of black box
testing you are doing.
• For Functional/ Regression Tests you can use - QTP, Selenium
• For Non-Functional Tests, you can use - LoadRunner, Jmeter
Black Box Testing Techniques
• Following are the prominent Test Strategies amongst the many used in
Black box Testing
• Equivalence Class Testing: It is used to minimize the number of possible
test cases to an optimum level while maintains reasonable test coverage.
• Boundary Value Testing: Boundary value testing is focused on the values at
boundaries. This technique determines whether a certain range of values
are acceptable by the system or not. It is very useful in reducing the
number of test cases. It is most suitable for the systems where an input is
within certain ranges.
• Decision Table Testing: A decision table puts causes and their effects in a
matrix. There is a unique combination in each column.
Black Box Testing and Software
Development Life Cycle (SDLC)
• Black box testing has its own life cycle called Software Testing Life Cycle (
STLC) and it is relative to every stage of Software Development Life Cycle of
Software Engineering.
• Requirement - This is the initial stage of SDLC and in this stage, a
requirement is gathered. Software testers also take part in this stage.
• Test Planning & Analysis - Testing Types applicable to the project are
determined. A Test Plan is created which determines possible project risks
and their mitigation.
• Design - In this stage Test cases/scripts are created on the basis of software
requirement documents
• Test Execution- In this stage Test Cases prepared are executed. Bugs if any
are fixed and re-tested.
White Box Testing

• White Box Testing is software testing technique in which internal


structure, design and coding of software are tested to verify flow of input-
output and to improve design, usability and security.
• In white box testing, code is visible to testers so it is also called Clear box
testing, Open box testing, Transparent box testing, Code-based testing and
Glass box testing.
What do you verify in White Box Testing?

White box testing involves the testing of the software code for the following:
Internal security holes
Broken or poorly structured paths in the coding processes
The flow of specific inputs through the code
Expected output
The functionality of conditional loops
Testing of each statement, object, and function on an individual basis
How do you perform White Box Testing?
• To give you a simplified explanation of white box testing, we have divided
it into two basic steps. This is what testers do when testing an application
using the white box testing technique:

• STEP 1) UNDERSTAND THE SOURCE CODE

• Step 2) CREATE TEST CASES AND EXECUTE


White Box Testing Example
• Consider the following piece of code

• The goal of White Box testing in software engineering is to verify all the
decision branches, loops, statements in the code.
• To exercise the statements in the above code, White Box test cases would be
• A = 1, B = 1
• A = -1, B = -3
White Box Testing Techniques
Following are important White Box Testing Techniques:
Statement Coverage
Decision Coverage
Branch Coverage
Condition Coverage
Multiple Condition Coverage
Finite State Machine Coverage
Path Coverage
Control flow testing
Data flow testing
Types of White Box Testing
White box testing encompasses several testing types used to evaluate the
usability of an application, block of code or specific software package. There
are listed below
• Unit Testing: It is often the first type of testing done on an application.
Unit Testing is performed on each unit or block of code as it is developed.
Unit Testing is essentially done by the programmer.
• Testing for Memory Leaks: Memory leaks are leading causes of slower
running applications. A QA specialist who is experienced at detecting
memory leaks is essential in cases where you have a slow running software
application.
White Box Testing Tools
• Below is a list of top white box testing tools.
• Parasoft Jtest
• EclEmma
• NUnit
• PyUnit
• HTMLUnit
• CppUnit
When to Stop Testing
Resource-based criteria
 “Stop when you run out of time.”
 “Stop when you run out of money.

Activity-based criteria,
 “Stop when you complete planned test activities.”
END OF LECTURE

You might also like