A path represents the flow of execution from the start of a method to its exit. A method with N decisions has 2^N possible paths, and if the method contains a loop, it may have an infinite number of paths. Fortunately, you can use a metric called cyclomatic complexity to reduce the number of paths you need to test.
The cyclomatic complexity of a method is calculated as one plus the number of unique decisions in the method. Cyclomatic complexity helps you define the number of linearly independent paths, called the basis set, through a method. The definition of linear independence is beyond the scope of this article, but in summary, the basis set is the smallest set of paths that can be combined to create every other possible path through a method.
Like branch coverage, testing the basis set of paths ensures that you test every decision outcome, but unlike branch coverage, basis path coverage ensures that you test all decision outcomes independently of one another. In other words, each new basis path "flips" exactly one previously executed decision, leaving all other executed branches unchanged. This is the crucial factor that makes basis path coverage more robust than branch coverage and allows you to see how changing that one decision affects the method`s behavior.
Source:
http://www.onestoptesting.com/code-coverage/path-coverage.asp
The cyclomatic complexity of a method is calculated as one plus the number of unique decisions in the method. Cyclomatic complexity helps you define the number of linearly independent paths, called the basis set, through a method. The definition of linear independence is beyond the scope of this article, but in summary, the basis set is the smallest set of paths that can be combined to create every other possible path through a method.
Like branch coverage, testing the basis set of paths ensures that you test every decision outcome, but unlike branch coverage, basis path coverage ensures that you test all decision outcomes independently of one another. In other words, each new basis path "flips" exactly one previously executed decision, leaving all other executed branches unchanged. This is the crucial factor that makes basis path coverage more robust than branch coverage and allows you to see how changing that one decision affects the method`s behavior.
Source:
http://www.onestoptesting.com/code-coverage/path-coverage.asp
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Testing community to read.
Most Popular News
-
How to Test Web Applications against SQL Injection Attacks
Published about 30-01-2009 | Rated +2 -
Top 20 practical software testing tips
Published about 02-02-2009 | Rated +2 -
India to lead in software testing
Published about 01-02-2009 | Rated +2 -
Software installation / uninstallation testing
Published about 16-02-2009 | Rated 0
Most Recent User Submitted News
- Black boxTesting: Functional Testing
Published about 23-06-2009 | Rated 0 - Exploratory Testing
Submitted by Milind | Rated 0 - Mozilla firefox 3.0 release is available for testing now
Submitted by Ravi | Rated 0 - Automation puts the `A` in Agile Testing
Published about 06-03-2009 | Rated 0







