Daily Usage Issues

How to Easily and Quickly Identify Uncovered Methods

Started by CoolBreeze on 5,475 views

I want to be able to quickly identify which modules have been executed by my tests and which modules have not been executed by my tests.

For example: One of my code files has these modules:

IdNew
Read
ReadById
ReadCounts
ReadInfo
Validate

I've written tests for: IdNew, Read, and ReadCounts.

I ran my tests and look at the Metrics.

I see 100% coverage for my tests. OK so all of my tests ran.

I look at the metrics for the main code file. I see 50% coverage of the code lines.

But what methods didn't get executed by the tests?

At this point in my work process I want to easily see all methods in my main code file which didn't execute due to running the tests by doing something like clicking on a + sign next to the main code file name in Metrics. I'd like to see it expand to show which modules executed and which ones didn't execute (I'm not sure if that's the best UI design at the moment but wanted to give an idea of what I was looking for). Since I can't see that info I do this:

I open the main code file and I look through the green and black markers (which takes time). I mentally note which methods were called and which ones were not called.

I go back to my test code file and start writing tests for the uncalled methods.

I repeat the test run and examine the code file again.


Ed
Hi Ed,

Thanks for posting!

Right now, it's only possible to assess metrics at file-level using NCrunch. It won't go as far down as method level.

The reason for this is that for NCrunch to be able to correlate code coverage with methods, it needs to extract additional information from the build and/or test processes. This naturally results in more processing, poorer performance, etc.

If you'd like to see this as a feature, you're welcome to vote for it on uservoice. If enough people wish to see it, it may be worth the hit in performance, or perhaps a new config option.


Cheers,

Remco

Post a reply

Log in to reply.