White Box Testing:
• white box testing which also known as glass
box is testing, structural testing, clear box
testing, open box testing and transparent
box testing.
• It tests internal coding and infrastructure of a
software focus on checking of predefined
inputs against expected and desired outputs.
• It is based on inner workings of an application
and revolves around internal structure
testing.
• In this type of testing programming skills are
required to design test cases.
• The primary goal of white box testing is to
focus on the flow of inputs and outputs
through the software and strengthening the
security of the software.
White Box Testing:
• The ability to see through the software's
outer shell into its inner workings.
• Developers do white box testing.
• In this, the developer will test every line of
the code of the program.
• The developers perform the White-box
testing and then send the application or the
software to the testing team, where they will
perform the black box testing and verify the
application along with the requirements and
identify the bugs and sends it to the
developer.
• The developer fixes the bugs and does one
round of white box testing and sends it to the
testing team.
• Here, fixing the bugs implies that the bug is
deleted, and the particular feature is working
fine on the application.
• Types of White Box Testing:
• 1. Path Testing
• Path Testing is a white-box testing approach
based on a program’s control structure. A
control flow graph is created using the
structure, and the different pathways in the
graph are tested as part of the process.
• Because this testing is dependent on the
program’s control structure, it involves a
thorough understanding of the program’s
structure.
• 2. Loop Testing
• Loops are one of the fundamental concepts
that are implemented in a large number of
algorithms.
• Loop Testing is concerned with determining
the loop validity of these algorithms.
• The goal of this testing is to uncover any
vulnerabilities that may exist in any particular
loop.
• One example of a vulnerability that can be
found in loop testing is wrong indexes in
loops.
• When the indexes in an iterative loop are not
correctly programmed, it could result in more
bytes being copied than needed.
• 3. Conditional Testing
• In this type of testing, the logical conditions
for every value are checked, whether it is true
or false.
• This means that both the if and else
conditions are verified, in the case of an IF-
ELSE conditional statement.
• 4. Unit Testing
• A unit test is a method of testing a unit, which
is the smallest piece of code in a system that
can be logically separated.
• Unit testing ensures that each component
performs as intended
• 5. Mutation (changes/transformation)
• Testing
• Mutation testing is a type of testing based on
alterations or mutations. Minute
modifications are made to the source code to
see if the provided test cases can discover
bugs in the code. The ideal situation would be
for none of the test cases to pass. If the test
succeeds, it indicates that there is a mistake in
the code. The mutant (the modified form of
our code) is said to have survived. If the test
fails, there was no error in the code, and the
mutant was eliminated. Our objective is to
eliminate all mutations.
• 6. Integration Testing
• Integration testing is performed to check that
modules/components operate as intended
when combined, i.e. to ensure that modules
that performed fine independently do not
have difficulties when merged.
• 7. Penetration Testing
• White box penetration testing, also known as
crystal or oblique (slanting/slope)box pen
testing, provides the tester with complete
network and system data, including network
maps and passwords. This saves time and
lowers the overall cost of an engagement. In
software testing, we use the engagement
model. An engagement model is a strategy
that defines the basis of collaboration
between the software development company
and the client. The focus of an engagement
model is on the demands, needs, and
interests of the client. It also assures
flexibility, responsibility, and a level of
control. A white box penetration test may be
used to simulate a specific attack on a given
system by employing as many attack paths as
feasible.
• 8. Testing based on Memory Perspective
• The size of the code could increase due to the
following factors:
• There is no code reuse: Consider the following
scenario: We have four different blocks of
code written for the development of
software, and the first 10 lines of each code
block are identical. Now, these 10 lines could
be written as a function and can be made
available to the four code blocks listed above.
Furthermore, if a defect exists, we may alter a
line of code in the function rather than the
entire code.
• If one programmer produces code with a file
size of up to 250kb, another programmer may
develop equivalent code with different logic
with a file size of up to 100kb.
• 9. Test Performance of the Program
• An application might be slow due to several
factors and a developer or tester can't go
through each line of code to detect a bug and
verify it. Tools like Rational Quantify are used
to come over this issue. There are some other
tools as well available in the industry for the
same purpose, such as WebLOAD, LoadNinja,
LoadView, and Stres Stimulus.
• Difference Between BBT and WBT
S.n On the basis Black Box testing White Box testing
o. of
1. Basic It is a software In white-box
testing technique testing, the
that examines the internal structure
functionality of of the software is
software without known to the
knowing its tester.
internal structure
or coding.
2. Also known Black Box Testing is It is also known as
as also known as structural testing,
functional testing, clear box testing,
data-driven code-based
testing, and closed- testing, and
box testing. transparent
testing.
3. Programming In black-box In white-box
knowledge testing, there is testing, there is a
less programming requirement of
knowledge is programming
required. knowledge.
4. Algorithm It is not well It is well suitable
testing suitable for and
algorithm testing. recommended for
algorithm testing.
5. Usage It is done at higher It is done at lower
levels of testing levels of testing
that are system that are unit
testing and testing and
acceptance integration
testing. testing.
6. Automation It is hard to It is easy to
automate black- automate the
box testing due to white box testing.
the dependency of
testers and
programmers on
each other.
7. Tested by It is mainly It is mainly
performed by the performed by
software testers. developers.
8. Time- It is less time- It is more time-
consuming consuming. In consuming. It
Black box testing, takes a long time
time consumption to design test
depends upon the cases due to
availability of the lengthy code.
functional
specifications.
9. Base of The base of this The base of this
testing testing is external testing is coding
expectations. which is
responsible for
internal working.
10. Exhaustive It is less exhaustive It is more
than White Box exhaustive than
testing. Black Box testing.
11. Implementa In black-box In white-box
tion testing, there is no testing, there is a
knowledge implementation requirement of
knowledge is implementation
required. knowledge.
12. Aim The main objective Its main objective
of implementing is to check the
black box testing is code quality.
to specify the
business needs or
the customer's
requirements.
13. Defect In black-box Whereas, in white
detection testing, defects are box testing, there
identified once the is a possibility of
code is ready. early detection of
defects.
14. Testing It can be It can test data
method performed by trial domain and data
and error boundaries in a
technique. better way.
15. Types Mainly, there are The types of white
three types of box testing are
black-box testing: – Path testing,
functional testing, Loop
Non-Functional testing, and Condi
testing, and Regres tion testing.
sion testing.
16. Errors It does not find the In white-box
errors related to testing, there is
the code. the detection of
hidden errors. It
also helps to
optimize the
code.
Test Case:
• The test case is defined as a group of
conditions under which a tester determines
whether a software application is working as
per the customer's requirements or not.
• A test case is a first level action and derived
from test scenarios.
• It is an in-details document that contains all
possible inputs (positive as well as negative)
and the navigation steps, which are used for
the test execution process.
•
Test case gives detailed information about
testing strategy, testing process,
preconditions, and expected output.
• Test case helps the tester in defect reporting
by linking defect
• with test case ID.
When do we write a test case?
• We will write the test case when we get the
following:
• When the customer gives the business needs
then, the developer starts developing and
says that they need 3.5 months to build this
product.
• And In the meantime, the testing team
will start writing the test cases.
• Once it is done, it will send it to the Test Lead
for the review process.
• And when the developers finish developing
the product, it is handed over to the testing
team.
• The test engineers never look at the
requirement while testing the product
document because testing is constant and
does not depends on the mood of the person
rather than the quality of the test engineer.
Why we write the test cases?
• We will write the test for the following
reasons:
• To require consistency in the test case
execution
• To make sure a better test coverage
• It depends on the process rather than on a
person
• To avoid training for every new test engineer
on the product
Types of Test cases
• Function test cases
• Integration test cases
• System test cases:
Test Case Template
Example:
The process to write test cases
The format of Standard Test Cases
Test Case ID Test Case Description Test Steps Test
Data Expected Results Actual Results pass/Fail
TU Chec 1. Go to Useri User As Pa
01 k site [Link] d = shoul Expe ss
Cust [Link] guru9 d cted
omer m 9 Login
Login 2. Enter UserId Pass into
with 3. Enter word an
valid Password = applic
pass
Data 4. Click Submit ation
99
Black Box Testing
Black box testing is a technique of software
testing which examines the functionality of
software without peering into its internal
structure or coding. The primary source of black
box testing is a specification of requirements that
is stated by the customer.
In this method, tester selects a function and gives
input value to examine its functionality, and
checks whether the function is giving expected
output or not. If the function produces correct
output, then it is passed in testing, otherwise
failed
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.
Gray Box Testing
In Black Box Testing, the internal structure
of the item being tested is unknown to the
tester and in White Box Testing the internal
structure in known. In Gray Box Testing, the
internal structure is partially known. This
involves having access to internal data
structures and algorithms for purposes of
designing the test cases, but testing at the
user, or black-box level.
Gray Box Testing is named so because the
software program, in the eyes of the tester is
like a gray/ semi-transparent box; inside
which one can partially see.
An example of Gray Box Testing would be
when the codes for two units/ modules are
studied (White Box Testing method) for
designing test cases and actual tests are
conducted using the exposed interfaces (Black
Box Testing method).
LEVELS APPLICABLE TO
Though Gray Box Testing method may be
used in other levels of testing, it is primarily
useful in Integration Testing.