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

Notification

Icon
Error

Visualise coverage per test
AndyLowry
#1 Posted : Tuesday, December 4, 2012 2:11:14 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/4/2012(UTC)
Posts: 9
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Having the code coverage markers in the code editor is a fantastic tool. One thing I've found myself doing is looking for "holes" in the coverage to determine if there are any missing tests. (Unfortunately I have to work with a lot of legacy code)

Quite often though I'm trying to work out the opposite, wanting to make sure at least 1 test doesn't take a particular path. I've been doing this by looking at the number of covering tests, and making sure that, for example, the number of covering tests in the body of an if is less than the number executing the condition.

It would be nice if this was easier to visualise.

One way I was thinking this could happen (and I suspect there are many other ways) is the we could quickly switch to a mode where the coverage icons have a column for each test, instead of a single comlumn for all tests.

So (with * filling in for the coverage indicator):

* if (IsConditionTrue())
* {
* DoSomeWork();
* }

would become something like this:

**** if (IsConditionTrue())
**** {
* ** DoSomeWork();
**** }

with the second column having a black indicator showing that that line is not covered by that particular test.

This is not a fully formed idea, theres a lot of options, I don't think you'd want this enabled most of the time, so being able to switch it on and off quickly in the editor would be important. Or possibly having it in a tooltip on each indicator. There are also questions about if it would work when there are very large number of tests.


Andy
Remco
#2 Posted : Tuesday, December 4, 2012 7:13:49 PM(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)
Hi Andy -

Thanks for the suggestion!

Out of interest, have you tried making use of the 'Show code coverage for this test only' option under the 'Advanced' context menu when you right click on a test? Generally when I'm following a similar use case, this is what I use myself. Does it solve the same problem for you?


Cheers,

Remco
AndyLowry
#3 Posted : Thursday, January 3, 2013 5:43:11 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/4/2012(UTC)
Posts: 9
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Hi Remco,

It does allow me to do what I want but I still have to go through all the tests one at a time. I would be easier if I could just scan the coverage indicators.

Thanks

Andy
Remco
#4 Posted : Thursday, January 3, 2013 10:38:35 PM(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)
Thanks for the feedback. Given that lines can be covered by potentially huge numbers of tests (i.e. 1000s), I'm not sure if I can cleanly implement such a feature, but I'll have a think about your use case and will see what I can come up with!
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.036 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download