White-Box PDF

Title White-Box
Author Mukesh Regmi
Course Software Engineering
Institution London Metropolitan University
Pages 10
File Size 547.3 KB
File Type PDF
Total Downloads 2
Total Views 139

Summary

Download White-Box PDF


Description

Testing is the process of executing a program with the intent of finding errors.

White Box Testing [ Glass Box Testing ] 

White box testing guarantees the traversal of all independent paths at least once. It tests internal structure



White-box or Structural testing test the code at micro level but does not guarantee absence of feature. One needs to have detail knowledge of internal program structure to perform white-box testing and hence it is called Structural testing.



Structural testing objective is to test statements (are all statements executed at least once?) , logical paths ( are all paths traversed?), conditions ( are T/F branches executed at least once?); execute all loops at their boundaries, exercise internal data structures to confirm their validity.



In white-box testing, different coverage measures are used:



-

Statement Coverage: Each statement is covered in testing

-

Branch Coverage: Each branch is covered ( if-then-else)

-

Path Coverage: Different independent paths in the program module are chosen and tested.

-

Loop Coverage: All loops at their operational boundaries are executed.

There are different types of white box testing approaches. Some of them are: i)

ii)

Control Structure Testing 

Condition Testing: All logical conditions contained in a program module are exercised



Loop Testing: It focuses on the validity of different types of loops for e.g. simple, concatenated, nested and unstructured loops



Data Flow Testing

Basic Path Testing: All independent paths within module are executed in searching for errors; if any. For this, flow graph of module is prepared; Cyclomatic Complexity is computed ;then independent paths are identified and executed. Test cases are derived and Graph Matrices are prepared.

Basic Path Testing:

In basic Path testing, we have to compute cyclomatic complexity of a program. 1. Draw a flow chart of the program unit 2. Abstract the flow chart to a flow graph DD-graph 3. Find the cyclomatic complexity (say n) 4. Identify idependent paths 5. Identify n test cases that will force execution of each path in the basis set Control Flow Graph or Flow Graph The control flow of a program can be analyzed using a graphical diagram called flow graph. In flow graph, node represents statement and edge represents flow of control. Control Flow graph describes the control flows through the program.

Control Flow Graph

Decision to Decision(DD) Path Graph It concentrates on only decision nodes. Sequence of activities are combined in a single node.

Independent Path Independent paths are obtained within DD path graph. All independent paths within DD path graph are executed at least once to ensure following  

Every statement in the program has been executed at least once Every branch has been exercised for true and false condition.

Cyclomatic Complexity   

First Method: V(G)= e-n+2*P where e=edges; n=nodes, P=Connected Components Second Method: V(G)=Predicate Node + 1; Predicate Node= Decision Node Third Method: V(G)= Number of Regions...


Similar Free PDFs