Feature Suggestions

coverage on conditional statements

Started by majblackburn on 7,320 views

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.
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
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?

Post a reply

Log in to reply.