Coverage Data FAQ

  • Which coverage technology is supported by NDepend?
  • How to get XML Coverage Files from NCover 3.X and above?
  • How to get XML Coverage Files from JetBrains DotCover™ 1.1 and above?
  • How to get XML Coverage Files from Visual Studio™ 2013, 2012, 2010 and 2008?
  • How to provide a list of coverage files to parse during each analysis run?
  • How to import coverage data into some analysis results?




  • Which coverage technology is supported by NDepend?

  • NDepend can import coverage data from:

  • How to get XML Coverage Files from NCover 3.X and above?

  • NDepend reads NCover v3 XML format, hence if you are using NCover v4 or above, you need to export your coverage file with v3 format as explained in this NCover documentation.
    This looks like :
    ncover export --project="MyProject" --execution="3/12/2012" --file="C:\Users\Support\Desktop\Report\coverage-export" --format=v3xml
    
    If you are using TestDriven.NET and/or NCoverExplorer.exe you can access folder that contains coverage file from the Explore Coverage Folder menu:




  • How to get XML Coverage Files from JetBrains DotCover™ 1.1 and above?

  • By default DotCover outputs XML coverage file. However NDepend cannot parse the default DotCover XML coverage file. You need to configure DotCover to output NDepend XML files. This can be done this way in your DotCover configuration file:

    <?xml version="1.0" encoding="utf-8"?>
    <AnalyseParams>
      <Executable>C:\App\Bin\MyApp.exe</Executable>
      <Output>..\DotCoverCoverage.xml</Output>
      <ReportType>NDependXml</ReportType>
    </AnalyseParams>


    See also this article about using TeamCity, dotCover and NDepend, by Laurent Kempé:
    Using TeamCity integrated dotCover coverage files with NDepend



  • How to get XML Coverage Files from Visual Studio™ 2013, 2012, 2010 and 2008?

  • Visual Studio™ has 2 coverage files format.
    • A binary format where file extension is .coverage. This is the format you'll get from testing from Visual Studio or from TestDriven.NET. Alternatively you can also use the tool VSPerfMon.exe to get a .coverage file. For that you then need to instrument each assembly to cover with the tool VSInstr.exe used with the /Coverage option.
    • A XML format. (with file extension .coveragexml since VS 2010, and .xml for previous versions)
    NDepend only consumes the XML format. You can manually export XML coverage files from binary coverage files from Visual Studio with this option:


    You can programmatically transform a binary coverage file into a xml coverage file. See the Microsoft documentation:
    http://blogs.msdn.com/ms_joc/articles/406608.aspx
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=273875&SiteID=1



  • How to provide a list of coverage files to parse during each analysis run?

  • In VisualNDepend menu: Project Properties > Analysis > Code Coverage > Settings





  • How to import coverage data into some analysis results

  • In VisualStudio menu: NDepend > Coverage > Import Code Coverage Data