Code Coverage Analysis:
Steps to get code coverage of a module:
1.Instrument the web service binary that you want coverage on: VsInstr.exe /coverage myWebService.dll. The tool executables can be found at \Program Files (x86)\Microsoft Visual Studio 9.0\Team Tools\Performance Tools. So first you need to go to this directory on cmd line to run the command.
For e.g. VsInstr.exe /coverage C:\build\Test10_150\Release\Test.dll
2. Start the monitor for collecting coverage data:
VSPerfCmd.exe /start:coverage /output:C:\CoverageData\150.coverage /cs /user:vkumar.
4.Verify the monitor has started: VSPerfCmd.exe /status:
If you will get an output similar to below message, then the coverage monitor has started:
Microsoft (R) VSPerf Command Version 9.0.30729 x86
Copyright (C) Microsoft Corp. All rights reserved.
Process and Thread Status
============================================================
Output File Name : C:\CoverageData\150.coverage
Collection mode : COVERAGE
Maximum Processes : 64
Maximum Threads : 256
Number of Buffers : 258
Size of Buffers : 65536
============================================================
Maximum Number of Processes : 64
Number of Active Processes : 0
Global Start/Stop Count : 1
Global Suspend/Resume Count : 0
============================================================
Users with access rights to monitor:
UserName (SID)
Test\vkumar(S-1-5-21-1462854013-198636-2508-34309)
NT AUTHORITY\SYSTEM (S-1-5-18)
5. Run the scenario or test cases that will exercise the Windows Service.
Stop the Windows Service and Shutdown the monitor: VSPerfCmd.exe /shutdown. The code coverage data should be saved at C:\CoverageData\150.Coverage. Do not move the .pdb files of the instrumented EXE or DLL. Otherwise, C:\CoverageData\150.Coverage will fail to load.
Steps to get code coverage of a module:
1.Instrument the web service binary that you want coverage on: VsInstr.exe /coverage myWebService.dll. The tool executables can be found at \Program Files (x86)\Microsoft Visual Studio 9.0\Team Tools\Performance Tools. So first you need to go to this directory on cmd line to run the command.
For e.g. VsInstr.exe /coverage C:\build\Test10_150\Release\Test.dll
2. Start the monitor for collecting coverage data:
VSPerfCmd.exe /start:coverage /output:C:\CoverageData\150.coverage /cs /user:vkumar.
4.Verify the monitor has started: VSPerfCmd.exe /status:
If you will get an output similar to below message, then the coverage monitor has started:
Microsoft (R) VSPerf Command Version 9.0.30729 x86
Copyright (C) Microsoft Corp. All rights reserved.
Process and Thread Status
============================================================
Output File Name : C:\CoverageData\150.coverage
Collection mode : COVERAGE
Maximum Processes : 64
Maximum Threads : 256
Number of Buffers : 258
Size of Buffers : 65536
============================================================
Maximum Number of Processes : 64
Number of Active Processes : 0
Global Start/Stop Count : 1
Global Suspend/Resume Count : 0
============================================================
Users with access rights to monitor:
UserName (SID)
Test\vkumar(S-1-5-21-1462854013-198636-2508-34309)
NT AUTHORITY\SYSTEM (S-1-5-18)
5. Run the scenario or test cases that will exercise the Windows Service.
Stop the Windows Service and Shutdown the monitor: VSPerfCmd.exe /shutdown. The code coverage data should be saved at C:\CoverageData\150.Coverage. Do not move the .pdb files of the instrumented EXE or DLL. Otherwise, C:\CoverageData\150.Coverage will fail to load.

No comments:
Post a Comment