7

I am 'relatively new' to unit-testing and TDD. Only more recently have I completed my first production application that has (at least in theory) 100% code coverage. I have done unit-testing in previous projects as well for some time, but not in true TDD fashion and with good code coverage. It had always been an after-thought. I feel I have a pretty good grasp on it now though.

I'm also trying to train the rest of the team on TDD and unit testing so that we can grow togeather and start moving forward with doing unit testing in all of our applications, and eventually progress to doing full TDD w/ automated builds & continous integration. I posted a thread here regarding my plan of attack / training agenda for comments & critisism.

One of the replies (in fact the highest voted) suggested I first setup infrastructure before I go forward with the training. Unfortunately I have no exposure to this, and googling on the topics is difficult because the pages for CruiseControl.NET / nAnt / etc do not really explain the 'why' we should set this up and the 'how' everything connects togeather.

We are a small shop (about 10 developers) and use almost exclusively microsoft technologies and do our development in VB.NET. We are looking to eventually start using C# but that's for another time. I've been using the MSTest project that comes with VS2008 for my unit tests, and I've been building my apps using Visual Studio, and deploying using MSI setup projects... We also (unfortunately) use VSS for our soure control - but that is also on the chopping block and I'd really like to get rid of it and use subversion.

I know that I need to use CruiseControl.NET for CI, and either nAnt or MSBuild for building the applications. And I probably need a build server to run all these builds. But I just can't find anything that 'connects' the dots and explains how they interact with eachother, what should be on your build server, when you should build with your build server (is it just for deployment builds, or even when you just want to compile the app you're developing after making a small change, on your local environment?). I'm also planning on axing MSTest as I've found it to be buggy and will use nUnit instead.

Can anyone perhaps illuminate this gap I have from 'knowing how to do TDD' to 'setting up the proper infrastructure so the whole team can do it and work togeather'? I do understand what continous integration is, but again, I'm not sure how a build server should be setup and how it connects with everything, and why we need one (e.g. the pitch to management).

thanks very much for your time.

What portion of finalbuilder do I need? It seems there's some overlap with final builder and teamcity. Finalbuilder server seems to be a CI server, so I'm guessing I don't need that. FinalBuilder seems to be a build server - but I thought TeamCity is also a build server... And Automise seems to be a visual windows automation tool, like some kind of development platform for winforms apps...

_I also don't see support for final builder in The Team City Supported Apps Diagram : _

Community
  • 1
  • 1
dferraro
  • 6,357
  • 11
  • 46
  • 69
  • 1
    I think following link contains fairly exhaustive set of information on this topic: http://martinfowler.com/articles/continuousIntegration.html – Tomas Dec 14 '09 at 18:36

1 Answers1

5

Take a look at a webinar I did a few weeks ago - How To Start Unit Testing Successfully. In that webinar I've talked about tools and unit testing best practices and it was aimed at developers just like you who want to introduce unit testing in their organization.

First order of business you want to put a CI (Continuous Integration) process in place and for that you'll need three tools:

  1. Source control
  2. Build server
  3. Build client/script

I hope you already have some form of source control in place so let's talk about the other two.

Build Server - checks the source control and when it changes (or some other condition met) runs a build script on some client (or same machine) there are several build server available I recommend JetBrain's TeamCity it's easy to install and use (great web interface) and is free for up to 20 developers (that's you).

Build Script - on your build client you want to run a build script that would build your solution and run your unit tests. TeamCity has some basic build & test capabilities but for more advanced options (build installer, documentation etc.) you'll need some script runner at work we use FinalBuilder - it's not free but has very good editor. If you're looking for a free alternative have a look at ANT or NANT - but be prepared to edit a lot of XML.

Other tools - Because an important part of successful unit testing is how easy it is to write and run tests on the developer's machines I suggest you check if there are better IDE's or external tools that would help the developers write & run their unit tests.

Dror Helper
  • 30,292
  • 15
  • 80
  • 129
  • 1
    +1 for TeamCity. We started with CruiseControl.NET and switched to TeamCity because it was so much easier to administer. NAnt scripts are pretty easy to edit, but you don't need to do much of it with TeamCity. – TrueWill Dec 14 '09 at 19:36
  • Thanks so much for the information. I edited my original post to note that we use VSS. Although i hate VSS =). I'm hoping to get subversion setup so we can finaly get rid of that buggy VSS. I do have a question though - do you use your build server to compile your own local builds as you develop? Or is it only for deployment builds? – dferraro Dec 16 '09 at 01:42
  • 1
    I do run the build script on my local machine but usually VS is enough for building and testing my project – Dror Helper Dec 16 '09 at 05:14
  • Have you ever used VSS as part of your infrastructure? The thing's a buggy POS that I've hated (lol). I want us to move to Subversion/VisualSVNServer/VisualSVN anyway. But I'm trying to decide if we should take on the source control move first before anything, or can it come after?...or will the former wind up causing problems because SS is tightly coupled with the tools mentioned above? Does VSS play well with the tools mentioned abovethese tools? I'm assuming there must be at least minor issues - hell; it doesn't even play wel with Visual Studio! ;)... Thanks again for the help – dferraro Dec 27 '09 at 06:55
  • First I think VSS works well enough with TeamCity and I know that it's supported by FinalBuilder. Having said that I prefer using P4 or SVN because they work better (at least for me). You can always change your source control tool later in the project but it would be a lot of pain. If you want to switch source control I suggest you do that as soon as you decide. Do a simple spike - keep VSS and try moving to a different source control and if it works dump VSS. – Dror Helper Dec 27 '09 at 18:48
  • BTW, I'm trying to watch that vid on the TypeMock site, but it doesn't render at all... not on IE or on Chrome... any idea? – dferraro Dec 30 '09 at 14:10
  • #deferro - works on my machine (chrome) try installing a new flesh player, it might help – Dror Helper Dec 30 '09 at 17:39
  • Dror - When you run your build scripts on the build client (e.g. final builder), are they running against your build server, or against a local compiler? – dferraro Jan 14 '10 at 20:55
  • Not sure what you mean, you could run the build script on your build machine but you should also have a CI (Continuous Integration) server that runs the script to make sure that it works in a non-development environment – Dror Helper Jan 15 '10 at 13:41