1 / 12

PATH TESTING

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

tarak
Télécharger la présentation

PATH TESTING

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PATH TESTING An Example for White-Box Testing

  2. 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

  3. 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>

  4. x > 20 x < y The Flow Diagram READ x and y TRUE FALSE “abs ( x - y )” “x smaller or equal 20” TRUE FALSE “x smaller y” “x greater or equal y”

  5. x < y Path 1 READ x and y TRUE FALSE x > 20 “abs ( x - y )” “x smaller or equal 20” TRUE FALSE “x smaller y” “x greater or equal y”

  6. Path 2: READ x and y TRUE FALSE x > 20 “abs ( x - y )” “x smaller or equal 20” TRUE FALSE x < y “x smaller y” “x greater or equal y”

  7. Path 3: READ x and y TRUE FALSE x > 20 “abs ( x - y )” “x smaller or equal 20” TRUE FALSE x < y “x smaller y” “x greater or equal y”

  8. 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” • ...

  9. 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 ” • ...

  10. 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 ” • ...

  11. 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>

  12. End of Section 4f

More Related