Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Coverage of Changed Code in Visual Studio 2013 & TFS 2013

Visual Studio and TFS have both tools to collect and report on code coverage for a project or solution. What we're interested in knowing, though, is how much of the changed code has been covered by tests. We'd like to be able to identify a baseline changeset in TFS and then get a report on what code was changed in the current build, what portion of it was covered by testing, and most importantly, what portion wasn't. As far as I can see, the code coverage reports and analysis in Visual Studio don't take into consideration what code has changed--they only tell you about code coverage for the entire project or solution.

like image 627
Scott Avatar asked Jan 08 '14 15:01

Scott


1 Answers

Unfortunately, there's no out of the box functionality from TFS or Visual Studio for getting what you want.

The Code Churn and Code Coverage perspectives from the TFS data warehouse won't help much as the code churn perspective only tracks lines of code that changed, not which methods were changed.

Looking at an alternate option, you might be able to get what you're after using SonarQube's differential views but they are date based, not changeset/commit based. Plus the SCM plugin needed hasn't been tested against TF Version Control so I don't know if it will work (I haven't tried it myself). If you're using git with TFS then it should work fine, you'll just have to go through the hassle of setting it all up.

like image 157
Richard Banks Avatar answered Sep 30 '22 18:09

Richard Banks