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

Notification

Icon
Error

Alternatives for coverage indicators
jonskeet
#1 Posted : Sunday, September 25, 2011 11:25:26 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/25/2011(UTC)
Posts: 13
Location: Reading, UK

Was thanked: 3 time(s) in 3 post(s)
I've just started using NCrunch, and I love it so far. However, I'm finding the coverage indicators (the blobs on the left of the screen) a little inconvenient.

In particular, this morning I clicked on a stack trace to get to the line causing a problem - and found it hard to see my cursor, because it was at the start of the line, flashing but barely visible against a black blob.

For the moment I'll turn on the "highlight the current line" option in Resharper, but I think coverage could probably be displayed more usefully. Unfortunately, as a non-UI person my ideas probably won't be very good, but a few suggestions:

- Draw lines indicating regions of coverage rather than the individual blobs. Usually there are whole regions covered or not covered at a time, so I think that makes more sense.
- Possibly change the background colour of the lines of code involved - or maybe just the first column?
- Have an option to display coverage on the right instead of the left?
- Display coverage on the right instead of the left?

Note that if there's an "invasive" mode (e.g. using highlighting of whole lines, in reasonably garish colours) a shortcut key to toggle between this and a "quieter" display mode would be useful.

Apologies for the lack of concrete good ideas, but hopefully identifying the weakness will be helpful in itself :)
Remco
#2 Posted : Sunday, September 25, 2011 11:43:44 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for the feedback :)

I think there are a few ways of making the markers less obstructive... unfortunately Visual Studio does tend to be a bit of a nightmare in this area, as in VS2010 the construction of the editor window is done using an interesting combination of WPF panes mounted inside Win32-ish windows/frames.

The original idea behind the coverage was to show covered regions of code using lines that could snake their way down through the structure of the text. I abandoned this idea after a range of edge cases made it look as though I'd need to do source-code parsing to make it work well enough.

The ideal way would be to have a mounted bar next to the line of code (in much the same way resharper shows a summary of errors using a right-hand margin). This would also give more room for other kind of indicators beyond just coverage (performance perhaps?). The downside here comes down to the development effort involved - as anything that requires close integration with Visual Studio usually ends up requiring many days (or even weeks) of research and experimentation.

I'm wondering if there may be a simpler solution that could allow you to still see the cursor while the marker is still visible. Easy solutions here could be:

1. Change the shape of the marker (i.e. make it smaller, or shaped in a way that won't hide a cursor sitting within the same character space)
2. Fade the marker out with an alpha - You'll notice NCrunch does this already when the coverage results are out of date. The alpha effect could be controlled via configuration to also apply to tests that are up to date, and the out of date tests could be represented differently. VS2008 doesn't have very good support for alphas, so the out of date tests here were instead represented with smaller sized markers - this could easily be done as an option for VS2010.

What are your thoughts? If we have enough feasible options, I could set up a poll to see which is the most popular ... or just add a configuration option to support most/all of them :)
jonskeet
#3 Posted : Sunday, September 25, 2011 11:55:16 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/25/2011(UTC)
Posts: 13
Location: Reading, UK

Was thanked: 3 time(s) in 3 post(s)
Remco;423 wrote:

1. Change the shape of the marker (i.e. make it smaller, or shaped in a way that won't hide a cursor sitting within the same character space)
2. Fade the marker out with an alpha - You'll notice NCrunch does this already when the coverage results are out of date. The alpha effect could be controlled via configuration to also apply to tests that are up to date, and the out of date tests could be represented differently. VS2008 doesn't have very good support for alphas, so the out of date tests here were instead represented with smaller sized markers - this could easily be done as an option for VS2010.


Both of these sound useful to me. If the marker were a character which took up the whole height of a line, but just the right hand side of the character, that may give the *appearance* of a region while still just being a character. Possibly not, but it's worth a try :) Anyway, it would get out of the way of the cursor. The only problem would be lines which had text in the first column, but that's pretty rare for "real" lines of code I suspect.

The "mounted bar" idea sounds good in some ways - but my experience is that you can end up with several coloured bars going alongside your code, each meaning different things and causing confusion in the long run. There's already a coloured bar to the left which I don't understand the meaning of, now I come to look at it...

Starting with Unicode U+2590 (right half block) would probably be worth at least a try to see how it looks :)
Remco
#4 Posted : Sunday, September 25, 2011 12:06:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Cool. UI isn't really my strong point either, but I think I can handle shapes :) I'll see what I can do about a config option for this in the next release. I usually kick out a build roughly every 3 weeks, so check back soon :)
stigsnor
#5 Posted : Wednesday, September 28, 2011 8:35:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/28/2011(UTC)
Posts: 2
Location: Oslo

Loving NCrunch, and recommending it to my colleagues.

I got a user story for you;)
"As a user I should be able to change the colors of the indicators"

or

"As a user I should be able to turn covered line-indicator on and off(green indicator)"


For me the green indicators do not give me any extra information, as I'm only interested in errors and not covered code.
(No indicator = covered code)

Too many indicators makes me a bit blind.
Remco
#6 Posted : Wednesday, September 28, 2011 9:19:17 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
I like your agile story telling approach :)

You can change the colour of the coverage markers in your global config settings.

Right now you can't really turn off certain parts of the indicators ... I guess you could set the green markers to be the same as your background colour in VS - this would get you quite close to not having them. Thanks for your comments though - I'll take a look at adding some options in this area.
stigsnor
#7 Posted : Wednesday, September 28, 2011 9:45:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/28/2011(UTC)
Posts: 2
Location: Oslo

Guess I didn't do my research. I am officially blind! Arghh
Remco
#8 Posted : Thursday, September 29, 2011 1:23:40 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
It's alright :) I've had to point it out to a few people .. I think it's not in an obvious place... something that I intend to fix :)
rlarno
#9 Posted : Thursday, October 6, 2011 8:36:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/27/2011(UTC)
Posts: 27
Location: Belgium

Thanks: 6 times
Was thanked: 5 time(s) in 5 post(s)
Hi,

My initial reaction to the indicators was also: if only they were a small (upstanding) rectangle.


Btw, I have absolutely no clue as how you get all this done, but regarding how to get the UI on the screen, it it somewhat like this code? http://indentguide.codep...6#IndentGuideFactory.cs
reading this would allow you to set your markers behind the text?
Remco
#10 Posted : Tuesday, October 18, 2011 6:36:48 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
The 1.35b release that went out this morning adds a new feature that allows you to change the shape of the coverage markers.

New shapes:

* A small circle
* A rectangle
* A vertical line

.. the smaller circle and vertical line should be less obstructive than the original circles were. Give it a spin and let me know how it goes :)
1 user thanked Remco for this useful post.
rlarno on 10/19/2011(UTC)
rlarno
#11 Posted : Wednesday, October 19, 2011 11:42:54 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/27/2011(UTC)
Posts: 27
Location: Belgium

Thanks: 6 times
Was thanked: 5 time(s) in 5 post(s)
Love the new Vertical Line; combined it with NoCoverage set to Orange (as black is then not as visible).
rlarno
#12 Posted : Wednesday, October 26, 2011 11:22:14 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/27/2011(UTC)
Posts: 27
Location: Belgium

Thanks: 6 times
Was thanked: 5 time(s) in 5 post(s)
Just in case you ever want to move the glyphs into the margin

Walkthrough: Creating a Margin Glyph
http://msdn.microsoft.co...us/library/ee361745.aspx
Remco
#13 Posted : Wednesday, October 26, 2011 4:43:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for the tip. This was something I looked at while the markers were in their very early stages, but it simply wasn't powerful enough to do what I needed it to do. There was also the issue that a huge range of plugins make use of their own glyphs, which would result in some interesting clashes :)
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.334 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download