General questions

2009-03-11
2013-04-29
  • Hi,

    Start using PartCover recently, integrated it CCNEt for most of our projects for now, will actually start using the report soon I hope. I would have some questions regarding it:

    1) As I see PartCover covers all code, public/internal/protected/private. Is there a way to make it only cover public methods for example?
    2) All methods have the same weight on creating overall coverage value regardless of access modifiers?
    3) Is there a precedence of weight for exclude/ignore? (like the first/last set parameter takes precedence)

    Thanks,
    florin

     
    • Loginov Oleg
      Loginov Oleg
      2009-03-11

      1) No way for now
      2) Not sure I can understand your question here
      3) The sequence is (the same for attributes):
            step 1) if it suits exclude rules (one at least) - ignore method
            step 2) if it suits include rules (one at least) - instrument method
            step 3) ignore otherwise.

       
    • Dan Ports
      Dan Ports
      2009-03-11

      Florin,

      1) No. Out of curiosity, where would this be useful?
      2) Not sure what you mean here. PartCover completely ignores access modifiers AFAIK.
      3) Not really. Here's how PartCover decides whether a particular type should be included in the results:

      Does the item match any exclude rule? If so, exclude the item.
      Does the item match any include rule? If so, include it.
      If the item does not match any rules, exclude it.

      Dan

       
      • Loginov Oleg
        Loginov Oleg
        2009-03-11

        2) That's right

         
    • 1) You could get quick data for a report "how much of the public interface is touched by tests" (not that only public code should be tested).

      2) yes it makes no sens :)

       
      • Dan Ports
        Dan Ports
        2009-03-11

        1) Hmm...NDepend would be ideal for this sort of thing -- you could write a CQL query to find methods/types that are public but don't have any code coverage. The problem is that NDepend only imports NCover coverage reports. I wonder how different the NCover and PartCover report formats are. If they're similar, maybe PartCover could output a report in NCover's format and you could load that into NDepend.

         
        • Dan Ports
          Dan Ports
          2009-03-11

          Outputting in NCover format might also solve my problem of needing to merge coverage files -- I might be able to use the NCover tools for that.