Gumshoe - Microsoft Code Coverage Test Toolset

Gumshoe - Microsoft Code Coverage Test Toolset

2014-07-16

What is Gumshoe?

How to instrument a binary?

How to collect data?

How to vewi results?

Gumshoe concpets

Gumshoe Server

What is Gumshoe?



Top

Gumshoe is a toolset for integrating code coverage into the workflow between developers and testers by providing real-time feedback on the code coverage of code changed by a developer.

DownLoad (The version 2.0.1300.1000 is stable)

How to instrument a binary?



Top

Instrumentation is the process of adding hooks into a binary so that code coverage can be collected on it when the binary is run.  Gumshoe uses Magellan to instrument most built binaries (i.e. .NET, C, C++ binaries).  Gumshoe also supports plugins for javascript instrumentation.

Instrumentation typically produces three files:

  • An instrumented binary,
  • an instrumented pdb,
  • and a covsym file.

The covsym file must be added to the session for Gumshoe to be able to then collect coverage on the instrumented binary.

Attention: Instrumentation can cause binaries to run slower than usual.  You probably will not want to do performance tests with instrumented binaries.  Badly designed tests can sometimes fail because actions may take longer on an instrumented binary than a non-instrumented binary.

step-by-step instruction



Top

Gumshoe Concepts



Top

Code blocks and arcs:

A block is a sequence of machine instructions with exactly one entry point and one exit point. An arc is what connects two blocks to one another

Coverage symbols (covsym):

Gumshoe needs "resources" to properly interpret data. A coverage symbols file, also known as a covsym, maps binary data from the instrumented binary executable specific to the build being tested.

DPK:

A SD(Source Depot) Package file commonly used by various groups across the company to bundle a batch of source code changes. In fact, the Office triage process is based on SD Packages. A .dpk file is used to pass around a set of diffs as a single unit and consists of base source files, your modified source files and a manifest, bundled in a zip file with the extension .dpk. SDPack provides mechanisms to create, manage, view, and apply .dpk files. See Toolbox for more information on SDPack. A DPK file can be added to Gumshoe as a resource. From that DPK Gumshoe will automatically generate a filter based on the changed\added code in addition to extracting the modified source files so that you can see an annotated view of the code without having to first locate the source files.

Filter:
A filter is used in Gumshoe to scope down a change. One of the most common scenarios for a filter is applying a source line filter (or a DPK filter) to see the coverage scoped to a particular changelist. Other filters include symbol filters, which allow you to filter on static covsym data such as BinaryName or Directory, and trace filters, which allow you to filter based on a trace name.

Sessions:
Once a Gumshoe session is started, it remains active until you specifically enter the command to end the session, even if you reboot your computer.

Reference

[1] https://microsoft.sharepoint.com/teams/Gumshoe/default.aspx

Gumshoe - Microsoft Code Coverage Test Toolset

时间: 2024-10-18 00:14:38

Gumshoe - Microsoft Code Coverage Test Toolset的相关文章

How to do code coverage test for windows service

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

iOS 9 学习系列: Xcode Code Coverage

Code coverage 是一个计算你的单元测试覆盖率的工具.高水平的覆盖给你的单元测试带来信心,也表明你的应用被彻底的测试过了.你可能写了几千个单元测试,但如果覆盖率不高,那么你写的这套测试可能价值也不大. 这里并没有一个确切的百分比,要求你必须到达这个覆盖率.这很大程度上取决于你的项目(的具体情况).譬如说,如果你的项目中有很多不能写单元测试的视觉组件,那么覆盖率就会比单纯处理数据的框架要低的多. Code Coverage in Xcode 在过去,如果你想要制作一个测试的代码覆盖报告出

iOS 9 学习系列:Xcode Code Coverage Tools

Code coverage 是一个计算你的单元测试覆盖率的工具.高水平的覆盖给你的单元测试带来信心,也表明你的应用被彻底的测试过了.你可能写了几千个单元测试,但如果覆盖率不高,那么你写的这套测试可能价值也不大. 这里并没有一个确切的百分比,要求你必须到达这个覆盖率.这很大程度上取决于你的项目(的具体情况).譬如说,如果你的项目中有很多不能写单元测试的视觉组件,那么覆盖率就会比单纯处理数据的框架要低的多. Code Coverage in Xcode 在过去,如果你想要制作一个测试的代码覆盖报告出

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

虽然我们已经有了测试程序,但是如何得知是否已完整测试了主程序?,透过Code Coverage代码涵盖率,我们可以快速地得知,目前系统中,有多少程序中被测试过,不考虑成本跟投资效益比,涵盖率越高,代表系统如预期正常运作的面向也越广泛. 阅读全文>>

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

代码覆盖率(Code Coverage)是反映测试用例对被测软件覆盖程度的重要指标,也是衡量测试工作进展情况的重要指标.它也是对测试工作进行量化的重要指标之一,测试工作往往不如开发那样激动人心,一个重要原因之一就是测试难于量化,而代码覆盖率恰恰是解决着一问题的重要指标.根据其覆盖内容的不同,又可以细分为:语句覆盖.判定覆盖.条件覆盖.路径覆盖以及循环覆盖等等,这里有一篇很好的博客<代码覆盖率浅谈>介绍了各种不同覆盖率的定义.有的理解起来还是蛮拗口的,但其实不难,用到了再看就成!在所有这些覆盖中

[Webpack 2] Add Code Coverage to tests in a Webpack project

How much of your code runs during unit testing is an extremely valuable metric to track. Utilizing code the karma-coverage plugin and babel-plugin-__coverage__ plugin, we can get an accurate measure of how well we’re covering the files that we are te

VCS学习(5)-Code Coverage

一:类型 line(行)覆盖率,Toggle(跳变)覆盖率,condition(条件)覆盖率,FSM(状态机)覆盖率,path(路径)覆盖率 二:覆盖率 1:行覆盖率 一般要求100%,例如缺else,default 例子如下,缺少else,default:但这不一定是错误,可能故意为之:二次检查 2:条件覆盖率 代码中有if语句,实际可能出现某种情况,但程序没有覆盖,则报告 3:Toggle coverage 信号是否有0->1,1->0的跳变:x->1,x->0不会报告 4:F

PowerShell Pester - Code Coverage

今天继续学习Pester,invoke-pester有一个很nb的选项叫codeCoverage,可以指定需要测试的脚本,function甚至某一个片段的范围,然后他会告诉你这个范围内的功能是否都测试过了. 来个实例看看,豆子直接在上一篇的脚本里面添加了一个switchtest的function,然后测试了其中一个if的功能 Test.ps1 function add { param( [int]$a, [int]$b ) $sum=$a+$b $sum } function switchtes

The method of using code coverage tool

Please look at the following blog: http://blog.csdn.net/superqa/article/details/9060521 Use  ReportGenerator tool the command line is:ReportGenerator.exe -reports:"D:\TestResults\xyz.xml" -targetdir:"D:\TestResults" you can type Report