Coverage of windows services...

Coverage of windows services...

    Hi,  I got Ncover up and running this morning for the first time, and despite some fairly sparse documentation, I got things working pretty well.  Looks wonderful.  Very pretty, at least, when I run it with NCoverExplorer.

So I got it running with an ASP.NET 1.1 web service, just with...

ncover //iis

(trying to specify assembly names or anything didn't work particularly well)

Took me a bit before I found out from the forums here that to make NCover recognise that I'm finished testing I needed to stop/start IIS.  (Just doing manual testing here, no NUnit yet.)

Anyway, that all works. and works well.  What I'm having problems with is doing the same thing with a windows service.

ncover //svc "service name"

I can see the Service getting stopped and started, (from it's own logging) but it then hangs at...

Waiting for profiled application to connect...
Profiled process terminated. Profiler connection not established.

There's no coverage.log even to look for any ideas.  Anyone have any other ideas?

The windows service is .net2.0, (the asp.net app was .net 1.1)
Ncover version 1.5.4

Cheers,
Karl P


Re: Reporting Unvisited Functions ...

Unfortunately the reports in NCoverExplorer in the 1.x versions do not go down to method level, only to class level. In version 2 which is in development I have just this weekend added some method level reports which would give you exactly this feature.

So your only way of doing it currently is to write your own xsl transform, not trivial but obviously possible. I would suggest running the coverage file(s) through NCoverExplorer/Console first to save it to merge any multiple app domain loads within the coverage file (to get the consolidated visits for each module/method).


Re: Reporting Unvisited Functions ...

kiwidude,

Thanks for the reply. I happy that you have given consideration to this for future inclusion. Can I be so bold as to ask when version 2 might be released?

I will try to parse the merged output to get the function list.

Thanks,
Liam


Re: Reporting Unvisited Functions ...

Hi Liam,

It will be a combined release with NCover 2.0 - final date yet to be confirmed but "soonish..." ;-). Peter will announce it when he has it all ready to roll...


Re: Reporting Unvisited Functions ...

Hi Grant,

As a follow-on in the same vain, I am running ncoverexplorer from within a NAnt script. I am using <exclusions> to prevent inclusion in the coverage report.

I want to create a list of methods/functions that make up this exclusion list; is this possible to create now or in the future?

Thanks,
Liam


Re: Reporting Unvisited Functions ...

Liam,

As far as exclusions are concerned the reports in 2.0 currently operate the same way as they do now in that if you choose the option to display the exclusions footer it lists all the "items" that were as a result excluded (not the criteria you applied). Note that the "topmost" excluded parent gets listed - sometimes these will be the same as your criteria, sometimes not.

For instance if you exclude a "method" and the class has at least one other method that was not excluded, then listed in the exclusion footer will just be the method you expect. However if that class only had the one method you want to exclude on it then it means the class has become excluded as well - so the class will be listed in the exclusions report footer, not the method.

The one other addition to the exclusions footer in 2.0 is that I list the assembly the exclusion was applied to as an additional column - a feature request made on these forums.


Re: Reporting Unvisited Functions ...

Grant,

Yes I do have the "Excluded From Coverage Results" list. I am excluding Assemblies and Namespaces from my results. These Assemblies/Namspaces will contain a number of Methods. I was looking to get a complete list of the Methods/Functions that make up those Assemblies or Namespaces.

I think I could somehow process the XML to get the list of methods..

Thanks,
Liam


Re: Reporting Unvisited Functions ...

Liam,

Yeah I understand what you are after now - and no I dont think you have a way of getting what you want either now or in the 2.0 version. It was intentional on my part to not make the footer overly verbose - if you excluded a *.Tests assembly then I saw little point in listing all the test methods in that assembly and instead just display the topmost exclusion which is the xyz.Tests assembly.

Perhaps in a future NCover/NCoverExplorer version it could have this available as a feature but for now you are out of luck.


Re: Reporting Unvisited Functions ...

Grant,

Thanks for the response. Here is a quick note to let you know where I am coming from.

I am now at the stage of analysing and documenting some of the output from NCover/NCoverExplorer  which I have been using for my projects duration. At this stage I am looking at the results in a bit more detail. I am keen to examine all the exclusions and justify them. To achieve this it would have been good to get some sort of detailed exclusion report - and what caused the exclusion (e.g. an exclude attribute in the code, parameter from nant command line or from with NCoverExplorer GUI). If I can find what is causing the exclusion it would be easy to turn the exclusion off.

For example, in my project I have found exclusions that were applied early in the project that should now be included. It would be good to be able to examine the list of exclusions, find what is causing the exclusion and remove the exclusion clause if necessary.

It would be also good to get some statistics of the exclusions (i.e. number of sequence points and methods excluded). For example, I would like to know the total number of methods and also the total number of excluded methods.

In order to create an exclusion list, I tried to compare side-by-side NCover.results.xml with CoverageMerge.xml but these files are completely different, so I could not create any list from this.

I can imagine that this is not an easy thing to achieve and would possibly need a change in the XML attributes, but I thought I would provide you with some feedback.

Once again thank for you help, it is appreciated.

Regards,
Liam