Test Driven Development and Keybindings

For those that practice Test Driven Development (TDD) here’s a quick reminder about keybindings in Visual Studio 2008 that will make your life easier:

  • Run all tests in the solution – Ctrl+R, A
  • Run tests in the current class – Ctrl+R, C
  • Run tests in the current context – Ctrl+R, T
  • Run tests in the current namespace – Ctrl+R, N

There is also a variant which debugs the tests, to use this variant hold down Ctrl when pressing the second key in the chord.

I also like to bind Ctrl+N, T to Project.AddNewTest and Ctrl+N, U to Project.AddUnitTest so I can quickly add tests to the current test project.

Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build

I’m proud to say that after many months of work Sayed Ibrahim Hashimi and I have completed work on Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build (PRO-Developer). It is being published by Microsoft Press and is due out on 7th January 2009.

Preserving Labels When Builds Are Deleted

When builds are deleted in TFS 2008, either manually or via retention policies, everything about the build is deleted, including the label. This completely removes the ability to reproduce the build in the future if the need arises.

In Service Pack 1 the capability was added to have labels preserved when the build is deleted and Buck explains how to enable this in his blog post.

Team Foundation Build Load Balancer Released

I’ve released a new open-source project that we’ve been using internally for a number of months called the Team Foundation Build Load Balancer (http://www.codeplex.com/teambuildloadbalance/). It’s a very simple command-line application (which is designed to be run in a scheduled job) to balance queued builds between multiple build agents irrespective of which build agent it was queued on.

Open-Source Project for Pre Check-In Validation

A new open-source project has been released on CodePlex called the TFS Check-in Validation Tool. The main purpose of this project is to allow developers to run their changes through a full end-to-end build prior to checking them in.

It works basically like this:

  1. Developer shelves their changes.
  2. Developer starts a build using the BuddyBuild menu in Visual Studio:
    image
  3. Developer selects the shelveset they want to build and clicks Queue Build.
     image
  4. The TFS Check-In Validation Tool extends the default build process to get the shelveset after the normal get has been performed so that the developer’s changes are built as well. If the build succeeds then it can also (optionally) check-in the shelveset automatically.

Leave your feedback on the Discussions tab or raise an bugs or issues on the Issues tab.

Specifying What’s Included In A New Test Project

When you create a new test project the following files are added to it by default:

  • AuthoringTests.txt
  • ManualTest1.mht
  • UnitTest1.vb (or UnitTest1.cs)

You can configure what files are added in Tools | Options | Test Tools | Test Project as shown here:

image

Tracking Time Against TFS Work Items Using TFS Working On

On Friday at the Queensland VSTS User Group Matthew Rowan mentioned an open-source system tray utility he’d written called TFS Working On. This utility allows developers to select the work item they are currently working on and it will record the time spent, add it to the work item’s history, as well as updating the work completed and work remaining fields appropriately.

Matthew will be presenting at the December user group meeting about this and how they leveraged the Team System OLAP cube for reporting time and doing evidence-based scheduling.

Biggest Yet Power Tools Release Coming Up

Brian Harry has blogged about the upcoming power tools release and this is without a doubt the biggest yet, here’s a couple of the highlights to whet your appetite:

  • Team Members displayed in Team Explorer, so what? Well…
    • IM integration allows you to message team members from within Visual Studio
    • View their shelvesets
    • View their pending changes
  • Improved deployment for check-in policies and custom work-item controls.
  • Integration into Windows Explorer and PowerShell.

TFS 2008 Service Pack 1 Bug Fixes

Brian Harry has published a list of bug fixes that shipped in TFS 2008 Service Pack 1. What I also found interesting from this list is the breakdown of where different bugs were detected or reported.

Error writing to ‘vsvars32.bat’ after Visual Studio Team System 2008 installation

After upgrading one of our production environments to Visual Studio Team System 2008 whenever I launched Microsoft Word (or something that uses Microsoft Word such as Microsoft Outlook) the Windows Installer dialog would appear and after some time complain that it could not write to C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat. Because I’m running Windows Vista I don’t by default have write access to the files under C:\Program Files\ and the installer wasn’t prompting me to escalate my privileges which resulted in the installer failing.

I thought the solution to the problem was to explicitly launch Microsoft Word as administrator once to allow the installation to complete successfully. Unfortunately it appears to be a per-user installation, so what I had to do was temporarily grant the Users group Full Control to C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat to allow the installation to complete as the current user.

UPDATE: This made the installation succeed but didn’t stop it running every time I launched an Office product.

UPDATE 2: It turns out that this was actually caused by a conflict with the WinZip Email Companion add-in. Disabling this made the problem go away.