PATH TESTING

1 / 12

PATH TESTING - PowerPoint PPT Presentation

PATH TESTING. An Example for White-Box Testing. Path testing. a form of white box testing steps to complete: derive the module’s flow diagram describe all possible paths through the diagram (conditions, loops) derive path predicates derive test-cases & results per path. PROGRAM example_1

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

PowerPoint Slideshow about 'PATH TESTING' - tarak

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

PATH TESTING

An Example for White-Box Testing

Path testing
• a form of white box testing
• steps to complete:
• derive the module’s flow diagram
• describe all possible paths through the diagram (conditions, loops)
• derive path predicates
• derive test-cases & results per path
PROGRAM example_1

VAR x , y : NUMBER

BEGIN <program>

READ ( x , y );

IF ( x > 20)

THEN BEGIN <nested if>

WRITE abs ( x - y );

IF ( x < y )

THEN WRITE ( “ x smaller y ”)

ELSE WRITE ( “ x greater or equal y ” )

END <nested if>

ELSE WRITE ( “ x smaller or equal 20 ” )

END <program>

x > 20

x < y

The Flow Diagram

TRUE

FALSE

“abs ( x - y )”

“x smaller or equal 20”

TRUE

FALSE

“x smaller y”

“x greater or equal y”

x < y

Path 1

TRUE

FALSE

x > 20

“abs ( x - y )”

“x smaller or equal 20”

TRUE

FALSE

“x smaller y”

“x greater or equal y”

Path 2:

TRUE

FALSE

x > 20

“abs ( x - y )”

“x smaller or equal 20”

TRUE

FALSE

x < y

“x smaller y”

“x greater or equal y”

Path 3:

TRUE

FALSE

x > 20

“abs ( x - y )”

“x smaller or equal 20”

TRUE

FALSE

x < y

“x smaller y”

“x greater or equal y”

Path 1
• predicate: X < 20 Y no constraints
• test-cases: (1) X : 20 Y : 33

(2) X : 4 Y : 1

...

• results: (1) “x smaller or equal 20”
• (2) “x smaller or equal 20”
• ...
Path 2
• predicate: X > 20 X < Y
• test-cases: (1) X : 21 Y : 22

(2) X : 103 Y : 203

...

• results: (1) 1 ; “ x smaller y ”
• (2) 100 ; “ x smaller y ”
• ...
Path 3
• predicate: X > 20 X > Y
• test-cases: (1) X : 21 Y : 21

(2) X : 103 Y : 102

...

• results: (1) 0 ; “ x greater or equal y ”
• (2) 1 ; “ x greater or equal y ”
• ...
PROGRAM example_2

VAR x , y : NUMBER

BEGIN <program>

READ ( x , y );

IF ( x > 20)

THEN WRITE abs ( x - y )

ELSE WRITE ( “ x smaller or equal 20 “ );

IF ( x < y )

THEN WRITE ( “ x smaller y ”)

ELSE WRITE ( “ x greater or equal y “)

END <program>