Friday, March 30, 2007

Unit testing for the masses

Naysawn Naderi announce earlier this week that Microsoft intends to release their unit test framework in the professional version of Visual Studio as well starting with the Orcas release. You can read more about it in his post Unit Testing Trickling into Pro!

He also asks for feedback on what else should go into the professional version so take the opportunity to comment on his post with some feedback. Hopefully this will end in a complete package including test management and code coverage trickeling down.

Thursday, March 29, 2007

Where did my changes go? The black hole of merging...

Lately we have had some problems with files disappearing from our projects or even projects from our solutions when doing integration between our main trunk and its child branches.

Since this was causing a bit of an issue when it comes to trusting Team System to handle merges correctly I did some investigation. The conclusion I came to was that it's not a bug (as I suspected). Although since we had problems with it I decided to post about it and maybe spare someone the trouble of having to figure out why it happens.

The problem arises when you have the following chain of events:

1, Make an addition to your project file in your main trunk.
2, Make an addition to your project file in your branch.
3, Perform a merge of the changes in the main trunk into the branch.
4, Resolve the conflict by preserving target changes.
5, Make an additional change to the project file in the main trunk.
6, Perform a merge of the changes in the main trunk into the branch.

What will happen is that the second merge will happily overwrite the changes made in the branch since there are no conflicting changes (remember we resolved the first conflict by ignoring the changes from the main trunk) it will simply merge the changes which results in a copy from source since we have no conflict between the files in the merge history.

There is not much to do about this since the behaviour is by design and the only way to prevent this from happening would be to always do a content compare of a file before actually performing the merge.

So the moral of the story is that if your resolving a conflict by choosing keep target you have to really know why your doing it.

Monday, March 26, 2007

TeamPlain will become Microsoft Visual Studio Team System Web Access

Today Microsoft announce it's acquisition of Teamplain a really great web frontend for Team System. This fits very nicely in to the overall solution since there are alot of people in you average mid to large size project that aren't comfortable in the Visual Studio IDE.

If you have a proper TFS server CAL you can download the v1.0 of here and start using it today.

We'll see it fully integrated into the "Orcas" release of Visual Studio 2005 but a interim release will be release as a VSTS Power Tool. Read more on Brian Harry's blog.

For more details on the acquisition go to the official press release from Microsoft.

Friday, March 23, 2007

Branching guidelines for TFS

Well spring has finally come to Sweden (which makes it even harder to find the time actually sit down a do som blogging) the weather today has been absolutely fantastic.

Anyway, Microsoft recently published a document on codeplex (kind of an odd distribution channel) which had been very useful to have when we setup shop with team system. There are alot of issues that needs to be considered and weighed when implementing a source control system in your development process.

So go ahead and download a copy of Team Foundation Server Branching Guidance.

I also though I'd take the opportunity to write down some other useful links when we are on the subject of branching and merging. Maybe someone will be spared the work of assembling the information...

Chris Birmele wrote a good whitepaper (it's mentioned in the guidance document aswell) Branching and Merging Primer which gives you a good start if you are new to the concepts.

Steve St Jean wrote an excellent document on the migration from VSS to TFS which you should read and consider to use (I'll save you the trouble of compiling your own for you developer teams) From VSS to TFS.

If you are like me and like to know the inner workings of things you should check out the writings of Eric Sink Source Control HOWTO there is alot of food for thought in them when it comes to the basics of source control.

Chuck Walrad & Darrel Storm wrote a very good piece on branching models and how to use them The importance of branching models in SCM

Brian Harry blogged about how they have organised themselves at Microsoft and the type of branching models the apply Branch structure in Developer Division at Microsoft

Last but not least you need to check out the postings on the subject of branching and merging by Mitch Denny he has written alot about this which I encourage you to read:

      The Terminology of Branching
      Concurrent Development with Branching
      Reducing Source File Contention with Branching
      Implementing Quality Gates with Version Control

If you haven't already done so you should probably read the following book by Vincent Maraia, the book is a goldmine of information based practical experience: The Build Master: Microsoft's Software Configuration Management Best Practices

Thursday, March 8, 2007

Creating lists based on output from actions in your build script

I'm being haunted by the blog police at work so I figure I'd post something instead of watching the telly today...

Sometimes when you create builds scripts for MSBuild you need to create collections based on the result of other actions in the script (for example after retrieving the latest files from source control or the output from a compilation). The problem is that it will not work when using wildcards since the expansion of the wildcards is done upfront before actually running the build script, so if your depending on the result from a get from source control for instance the first time you run your script the collection will be empty (since we have not yet retrieved the files) and ever execution after that will be based on the previous executions result (that is the files retrieved from source control the latest run).

To get past this you'll either need to create a target that contains a <CreateItem> action with the path to the files in question then this will be evaluated during the execution of the script. But what if I want to create a reusable target that can be driven by creating an <ItemGroup> what then?

I've created a target that you can use to do this which is based on the concept of using escaped asterisks (%2a) when specifying the path to the files in question it looks like this:

   <!--Dynamic List of Typelibraries-->
   <FileList Include="$(SolutionRoot)\Typelibraries\%2a%2a\%2a.tlb">

<Target Name="AfterGet">
   <CallTarget Targets ="CopyFiles"/>

<Target Name="CopyFiles">
   <Message Text="Copying Files" />

   <!—Create list of files-->
   <CreateItem Include="%(FileList.Identity)"
      <Output ItemName="ExpandedFileList" TaskParameter="Include"/>

   <Copy SourceFiles="@(ExpandedFileList)"
                DestinationFiles="@(ExpandedFileList ->'$(DropLocation)\$(BuildNumber)\%(OutDir)%(RecursiveDir)\%(Filename)%(Extension)')"
   ContinueOnError="True" />

Well that's all there is to it hope someone out there will have some use for this...

Sunday, March 4, 2007


The last six months or so I have started to realize the necessity to share information when working with technology. Many headaches have been solved browsing through various blogs, so I figured it was time to give some back...

My main focus will be on architecture and the development process (although I might throw in a nugget from time to time dealing with day to day development tasks) and the occasional book review.