structural (white-box) testing
DESCRIPTION
Structural (White-Box) Testing. Software Testing Module Dr. Samer Hanna. Outline. Path Testing Control Flow Graph DD-Path Graph Questions. Path testing. Structural testing method Based on the source code / Pseudocode of the program or the system, and NOT on its specification. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/1.jpg)
Structural (White-Box) Structural (White-Box) TestingTesting
Software Testing Module
Dr. Samer Hanna
![Page 2: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/2.jpg)
Outline
• Path Testing
• Control Flow Graph
• DD-Path Graph
• Questions
![Page 3: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/3.jpg)
Path testing
• Structural testing method
• Based on the source code / Pseudocode of the program or the system, and NOT on its specification
![Page 4: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/4.jpg)
Example: Find the Control Flow Graph (CFG) for the Triangle Problem
![Page 5: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/5.jpg)
CFG
![Page 6: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/6.jpg)
CFG
![Page 7: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/7.jpg)
DD – Path Graph
• A CFG can be broken into DD-paths
• The resulting graph is called a DD-path graph of the program
![Page 8: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/8.jpg)
DD – Path Graph
DD: Decision – to – Decision path• A DD-path is a sub-path in a program graph fulfilling
one of the conditions below:1. It consists of a single node with indeg = 0
2. It consists of a single node with outdeg = 0
3. It consists of a single node with indeg ≥ 2 or outdeg ≥ 2
4. It consists of a single node with indeg = 1 and outdeg = 1
5. It is a maximal chain of length ≥ 1
![Page 9: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/9.jpg)
DD – Path Graph
Node DD-Path Name
Case of Definition
1 Source 1
2 - 4 A 5
5 B 3
6 C 4
7 D 4
8 E 3
… … …
19 Sink 2
![Page 10: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/10.jpg)
CFG to DD-Path
![Page 11: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/11.jpg)
Independent (basis) paths
Independent path is a path through a DD-path graph of the program which cannot be reproduced from other paths
![Page 12: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/12.jpg)
Independent (basis) paths
![Page 13: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/13.jpg)
Independent (basis) paths
![Page 14: Structural (White-Box) Testing](https://reader035.vdocuments.site/reader035/viewer/2022062217/56813bae550346895da4e3fb/html5/thumbnails/14.jpg)