0% found this document useful (0 votes)
5 views13 pages

SE Week 14

Uploaded by

turabihaider020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views13 pages

SE Week 14

Uploaded by

turabihaider020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Software Engineering

Week 14
White-box testing
 White-box testing (also known as clear box testing, glass
box testing, transparent box testing, and structural testing)
is a method of testing software that tests internal
structures or workings of an application, as opposed to its
functionality (i.e. black-box testing).
 In white-box testing an internal perspective of the system,
as well as programming skills, are used to design test
cases.
 The tester chooses inputs to exercise paths through the
code and determine the expected outputs.

2
White-Box
Testing

... our goal is to ensure that all


statements and conditions have
been executed at least once ...
Advantages of White Box
Testing:
 Forces test developer to reason
carefully about implementation.
 Reveals errors in "hidden" code.

 Spots the Dead Code or other issues

with respect to best programming


practices.

4
Disadvantages of White Box
Testing:
 Expensive as one has to spend both time and
money to perform white box testing.
 Every possibility that few lines of code are
missed accidentally.
 In-depth knowledge about the programming
language is necessary to perform white box
testing.

5
White Box Testing
Techniques:
 Statement Coverage - This technique is
aimed at exercising all programming
statements with minimal tests.
 Branch Coverage - This technique is
running a series of tests to ensure that all
branches are tested at least once.
 Path Coverage - This technique corresponds
to testing all possible paths which means that
each statement and branch is covered.
6
Testing strategies
 Unit testing.
 White-box testing is done during unit testing to
ensure that the code is working as intended;
before any integration happens with previously
tested code. White-box testing during unit testing
catches any defects early on and aids in any
defects that happen later on after the code is
integrated with the rest of the application and
therefore prevents any type of errors later on.

7
Integration testing
 . White-box testing at this level is written to
test the interactions of interfaces with each
other. The unit level testing made sure that
each code was tested and working
accordingly in an isolated environment and
integration examines the correctness of the
behaviour in an open environment through
the use of white-box testing for any
interactions of interfaces that are known to
the programmer.

8
Regression testing
 White-box testing during regression testing
is the use of recycled white-box test cases
at the unit and integration testing levels.

9
What is Basis Path
Testing?
The basis path testing is same, but it is
based on a White Box Testing method, that
defines test cases based on the flows or
logical path that can be taken through the
program.
 Basis path testing involves execution of all
possible blocks in a program and achieves
maximum path coverage with least number
of test cases. It is a hybrid of branch testing
and path testing methods.
10
 The objective behind basis path testing is
that it defines the number of independent
paths, thus the number of test cases
needed can be defined explicitly
(maximizes the coverage of each test
case).

11
Example: Flow Graph

12
Contd..
 In the above example, we can see there are
few conditional statements that is executed
depending on what condition it suffice. Here
there are 3 path or condition that need to be
tested to get the output,
 Path 1: 1,2,3,5,6, 7
 Path 2: 1,2,4,5,6, 7
 Path 3: 1, 6, 7

13

You might also like