White Box Testing

Friday, August 01, 2008 | | 0 comments »

Testing based on an analysis of internal workings and structure of a piece of software. Also known as Structural Testing / Glass Box Testing / Clear Box Testing. Tests are based on coverage of code statements, branches, paths, conditions.

Aims to establish that the code works as designed Examines the internal structure and implementation of the program .
Target specific paths through the programNeeds accurate knowledge of the design,
implementation and code.
Test Case design techniques under White Box Testing:

Statement coverage

Branch coverage

Condition coverage

Path coverage

Data flow-based testing

Mutation testing


Design test cases so that every statement in a program is executed at least once. Unless a statement is executed, we have no way of knowing if an error exists in that statement Example:

Euclid's GCD computation algorithm:

By choosing the test set {(x=3, y=3), (x=4, y=3), (x=3, y=4)} all statements are executed at east once.

int f1(int x, int y){
while (x != y){
if (x>y) then
x=x-y;
else y=y-x;
}
return x; }


Test cases which exercise basic set will execute every statement at least once. Aim is to derive a logical complexity measure of a procedural design and use this as a guide for defining a basic set of execution paths.

Flow Graph Notation

On a flow graph:

Arrows called edges represent flow of control

Circles called nodes represent one or more actions

Areas bounded by edges and regions called regions

A predicate node is a node containing a condition

Any procedural design can be translated into a flow graph. Note that compound Boolean expressions at tests generate at least two predicate nodes and additional arcs.

29.2
RELATED POST

BLOCK BOX TESTING PART TWO

0 comments

Post a Comment