Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

coverage on conditional statements
majblackburn
#1 Posted : Wednesday, September 28, 2011 12:36:36 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/28/2011(UTC)
Posts: 1
Location: Chicago

Was thanked: 1 time(s) in 1 post(s)
If a conditional block is controlled by an OR statement, the block is considered "covered" if there is one test that enters the loop from either condition
For example:
if (targetTime < startTime || targetTime > endTime)
{}
The block is marked "covered" if one of the two conditions is met in a test. Perhaps a "stripey" green for such blocks? I wouldn't want to rewrite code just to improve coverage marking! Of course, the block *is* executed, so it is tested, so perhaps marking just the conditional statement itself uncovered?

This is a fantastic product, it is very easy to set up & use, and a huge time-saver.
1 user thanked majblackburn for this useful post.
brianpeiris on 2/28/2013(UTC)
Remco
#2 Posted : Wednesday, September 28, 2011 6:20:25 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,000

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
In concept the marker should really be split down the middle (half green, half black). In practice this is much harder to do, as it means more granular instrumentation and a bigger performance hit on the code while it executes. I've noted this one down as something to look at, though I'm not sure whether much can be done on it (particularly in the short term).

Thanks for posting, and I'm glad you like the tool :)

Cheers,

Remco
brianpeiris
#3 Posted : Thursday, February 28, 2013 3:22:28 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/26/2012(UTC)
Posts: 3
Location: Toronto, Canada

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
I think showing partial coverage on complex conditions is crucial to any code coverage tool. How can I trust NCrunch if it tells me that a condition is 100% covered when in fact is it not?
1 user thanked brianpeiris for this useful post.
Remco on 2/28/2013(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download