WhiteBox Testing
WhiteBox Testing
Core QA Team
12th March 2008
Agenda
2
©Copyright Kenexa® 2004
What is White-Box Testing
• White box testing is a security testing method that can be used to validate
whether code implementation follows intended design, to validate
implemented security functionality, and to uncover exploitable
vulnerabilities.
• White-box testing is testing that takes into account the internal mechanism
of a system or component (IEEE, 1990). White-box testing is also known as
structural testing, clear box testing, and glass box testing.
• The connotations of “clear box” and “glass box” appropriately indicate that
you have full visibility of the internal workings of the software product,
specifically, the logic and the structure of the code.
3
©Copyright Kenexa® 2004
Why we do White Testing
To Ensure:
4
©Copyright Kenexa® 2004
Need of White-Box Testing
• Logical error tend to creep into our work when we design and
implement functions, conditions or controls that are out of the
program
• The design errors due to difference between logical flow of the
program and the actual implementation
• Typographical errors and syntax checking
5
©Copyright Kenexa® 2004
Skills required
6
©Copyright Kenexa® 2004
Roles and Responsibilities of a White-Box Tester
- Execute loops at their boundaries and within their operational bounds; and
7
©Copyright Kenexa® 2004
Where White-Box Testing is used
• There are six basic types of testing: unit, integration, function/system,
acceptance, regression, and beta. White-box testing is used for three of these
six types:
Unit testing: which is testing of individual hardware or software units or
groups of related units . A unit is a software component that cannot be
subdivided into other components . Software engineers write white-box test
cases to examine whether the unit is coded correctly. Approximately 65% of all
bugs can be caught in unit testing.
Integration testing: which is testing in which software components,
hardware components, or both are combined and tested to evaluate the
interaction between them. Test cases are written which explicitly examine the
interfaces between the various units. These test cases can be black box test
cases, whereby the tester understands that a test case requires multiple
program units to interact. Alternatively, white-box test cases are written which
explicitly exercise the interfaces that are known to the Tester.
8
©Copyright Kenexa® 2004
Where White-Box Testing is used
9
©Copyright Kenexa® 2004
The White-Box testing process includes
10
©Copyright Kenexa® 2004
Loop Testing
This is White-Box Testing technique and there are 4 different types of Loop Testing
1. Simple Loops
2. Concatenated Loops
3. Nested Loops
4. Unstructured Loops
11
©Copyright Kenexa® 2004
Basic Path Testing
12
©Copyright Kenexa® 2004
Basic Path Testing - Flow Graph Notation
13
©Copyright Kenexa® 2004
Basic Path Testing - Flow Graph Notation
On a flow graph:
14
©Copyright Kenexa® 2004
Basic Path Testing - Flow Graph Notation
15
©Copyright Kenexa® 2004
Basic Path Testing - Cyclomatic Complexity
16
©Copyright Kenexa® 2004
Basic Path Testing - Cyclomatic Complexity
17
©Copyright Kenexa® 2004
Basic Path Testing - Cyclomatic Complexity
Example has:
18
©Copyright Kenexa® 2004
Basic Path Testing – Deriving Test cases
20
©Copyright Kenexa® 2004
Black Box Testing Vs White Box Testing-Test case
design
21
©Copyright Kenexa® 2004
References
http://www.stctek.com/faqs.htm
http://www.geekinterview.com/question_details/35815
http://www.testinggeek.com/whitebox.asp
http://www.cs.rit.edu/~afb/20012/cs4/slides/stl-04.html
22
©Copyright Kenexa® 2004
23
©Copyright Kenexa® 2004
www.kenexa.com