Geeks With Blogs
// ThomasWeller C#/.NET software development, software integrity, life as a freelancer, and all the rest

These days, JetBrains (the manufacturer of ReSharper (R#)) released the beta version of a new code coverage tool – dotCover. Because I’m a big fan of the R# add-in, I was particularly curious about having a first look at the newest JetBrains child. Notably, I wanted to see how it would take advantage of its deep R#/VS integration to make code coverage an integral part of a developer’s working experience. Here are my first impressions about it…

Note: Because I’m using NCover for Code coverage analysis at the moment, I cannot help comparing these two tools, although this might not be totally appropriate: dotCover is designed to deeply integrate with R# and Visual Studio, whereas NCover is a stand-alone application. Also, NCover is a mature and feature-rich application, whereas dotCover is in its early infancy…

Some useful related resources (links to website, documentation material and some videos) can be found in my toolbox on Delicious:

 About Code Coverage

Much has been written about Code Coverage and about what it can do and what not – see for example here and here. The bottom line is: The single useful aspect of Code Coverage is that it shows you which parts of your production code are NOT covered by any tests, and thus gives you a basis to decide upon those areas: You simply may have overlooked it, or you may have made the explicit decision to not test it.

And this is exactly what I’m interested in when writing tests - be it after the fact (i.e. covering a pre-existing codebase with tests) or be it when authoring new code in a TDD process: I want to quickly see which parts of the production code are covered with tests, and I want to be able to quickly jump to and inspect code which is not. In short: It’s productivity what I’m looking for in the first place. In-depth information - like it is provided by NCover - is part of a broader picture that becomes important when deeply analyzing an entire codebase or monitoring historical trend data. But for now, let’s exclusively focus on the coding process itself…

Running tests with coverage

DotCover will add a new item to the familiar R# menu, which allows you to run tests with coverage just like you would run ‘normal’ tests from R#:










DotCover also adds a new tab to the R# Unit Test Sessions tool window, showing the results of the current coverage run:


 From there, you can directly navigate to the code under test via double click, which will be highlighted in red and green according to the measured test coverage:









Navigating from production code to test code

It is also possible to browse your test code <-> production code connections from the other direction. After a coverage run, dotCover will show you which tests are operating on a selected code line when right-clicking it and choosing Show Covering Tests form the context menu:






This will open up a popup window like the one below, giving you a list of relevant tests:




The dotCover tool makes code coverage analysis as simple and fast as it was never before. It doesn’t provide all the sophisticated features that NCover has (e.g. branch coverage or trend analysis, to name just two…), but instead it integrates deeply with your coding process and lets you browse and navigate between test code and production code inside VS with only one or two mouse clicks while highlighting the covered/uncovered code areas. Unlike NCover, there’s no need to switch between different applications and to figure out complicated sets of options and/or command lines. Especially when used with a consequent TDD process (like the one I described here in some detail), dotCover is a great help in writing tests and can strongly boost a developer’s productivity.

That’s the pro side of the coin. The contra for now is, that there is not yet any automation support – meaning that it’s not yet possible to use dotCover coverage reports from a Continuous Integration process. This is where NCover is quite ahead at the moment: It allows you to generate nice and detailed coverage reports and data from the command line or via MSBuild/NAnt tasks and thus can seamlessly be integrated with a CI tool like e.g. CruiseControl.NET.


DotCover does a great job on the development side of things, because it integrates perfectly with R# and VS. From a developer’s point of view, code coverage never was easier. This part of the picture is really impressing IMHO. (And as a side note: Although the current version is in a quite early beta state, I found it to be impressingly stable…)

However, there is not yet any automation support (a command-line interface and probably some MSBuild and NAnt tasks), so dotCover cannot be integrated with any Continuous Integration tool at the moment, which (at least for me) means that it’s not yet ready for production regarding the current feature set. But as said before, dotCover is in an early beta, and these features are announced for the final 1.0 version. Like the JetBrains people put it:

dotCover is still in its infancy and we’ve got a lot planned in terms of features and functionality. Quite a few people have asked whether it will support running coverage reports from a console, which is important for continuous integration. dotCover will support running from a console with some basic functionality, and we have plans to include specific features for CI processes.

So let’s just look forward to the things to come…


delicious facebook digg reddit linkedin stumbleupon technorati mrwong yahoo google-48x48 twitter email favorites


Posted on Friday, July 16, 2010 11:34 AM Unit Testing/TDD , Automation , Code Coverage | Back to top

Comments on this post: dotCover - a new kid on the (development) block

# re: dotCover - a new kid on the (development) block
Requesting Gravatar...
Hi Thomas,

Thanks for the review. Just a minor note. You can in fact right now use dotCover with Continuous Integration. We ship a console runner that allows you run coverage reports from the command line. We'll be providing more features in the future, but as of right now, you can run from a CI scenario.

Please look in the Program Folder for the console runner.
Left by Hadi Hariri on Jul 16, 2010 2:21 PM

# re: dotCover - a new kid on the (development) block
Requesting Gravatar...
Thanks for the comparison! JetBrains has the potential to steal a lot business from NCover if they add all the missing features you mention. The price of dotCover is very appealing, but the lack of branch coverage and trend analysis is not. For now, it looks like we'll be staying with NCover.
Left by Owen Funkhouser on Sep 17, 2010 12:13 AM

# re: dotCover - a new kid on the (development) block
Requesting Gravatar...
Hi Owen,
thanks for the kind words.
Speaking in terms of features, NCover is (and most likely always will be) the 'bigger' coverage tool. The great thing about dotCover - at least for me - is that it integrates seamlessly with R# and VS and makes code coverage analyis an integral part of everyday TDD development work.

- Thomas
Left by Thomas Weller on Sep 17, 2010 5:15 AM

# Microsoft Sharepoint development
Requesting Gravatar...
Thanks for the comparison! JetBrains has the prospective to grab a lot enterprise from NCover if they add all the losing functions you discuss. The cost of dotCover is very attractive, but the not enough division protection and pattern research is not. For now, it looks like we'll be remaining with NCover.
Left by Katherine Sanders on Feb 07, 2012 1:25 PM

# re: dotCover - a new kid on the (development) block
Requesting Gravatar...
Kind of funny, but I'm looking into dotCover right now because NCover 4 is so difficult to add to my CI server while dotCover seems to have made it very simple.
Left by Brad C on Dec 20, 2012 11:38 PM

Your comment:
 (will show your gravatar)

Copyright © Thomas Weller | Powered by: