Tools Still Matter
Last week, I facilitated the Open Spaces at the awesome CodeMash conference. The theme of the Open Spaces was “Techniques Not Tools.” While I certainly agree with the sentiment, I still believe tools matter.
In my professional development, I work in .NET 1.1 using Visual Studio 2003 and I assure you there are limitations imposed by the tools. I am still able to build software that I am proud of, but it could be easier.
I’m currently setting up a new development VM and I thought I would share the configuration settings I use. I start by installing Visual Studio Team System 2008 Development Edition. I probably don’t need anything more than the Professional Edition, but there are some tools in the Development Edition that have been useful in the past.
I immediately install SP1 before I even launch Visual Studio. Once I launch VS, I choose C# developer settings. After the incredibly long wait, the UI appears and I make my way straight to Tools –> Options.
Under Environment/General, I uncheck animate environment tools.
Next, under Environment/Startup I select “Show empty environment.”
Under Projects and Solutions/General, I set the “Visual Studio Projects Location” to C:\Development.
Next I go to Text Editor/All Languages/General and turn on Auto List Members, turn off Hide Advanced Members and turn on Parameter Information. I also turn on Line Numbers and turn off Navigation Bar.
In Text Editor/All Languages/Tabs I set indenting to Smart, Tab Size and Indent Size to 2 and select Insert Spaces.
After closing out of the options dialog, I go to Tools-> Import and Export Settings where I import Brad Wilson’s Dark Consolas theme for VS2008. I will frequently tweak the font size depending on whether I am doing a presentation, but in general, I use the defaults from Brad’s settings file.
Now it is time to close Visual Studio and install Tortoise SVN and reboot. After the reboot, I install Visual SVN and Resharper. Both of these tools cost extra and both are more than worth the money. Because I don’t do any commercial development on this VM, I could install the personal edition of TestDriven.NET, but I have found that I get value from the emotional reinforcement of watching the green line grow in the Resharper Test Runner.
The last step in setting up a clean Visual Studio Install is to launch the IDE, go to View –> Toolbars and turn off all the toolbars. You will have to do this multiple times because different toolbars are active at different times. You do not need toolbars, and they are probably slowing you down. Learn the keystrokes. You will be a more productive developer as a result.
Finishing up, I install the Web Deployment Projects, Power Commands and the VS Command Shell extensions. Finally, I close the toolbox because every time I accidentally mouse over the damn thing, it slows me down.
Productively,
++Alan
Getting Started With TDD in Visual Studio
I’ve given talks on doing test-driven development (TDD), and I’ve had lots of conversations with other developers interested in giving it a try. What I’ve found is that the simple setup and configuration hurdle is intimidating to most people at the start. In this entry, I intend to remove that initial hurdle (and excuse).
The professional version of Visual Studio 2008 now includes MSTest unit testing framework. I’ve been working with MSTest since the release of Visual Studio 2005 Team Developer Edition. If you want to get started doing TDD in Visual Studio, I recommend you get the Professional version of VS2008 and learn MSTest. I’m not recommending MSTest over any other unit testing framework. I am asserting that the easiest way to get started is to use an integrated tool.
Unfortunately, purchasing the latest and greatest from Microsoft is too large a commitment for many people coming to TDD or Visual Studio for the first time. I believe that TDD is essential, and I want to remove as many barriers as I can for people interested in implementing TDD in their development practice. To that end, I have created project and item templates which enable a simple TDD workflow using the FREE NUnit testing framework and the FREE Visual Studio 2008 Express editions.
It should be noted at the start that I could use some VSX-fu to enable even more automation in the standard edition of VS2008, but the license expressly forbids the use of VSX APIs in the express editions of Visual Studio. If you already have the standard edition of VS2008, or the standard or professional editions of VS2005, check out testdriven.net for seamless integration of NUnit, and several other unit testing frameworks, with Visual Studio. For this discussion, however, we will stick with templates to avoid angering the “powers that be” in Redmond. That being said, the templates and instructions for their use should work as advertised in any version of Visual Studio 2005 or 2008.
You will need to download and install the express edition of Visual C# (or Visual Basic) from here. Next download this version of the NUnit framework and install it into the default location. The references and paths in the project and item templates are specific to the 2.4.3 version of NUnit. Finally, you will need to grab my templates and extract them.
There are four templates which are zip files, so don’t extract them individually. There is a project template and a new item template each for C# and Visual Basic. I will be using the C# templates for this walkthrough, but everything here applies equally to VB.
You will need to manually copy the templates to the appropriate folders. Typically user templates reside somewhere under Documents/My Documents. You can verify the location by opening Visual C# Express Edition, selecting the tools menu, then the options pad. In the resulting dialog, check show all settings in the bottom left corner. You should now be able to select the Projects and Solutions node in the treeview. This will display the current locations for item templates and project templates.
Once you know the proper template locations, copy NUnit Test Project – CS.zip to the project template location and NUnit Test Fixture – CS.zip to the item template location. If you have touched all the bases to this point, you should see the new project template option when you select the file menu and click the New Project pad.
Select the NUnit Tests template under My Templates, give the project a name and click OK. After the generation process is complete, press F5. After a brief pause for compilation, the NUnit form should display and run the tests. You can then enjoy watching the default tests happily fail. Close the NUnit form to return to the IDE.
If you open the <projectname>.cs file, you will see a test fixture (class) with three default test methods included. You can add as many tests as you want to this class, but you will probably want to group your tests into separate classes. When you want to add another test fixture, simply right-click on the project and select add -> new item. You will most likely have to scroll to the bottom of the item templates list to find the NUnit Test Fixture listed under my templates.
I like having my tests run on every compile, but you may want more options. If you add a new NUnit test project to an existing solution, you will need to configure the solution for it to launch the NUnit GUI as the default start action. Alternately, you can configure the solution to launch the currently selected project. Right-click the solution in Solution Explorer and choose properties. There you can select the Unit Test project if you want a single startup project. You can choose the Current selection to have more control, or you can choose the multiple startup projects option, if you are feeling especially frisky.
If you have made it this far, then you have everything you need to practice TDD in Visual Studio. From here, I recommend you get familiar with NUnit by reading their documentation. Next, you should learn more about TDD and how to be effective with it. I have compiled some extensive bookmarks for your convenience.
I hope this tutorial has helped eliminate your concerns and alibis over taking the TDD plunge. I want to make it as simple as I can for interested developers to get started. If you have any feedback or suggestions for this entry, please post it in the comments so that I can make this a “go to” reference for aspiring TDDers.
Cheers,
++Alan
What’s Up at Windows Live?
I don’t write blog posts from my desktop PC (or anywhere else, honestly) very often. I wanted to make a post about some progress I made with the VSX, but I noticed I had an old beta of Windows Live Writer installed on this box.
I downloaded what appeared to be the installer for Live Writer here. Upon download completion, I began the install only to be prompted to set my default home page and my default search provider to MSN and Live search respectively. While I don’t like an installation routine trying to change unrelated settings, I will credit the Live team for at least prompting me. I won’t install anything from Yahoo after they changed my home page and search provider without asking.
Moving on, I encountered a screen asking if I wanted to install additional software with all the boxes checked, of course. I unselected the additional packages, and looked for a “next” button without success. I tried cancel, but that wanted to exit the whole install.
I stared at the same dialog while it apparently checked to see if I had Messenger, Writer and Sign-in Assistant already installed. I don’t why it took so long to check, it obviously new they were installed because they weren’t listed in the additional products section.
This “Checking for installed products” went on for far too long. Eventually the installation began, with an update to Messenger that I did not ask for, nor particularly want. Why does Microsoft continue to insist that they have the right to install un-requested updates on my machine. At least with the Microsoft Update site I can decline updates.
In the end I have the new version of Windows Live Writer that I wanted. It “only” took 41 minutes to install! What is up with that? Who thought this would provide a good UX (user experience)? WTF?!?!?
Grrrrr,
++Alan
[Update] It appears that I took issue with the install experience the last time I updated my Live Writer install.




