First, instrument the exe or dll by command

vsinstr -coverage the dll/exe

second, start the performance monitor

VSPerfCmd.exe /start:coverage /output:"D:\Latest.Coverage" /cs /user:"Everyone"

at this time, we could check the status by running command:

VSPerfCmd.exe /status

third, start the windows service  and execute the test scenario.

Fourth, shut down the performance monitor tool by

VSPerfCmd.exe /shutdown

Trouble shooting:

on the 64 bit machines, you may could not get the coverage, instead it shows message:

Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731

and in the event view, has error with source: VSPERF

Unable to connect to monitor.  Make sure the monitor is started and in the correct mode.

Resolving by:

Run the above command from the tools for x64 machines, it located at

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64

How to do code coverage test for windows service的更多相关文章

  1. 10 Code Coverage Tools for C & C++

    Code coverage is a measure used in software testing that describes the degree to which the source co ...

  2. Gumshoe - Microsoft Code Coverage Test Toolset

    Gumshoe - Microsoft Code Coverage Test Toolset 2014-07-17 What is Gumshoe? How to instrument a binar ...

  3. [Jest] Track project code coverage with Jest

    Jest comes pre-packaged with the ability to track code coverage for the modules you're testing, but ...

  4. Effective Java提升Code Coverage代码涵盖率 - 就是爱Java

    虽然我们已经有了测试程序,但是如何得知是否已完整测试了主程序?,透过Code Coverage代码涵盖率,我们可以快速地得知,目前系统中,有多少程序中被测试过,不考虑成本跟投资效益比,涵盖率越高,代表 ...

  5. CI集成phpunit Error: No code coverage driver is available 的解决

    CI集成phpunit时,运行报No code coverage driver is available的错误,如下图: yanglingdeMacBook-Pro:tests yangling$ p ...

  6. 代码覆盖率 (Code Coverage)从简到繁 (一)

    代码覆盖率(Code Coverage)是反映测试用例对被测软件覆盖程度的重要指标,也是衡量测试工作进展情况的重要指标.它也是对测试工作进行量化的重要指标之一,测试工作往往不如开发那样激动人心,一个重 ...

  7. Chrome DevTools: Export your raw Code Coverage Data

    The Code Coverage tool visually shows you which lines of code in your CSS and JavaScript are used an ...

  8. iOS 9 学习系列: Xcode Code Coverage

    Code coverage 是一个计算你的单元測试覆盖率的工具. 高水平的覆盖给你的单元測试带来信心.也表明你的应用被彻底的測试过了. 你可能写了几千个单元測试,但假设覆盖率不高.那么你写的这套測试可 ...

  9. Qt代码覆盖率code coverage(VS版)

    版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:Qt代码覆盖率code coverage(VS版)     本文地址:http://techi ...

随机推荐

  1. winform碎片

    1.通过同一个pictureBox控件加载不同的图片,在加载前需要释放控件里之前的Image. pictureBox1.Image.Dispose();//Dispose之后对象就不存在了,只能重新C ...

  2. 使用AXIS2客户端调用 WEBSERVICE

    问题 在调用WEBSERVICE时,可以使用wsdl2java生成java代码,调用接口,这种方法在接口固定的情况下是一种不错的选择,如果需要动态调用接口,那么这样就行不通了. 解决办法 1.直接构建 ...

  3. Java,Android 项目导入Eclipse常见错误

    一.导入的jar包不存在: 右键工程属性查看: 导入的第三方jar包不存在: 解决方法: 删除该jar包,得到该jar包并存至本地,再导入该jar包 二.中文字符乱码: 解决方法: 右键项目属性: 修 ...

  4. SQL Server 2012提供的OFFSET/FETCH NEXT与Row_Number()对比测试 [T]

    SQL Server 2008中SQL应用系列--目录索引 前些天看到一篇文章<SQL Server 2012 - Server side paging demo using OFFSET/FE ...

  5. SQL经典面试题及答案

    1.一道SQL语句面试题,关于group by表内容:2005-05-09 胜2005-05-09 胜2005-05-09 负2005-05-09 负2005-05-10 胜2005-05-10 负2 ...

  6. java 创建线程的三种方法Callable,Runnable,Thread比较及用法

    转自:http://www.chinaitlab.com/Java/line/942440.html 编写多线程程序是为了实现多任务的并发执行,从而能够更好地与用户交互.一般有三种方法,Thread, ...

  7. PHP字符串处理函数

    /* * 确定字符串长度 * int strlen(string str) * 比较两个字符串 * 1.strcmp函数对两个字符串进行二进制安全的比较,并区分大小写 * int strcmp(str ...

  8. USACO 2014 JAN 滑雪录像

    2. 滑雪录像{silver题3} [问题描述] 冬奥会的电视时刻表包含N (1 <= N <= 150)个节目,每个节目都有开始和结束时间.农民约翰有两台录像机,请计算他最多可以录制多少 ...

  9. <java基础学习>JAVA 对象和类

    Java is an Object-Oriented Language. As a language that has the Object Oriented feature, Java suppor ...

  10. C语言简易文法(无左递归)

    <程序> -〉 <外部声明> | <函数定义><外部声明> -〉<头文件> | <变量> | <结构体> <头 ...