I have installed on my computer C++Test only with UnitTest license (only Unit Test license) as a Visual Studio 2005 plugin ( cpptest_7.2.11.35_win32_vs2005_plugin.exe ).
I have a sample similar to the following:
bool MyFunction(... parameters... )
{
bool bRet = true;
// do something
if( some_condition )
{
// do something
bRet = CallToAFunctionThatCanReturnBothTrueAndFalse....
}
else
{
bRet = false;
// do something
}
if(bRet == false)
{
// do something
}
return bRet;
}
In my case after running the coverage tool I have the following results (for a function similar to the previously mentioned):
[LC=100 BC=100 PC=75 DC=100 SCC=100 MCDC=50 (%)]
I really don’t understand why I don’t have 100% coverage when it comes to PathCoverage (PC).
Also if someone who has experience with C++Test Parasoft could explain the low MCDC coverage for me that would be great.
What should I do to increase coverage? as I’m out of ideas in this case.
Directions to (some parts of) the documentation are welcome.
Thank you,
Iulian
This is a good reference on the various types of code coverage: http://www.bullseye.com/coverage.html.
MCDC: To improve MCDC coverage you’ll need to look at
some_condition. Assuming it’s a complex boolean expression, you’ll need to look at whether you’re exercising the necessary combinations of values. Specifically, each boolean sub-expression needs to be exercised true and false.Path: One of the things mentioned in the link above as being a disadvantage of path coverage is that many paths are impossible to exercise. That may be the case with your example.