Structural WhiteBox Testing Software Testing Module Dr Samer
Structural (White-Box) Testing Software Testing Module Dr. Samer Hanna
Outline • • Path Testing Control Flow Graph DD-Path Fraph Questions
Path testing • Structural testing method • Based on the source code / pseudocode of the program or the system, and NOT on its specification
Example: Find the Control Flow Graph (CFG) for the Triangle Problem
CFG
CFG
DD – Path Graph • A CFG can be broken into DD-paths • The resulting graph is called a DD-path graph of the program
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
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
CFG to DD-Path
Independent (basis) paths Independent path is a path through a DD-path graph of the program which cannot be reproduced from other paths by – Addition (i. e. one path following another) – Repetition (e. g. loop)
Independent )basis) paths
Independent (basis) paths
- Slides: 14