且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio 2012代码覆盖率

更新时间:2021-09-26 04:56:51

使用 Microsoft测试管理器(MTM)从IIS应用程序收集代码覆盖率的详细说明您可以在以下博客中找到strong> Visual Studio 2012 Update 1 : http://blogs.msdn.com/b/visualstudioalm/archive/2012/11/28/code-coverage-in-microsoft- test-manager-in-visual-studio-update-1.aspx

Detailed instructions for collecting code coverage from IIS applications using Microsoft Test Manager(MTM) of Visual Studio 2012 Update 1 can be found in this blog: http://blogs.msdn.com/b/visualstudioalm/archive/2012/11/28/code-coverage-in-microsoft-test-manager-in-visual-studio-update-1.aspx

以下是摘要:


  • 安装 VS Update 1

  • 将Microsoft Test Manager(MTM)连接到团队项目(Team Foundation Server)并设置测试计划等。您可以在团队基础服务以创建团队项目。

  • 使用代码Coverag创建测试设置启用了数据收集器。

  • 使用此测试设置运行手动测试或探索性测试。

  • 您将在最后获得代码覆盖文件

  • Install VS Update 1.
  • Connect Microsoft Test Manager(MTM) to a Team Project (Team Foundation Server) and setup test plan etc. You can utilize the free account in Team Foundation Service to create team project.
  • Create a test settings with code coverage data collector enabled.
  • Run a manual test or an exploratory test with this test settings.
  • You will get the code coverage file at the end of the test run.

替代解决方案:


  • 使用 CodeCoverage.exe 收集代码覆盖率。路径:C:\Program Files(x86)\Microsoft Visual Studio 11.0\团队工具\动态代码覆盖率工具\CodeCoverage.exe。您不需要安装更新1,但我建议您这样做。示例:

  • Use CodeCoverage.exe to collect code coverage. Path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe. You don't need update 1 to be installed, but I recommend that you do so. Example:

CodeCoverage collect / IIS / session:WebSession /output:MyWebApp.coverage