2014-07-17
Step 3: Rename the binaries as follows and copy to run path
Step4: Start a Gumshoe session and add resources of .covsym and .dpk files
Step5: Do test scenarios to check if these scenarios covered the fixed code
How does Gumshoe relate to Magellan?
What is Gumshoe?
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?
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
Step 1: Install GumShoe
DownLoad (recommend version 2.0.1300.1000)
Step 2: Instrument binary
Before Instrument binary, we created C# class binary 'Triangle.dll' and Console Application 'CodeCoverageTest' to call method in 'Triangle.dll':
- Triangle.dll: is binary to be done code coverage test.
- CodeCoverageTest.exe: call method in 'Triangle.dll' to simulate test.
Triangle.dll source code:
1 namespace Triangle 2 { 3 public class Triangle 4 { 5 public bool IsTriangle(int a, int b, int c) 6 { 7 if (a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a) 8 return true; 9 10 return false; 11 } 12 } 13 }