New code coverage highlighting in dotCover 2016.3
After we released the initial continuous testing support in dotCover, the most popular response was “Cool, but this could be a lot more useful if highlighting was able to indicate test results.” Indeed, before 2016.3, dotCover’s highlighting was used only to indicate code coverage:
dotCover 2016.3 finally addresses the issue. First, we got rid of colored backgrounds. Now, we use a small colored marker in the left gutter. Second and most important, we’ve completely changed the highlighting logic. Now, it not only shows whether a statement is covered by tests but also indicates test results.
The new highlighting is especially useful for continuous testing. You no longer need to keep the Continuous Testing Session window open: you run tests and see results instantly, right in the code:
Each marker’s tooltip shows you details on the number of tests, their state, and coverage session. Note that as soon as you change the code in any way, test results become outdated. In this case, a marker keeps its color but it becomes lighter. The marker’s tooltip continues to show details about the previous state:
How to quickly navigate to covering tests?
Just use the Ctrl+Alt+K,T shortcut. Alternatively,
- Click on a marker to see tests. The list with covering tests will appear.
- Double click on a particular test to navigate.
How to quickly debug failed tests?
Using the same tests list that appears by click on a marker!
First, you can quickly get stack trace data for any failed test:
You can also instantly set a breakpoint for any statement that is covered by a failing test and then launch debugging:
What if there are multiple statements in a line?
If a line of code includes several statements with different coverage results, dotCover will highlight the line taking into account only the ‘worst’ result. For example, if tests pass for the first statement, but fail for the second, dotCover will highlight the line with red. If one statement is covered by some failing tests and another statement is not covered at all, the highlighting will be gray:
How to enable code coverage highlighting?
Nothing has changed in this regard. As usual, you can enable/disable the highlighting in the Unit Test Sessions window (Coverage tab) using the Highlight code button or the Ctrl+Alt+K,H shortcut.
As usual, we invite you to try this new feature on your own. Download ReSharper Ultimate 2016.3 and let us know how it works for you.
Subscribe to Blog updates
Thanks, we've got you!
Another Look into the Future with Rider’s Predictive Debugger
In the 2023.2 release cycle, we’ve introduced the Predictive Debugger in ReSharper, which gives you predictions about code paths and variables beyond the current execution pointer. We’ve written extensively about its advantages compared to alternative debugging strategies like thorough thinking, log…
Visualize Entity Framework Relationships and Additional Query Analysis in ReSharper 2023.3
A lot of teams are using Entity Framework or EF Core to work with their database. As an Object-Relational Mapper (ORM), it bridges objects in code to a relational database model, so that as a developer you don’t have to worry too much about the actual database. We all know: that’s not entirely tr…
Automatically Analyze ASP.NET Core Performance With Dynamic Program Analysis
Slow web pages may make your users or customers abandon your web application, even before they’ve had a proper look at it. You’ve likely also been frustrated working with a web application that is slow to load. The good news is that the latest versions of ReSharper and JetBrains Rider’s Dynamic P…
OSS Power-Ups: MassTransit – Webinar Recording
The recording of our webinar, OSS Power-Ups: MassTransit, with Chris Patterson, is available. This was the thirteenth episode of our OSS Power-Ups series, where we put a spotlight on open-source .NET projects. Subscribe to our community newsletter to receive notifications about future webinars.…