Today I am running into some discrepancies between Visual Studio 2012 and SONAR code coverage analysis.
When I execute Visual Studio 2012 code coverage analysis Test->Analyze Code Coverage->All Test it throws the below values
- Not Covered 37%
- Covered 63%
But when I execute this analysis through SONAR (gallio and dotcover) it throws the below values
- Unit Test Coverage 55%
Very similar result I get from dotcover in visual studio.
- Code coverage 53%
I am not adding any special flags in the sonar-runner properties file. Or setting something in dotcover.
ExpectedExceptionAttributeas uncovered. I expect all code coverage tools do odd things like that somewhere, so I wouldn't worry too much about the numbers lining up. I prefer the ContinuousTests style - method coverage with risk calculations. - Magus