我想知道对于。net(或者具体来说是c#)代码覆盖率有哪些选择,尤其是在价格较低的部分?

我不是在寻求建议,而是基于事实的产品比较。我知道以下几点:

NCover Seems to be very popular and looks quite good Supports statement coverage and branch coverage $480 for "NCover 3 Complete" Older beta versions are available for free Visual Studio (2008 Pro) | (2005 Team System (Development, Test or Team Suite Editions)) Well, it's Microsoft so I'd expect it to work properly Fully integrated into Visual Studio At least $5,469 PartCover - no further development (moved to OpenCover) Open source Supports statement coverage OpenCover - successor to PartCover OpenSource Supports branch and statement coverage 32 and 64 bit support Silverlight support Background Tutorial on The Code Project by the primary developer No .NET Core support yet SD Test Coverage Works with 32 and 64 bits, full C# 4.0 Handles both small and very large code bases $250 for single user license JetBrains dotCover $100 for Personal License. Free for user groups, open source projects, students and teachers. Supports statement coverage Silverlight support NCrunch $159 for personal license $289 for commercial seat license * Free during beta, to become commercial, pricing unknown future unknown. Code coverage indicators in Visual Studio Continuous (near real time) testing Visual per-test code coverage Performance metrics, parallel multi-core test execution NDepend $410 for developer license NDepend can import coverage data from NCover, DotCover, Visual Studio 2017; 2015, 2013, 2012, 2010 and 2008 Code Coverage files. Dependency graph Dependency structure matrix Visualizing code metrics Validating code rules


当前回答

请参阅我公司的c#测试覆盖工具Semantic Designs:

它具有非常低的开销,可以处理庞大的文件系统,直观的GUI,如何覆盖特定文件,并在方法、类和包级别生成覆盖分解报告。

其他回答

代码覆盖特性,以及可编程API,随Visual Studio 2010而来。遗憾的是,只有两个版本包含了完整的代码覆盖功能:高级版和终极版。然而,我相信API在任何版本中都是可用的,因此创建代码覆盖文件并为覆盖信息编写一个查看器是可能的。

JetBrains(因ReSharper而出名)一直在开发一个覆盖工具,叫做dotCover。这显示出很大的希望。

TestCocoon也很不错。它正在积极开发中,并拥有一个用户社区:

开源(GPL 3) 支持C/ c++ / c#跨平台(Linux, Windows和Mac) CoverageScanner -生成期间的检测 CoverageBrowser -代码覆盖结果的查看、分析和管理

然而,TestCocoon已经不再开发了,它的创建者现在正在为C/ c++开发一个商业软件。

请参阅我公司的c#测试覆盖工具Semantic Designs:

它具有非常低的开销,可以处理庞大的文件系统,直观的GUI,如何覆盖特定文件,并在方法、类和包级别生成覆盖分解报告。

我不确定与零售NCover的区别是什么,但在SourceForge上也有一个NCover项目,当然是开源和免费的。