| Path Coverage | | Print | |
|
This metric reports whether each of the possible paths in each function have been followed. A path is a unique sequence of branches from the function entry to the exit. Also known as predicate coverage. Predicate coverage views paths as possible combinations of logical conditions. Since loops introduce an unbounded number of paths, this metric considers only a limited number of looping possibilities. A large number of variations of this metric exist to cope with loops. Boundary-interior path testing considers two possibilities for loops: zero repetitions and more than zero repetitions. For do-while loops, the two possibilities are one iteration and more than one iteration. Path coverage has the advantage of requiring very thorough testing. Path coverage has two severe disadvantages. The first is that the number of paths is exponential to the number of branches. For example, a function containing 10 if-statements has 1024 paths to test. Adding just one more if-statement doubles the count to 2048. The second disadvantage is that many paths are impossible to exercise due to relationships of data. For example, consider the following C/C++ code fragment: if (success) statement1; statement2; if (success) statement3; Path coverage considers this fragment to contain 4 paths. In fact, only two are feasible: success=false and success=true. Researchers have invented many variations of path coverage to deal with the large number of paths. For example, n-length sub-path coverage reports whether you exercised each path of length n branches.
Set as favorite
Bookmark
Email this
Hits: 1887 Comments (0)
![]() Write comment
|
| Related Articles: |
|---|
|
Software Testing
- Introduction to Software Testing
- Automated Software Testing
- Different Types Of Software Testing
- Software Testing Levels
- Software Testing Tools
- Software Performance Testing
- Web Testing Techniques
- Software Security Assurance
- Software Testing Certification
- Testing Check Lists
- Software QA Testing Career
- SOA and Web Services Testing
Path Coverage