Thanks:  0
Likes:  0
Dislikes:  0

# Thread: How to capture nonlinear paths at an app level ?

1. ## How to capture nonlinear paths at an app level ?

I am familiar with the tools and techniques to derive nonlinear paths (Cyclomatic Complexity) at a method level of a given class.

This does help me to achieve good amount of code coverage at a method level.

But it's becoming tough to identify those paths at an application level. I do understand there is lot of complexity associated here.

But it's going to be real value addition to identify those paths, derive required test data for that path &amp; validate the same.

Can you share your in line experiences ?

2. ## Re: How to capture nonlinear paths at an app level ?

You would need to map the app level stuff to the code/path.

3. ## Re: How to capture nonlinear paths at an app level ?

Venkat,

As has been stated many times on this board, code coverage is in no way equivalent to test coverage, and IMHO if you are hoping to use code coverage analysis as a method of determine whether or not you have adequately tested a program I believe you are making a bad mistake. Even if you get a complete set of paths through the program you have still not dealt with how the program deals with different data. Take the following simple example in C

double Divide(double a, double b)
{
return a/b;
}

There is only one path through this function so code coverage a cyclomatic complexity are trivial. However, you need more than one test case to test it (what if b is zero?).

Code coverage can help you identify areas of a program that you have not tested. It does not tell you which areas of the program you have tested. Put another way, having 100% code coverage is not an indicator of 100% test coverage, less that 100% code coverage means you either have some redundant or unreachable code in your program, or you have some untested code.

Given the above, and depending on the programming language used, there are a number of tools out there that can can generate a complete set of possible call graphs (paths) for a program given the source. Both compilers and static analysis tools use call graphs to generate and check code. Profilers will also dynamically use and provide call graphs but tend to prune out of scope graphs to save memory. Try the following googlet for more info.

Regards

Shane

4. ## Re: How to capture nonlinear paths at an app level ?

Hi Venkat,

I suspect that if you are familiar with linearly independent path testing that you are also already aware of the limitations of various code coverage measures.

I recommend you look at the McCabe website and specifically their IQ tool which analyzes various levels of coveage including basis path coverage.

(McCabe hypothesized a correlation between his cyclomatic complexity formula and the number of tests for linearly independent paths. See the NIST publication (500-235) on the site for a better understanding of basis path testing.)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.