1

I have a scenario where I have to gather code metrics on a frequent basis and send out a report. My project uses TFS 2010. I generally need to get latest code from TFS, build it (both using .TFS Client APIs), run code analysis, code metrics and code coverage (all using command line tools) and report them. I am trying to create a standalone app that would do all this -

  1. Get Code from TFS
  2. Build
  3. Run Code Analysis
  4. Run Code Metrics
  5. Determine Code Coverage

I would be exporting the results to an excel and probably chart it out. I feel the need for such a tool because in the absence of a TFS Build server and VS.NET, anyone who has read access to TFS should be able to gather metrics, by using such a tool.

Is there an existing tool someone has already built, possibly does all or some of this? I am aware of few PowerShell scripts out there that does getlatest, build and also can be quickly extended to include more, but I am specifically looking at an app.

Lalman
  • 946
  • 2
  • 11
  • 27
  • Why not just use a standard TFS build? – John Saunders Mar 08 '12 at 06:33
  • There is no TFS build server or build scripts created. I believe you wouldn't be able to automate the metrics stuff without a build script and tfs build? In my case, there is also no VS.NET (just access to TFS server) and I want to get all the metrics in addition to build. – Lalman Mar 08 '12 at 06:39
  • Why not just set up a build server and limit it to just this one build? The default build process template does almost everything you want. You might have to add some MSBUILD parameters to force code metrics on. – John Saunders Mar 08 '12 at 06:41
  • Thanks Joh. I agree. That would be ideal. But unfortunately, it might take few months to get a build server in place due to several reasons. I was thinking about a interim approach until that happens. – Lalman Mar 08 '12 at 06:43
  • 2
    You can install the build server on your current TFS server. This works ok if you'll only do a few builds on it. No need for a new server. – John Saunders Mar 08 '12 at 06:46
  • Thanks John. That sounds good and will take this point. We have about 60+ apps in TFS and at least 20 of them would need these metrics on a weekly basis. May be I should be able to schedule builds for each of them so that it does not load the server too much. – Lalman Mar 08 '12 at 06:50
  • You could even install the build service on your local machine. It doesn't require a server OS. As John points out, a TFS build will already do most of what you want. – Jim Lamb Mar 08 '12 at 14:53
  • Great! that sounds even more practical for my case. Thanks Jim – Lalman Mar 10 '12 at 09:07
  • Just as an after thought, Installing the Build service on "multiple local machines" could be cumbersome. On top of this, a build script has to be created for all applications involved. I would still agree that this is THE recommended approach. But pracitically, having an app to do get code, build and run metrics would work great for any existing/new app without having to spend time on installing the build service locally and creating a build script. – Lalman Mar 26 '12 at 04:27
  • You can also use an alternative code coverage tool like https://github.com/SteveGilham/altcover. – Karel Frajták Aug 27 '20 at 09:34

0 Answers0