Software Testing Techniques
Presented to Prof. DR. Aqil Burnee & Sir. Zain Abbas
White-Box Testing
... our goal is to ensure that all statements and conditions have been executed at least once ...
Continued..
White box testing (Glass Box Testing), requires programming skills to identify all paths through the software.
The tester chooses test case inputs to exercise paths through the code and determines the appropriate outputs.
white box testing is applicable at the unit, integration and system levels of the software testing process.
Continued..
It is typically applied to the unit. While it normally tests paths within a unit, it can also test paths between units during integration, and between subsystems during a system level test.
For example: In electrical hardware testing, every node in a circuit may be probed and measured.
Types of White Box Technique Typical white box test design techniques include:
Control flow testing Data flow testing Branch Testing
Need Of White Box Testing logic errors and incorrect assumptions are inversely proportional to a path's execution probability
we often believe that a path is not likely to be executed; in fact, reality is often counter intuitive typographical errors are random; it's likely that untested paths will contain some
Basis path testing
Basis path testing is a hybrid between path testing and branch testing: Path Testing: Testing designed to execute all or selected paths through a computer program Branch Testing: Testing designed to execute each outcome of each decision point in a computer program
Basis Path Testing:
Testing that fulfills the requirements of branch testing & also tests all of the independent paths that could be used to construct any arbitrary path through the computer program.
We can say that it is the execution of all possible blocks in a program.
To verify the execution of every statement in that program.
Basis Path Testing:
This method enables the designer to derive a logical complexity measure of a procedural design and use it as a guide for defining a basis set of execution paths. Test cases that exercise the basis set are guaranteed to execute every statement in the program at least once during testing.
Basis Path Testing:
Step for Progam Runing: prepare program depending on design document. Draw flow graph for that program. calculate cyclomatic complexity.(No of Independent paths in that program) Run program more than one time to cover each Independent path execution.
Basis Path Testing
First, we compute the cyclomatic complexity: number of simple decisions + 1 or Number of predicate nodes contained in flow graph (G) + 1 In this case, V(G) = 4
Cyclomatic Complexity A number of industry studies have indicated
that the higher V(G), the higher the probability of errors.
modules
V(G) modules in this range are more error prone
Basis Path Testing 1
Since V(G) = 4, there are four paths
2 3
4
Next, we derive the independent paths:
5
7
8
6
Path 1: 1,2,3,6,7,8 Path 2: 1,2,3,5,7,8 Path 3: 1,2,4,7,8 Path 4: 1,2,4,7,2,4,...7,8
Finally, we derive test cases to exercise these paths.
Basis Path Testing Notes you don't need a flow chart,
but the picture will help when you trace program paths count each simple logical test, compound tests count as 2 or more basis path testing should be applied to critical modules
Graph Matrices
To develop a software tool that assists in basis path testing, a data structure, called a “graph matrix”. Can be quite useful. A graph matrix is a square matrix whose size (i.e., number of rows and columns) is equal to the number of nodes on a flow graph Each row and column corresponds to an identified node, and matrix entries correspond to connections (an edge) between nodes. By adding a link weight to each matrix entry, the graph matrix can become a powerful tool for evaluating program control structure during testing
THANK YOU…!