Lecture 9 BBT & WBT
Lecture 9 BBT & WBT
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.
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 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:
• 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