Let's just call this Part 1 in a potentially lengthy series of
suggestions aimed at Microsoft.
To be clear, I like Microsoft: I make my living using Microsoft tools. However, as with all things, I occasionally encounter frustrations with their tools and/or services and need a place to vent. Well, here it is.
Suggestion: Please decouple the different tools within Visual Studio
One huge frustration for me is the apparent assumption that most/all Microsoft customers use the full stack of Microsoft tools. I see this theme manifest itself in many different areas of software development, but for this post, I just want to focus on the tools for building, testing, and deploying .NET applications (mainly web applications).
So, here's my caveman view of the software development lifecycle (absent project management methodology jargon and concepts like iterative development):
In my diagram, I've identified different activities and where they occur: for instance, coding and authoring of unit tests take place on the developer's workstation while I expect formal builds, formal unit testing and analysis and even formal packaging operations to occur on the build server. Finally, I've added suggested tools that are used for each activity.
Now let's talk about my frustrations: thanks to the tight coupling of the different tools within the umbrella of Visual Studio, we have to be very careful about what tools we use in development because those tools may not be available to build/test/package our code on the build server. Unlike other shops, my company has quite a mixture of technologies in the software development stack--most important, this means no Team Foundation Server. Note: I've observed most of these frustrations under Visual Studio 2005, but I'm not optimistic that they've been remedied under Visual Studio 2008.
My first problem is with unit testing. When Visual Studio 2005 rolled out, my inclination was to run with MSTest
. That is, until I realized that MSTest required an instance of Visual Studio be installed on the build server
have railed against MSTest in general, but my most immediate problem with it is the fact that I would have to corrupt my formal build environment
with a developer tool. It seems to me that having a development tool on the build server would be a violation of the separation of duties
we try to practice at my organization, not to mention the silliness of having to buy an extra Visual Studio license just so it can sit on a build server and facilitate unit testing. Frustration #1: MSTest cannot stand alone from the Visual Studio IDE
So, let's scrap MSTest like Jeff Palermo did
and go with one of the open source testing frameworks like NUnit
(maybe, some day, Microsoft will decouple MSTest from Visual Studio
). That's great, but how do I calculate code coverage? Visual Studio Team System will calculate code coverage but I assume that only works against tests written on the MSTest framework. If I don't go MSTest, I guess that means I'll have to scrape together a few bucks (albeit not that much) and buy something like NCover
. Frustration #2: VSTS Code Coverage only works with MSTest
(this is an assumption, to be sure, so if I'm wrong here, someone please let me know--and let me know how to configure VSTS to calculate code coverage on NUnit tests).
Alright: let's assume we've moved past the unit testing and code coverage issues. We've made all the right decisions so that our code is going through formal builds and unit tests on a nice
build server. Now, how do we push out our compiled artifacts to our Production server? I get the impression that most folks at Microsoft advocate either XCopy
or Visual Studio Publish
. These tools either require the Visual Studio IDE outright or a deeper knowledge of Microsoft deployment tools than the average deployment lackey will have (remember, separation of duties means that developers won't be the individuals deploying applications to Production servers).
Personally, I'm a fan of deploying via Windows Installer
files--that is, an MSI or installation EXE. What's more, Visual Studio includes Setup project templates
that make it easy for a developer to author the script that installs his product on the Production server--after all, who better knows how an application should be installed on a server than the developer himself?
So, on my clean build machine, I have MSBuild
or, perhaps, Nant
compile my source code, run my unit tests, and maybe even do some code analysis. Once that's all done, I have MSBuild use the instructions of my Setup project to build my MSI and...er, that didn't work? You mean to tell me that MSBuild can't build my Setup project
?! Well, that's just nice. And what's Microsoft's suggestion: use devenv.exe
. Yes, once again, sully my formal build environment with the Visual Studio IDE. Frustration #3: MSBuild can't build my MSI
So, now, I either have to scrape together more dollars for a commercial product like Wise
or learn to grapple with Windows Installer Xml
(there do appear to be some MSBuild tasks
for building WiX artifacts, though).
Confound it, Microsoft! You have great tools, but your build and deploy story is a Grimms fairy tale
! Ok. I feel a little better (not really). If I'm totally off track here or if you have any better suggestions, please let me know.