Bring back the "Create Unit Tests" feature from Visual Studio 2010?


There's a feature request on User Voice that requests Microsoft to bring back the "Create Unit Test" menu item which was removed in Visual Studio 2012. I've seen it come up as a potential Ranger solution and it's been getting a lot of votes so far.

It turns out that the feature has been there all along, was it was just removed from the ever crowded right-click context menu? Or is there something else at work here? It's my belief, not confirmed or backed by the Product Team in any way, that it was removed to promote a better practice for writing unit tests. The fact that this feature only works for MsTest and not for the XUnit and NUnit, might also have been an influence to remove the menu item.

The danger of generating unit tests from the implementation is that chances are likely you'll be testing the implementation and not the actual functionality. This is a common problem with writing tests after writing the code. Since you already know exactly how the 'intended' functionality has been implemented, it's really easy to fall into the trap of mimicking or even duplicating the functionality in your test. The result is that whenever the implementation changes, your test is likely to fail, even when the functionality remained the same.

So, if you really liked the "Create Unit Test" menu item, sure, you can bring it back. But I'd strongly suggest you look at the way you write your tests.

New Tfs Team Tools beta release


Mattias, the main contributor to the Tfs Team Tools has published a new beta release which includes the changes I'd added to the project. So now you can download a pre-built copy of the tools that includes the ability to update user and team images and convert existing security groups to teams.

Get it here from the Tfs Team Tools codeplex site!

For more details in these features, check out:

Any and all feedback is appreciated!

Converting a Group to a Team in TFS 2012


Some time ago I blogged about the few lines of code required to convert a TFS Group to a Team. It's now available as part of the latest beta version of the Tfs Team Tools from codeplex.

D:\Sources\TfsTeams\Main\TfsTeams CmdLine\bin\Debug>tfsteams GroupToTeam /collection:http://localhost:8080/tfs/DefaultCollection /teamproject:Scrum /group:NoTeam
Group [NoTeam] converted to team.

D:\Sources\TfsTeams\Main\TfsTeams CmdLine\bin\Debug>

Grab it while it's hot :). This is especially handy if you've upgraded an older Project Collection to TFS 2012 and where you were already using groups to distinguish teams.

Most Reading