Skip navigation.

Automating the deployment...

C# | test driven development
[textile]How many times have you had to spend ages getting deployments to result in a working application on a new environment? Even worse, when it happens every time a new build lands on the test environment! I touched on this in "When the code first leaves the nest":http://www.testingreflections.com/node/view/2311 where I talked of Julian Harty's example of 3-4 days in a weekly build cycle spent just getting the environment to work. This is an all too common occurrence, based on my own experience and that of many of my peers.

On a project that I am working on, we had this idea... why not automate the deployments? Taking it one step further, perhaps the ability to deploy to test, staging and production environments could be defined as a technical user-story with associated unit and acceptance tests (afterall, it is a TDD project)?

Automated deployment seems to be the flavour of the month... During his presentation to the "British Computer Society Specialist Group in Testing":http://www.sigist.org.uk/, Amit Arora of "ThoughtWorks":http://www.thoughtworks.com/ mentioned this as a lesson learned from a large project that they had delivered for one of their clients. They found that integrating the system on the various test environments was taking far too long, so they started trying to automate the deployment.

In the May/June Issue of Better Software Magazine, Franz Garsombke talks of automating builds and deployments.

Automated builds isn't a problem for us, we have CruiseControl .NET for that but the deployments onto new environments can be laborious at times. This is especially an issue since we have 3 major system components, one of which (Verity) can distribute its services across several servers.

How are we going to do it? Well, we haven't worked that out yet... Ideally, we will find/build a tool that will allow us to deploy any successful build reliably to any of our environments and execute automated smoke tests once the deployment is a success. We also need to think about roll-back procedures... perhaps that is where our VMWare environment will show its worth.

If anyone has any success in automating deployments, particularly with C# .NET web applications using Verity search services (Java) or any other technologies, it would be great to hear about your experience... E-mail me at antony dot marcano at testing Reflections dot com or post a comment below.

Heading in the right direction

Antony,
Have a look at 'pragmatic project automation' by Mike Clark, ISBN 0-9745140-3-9, list price $29.95.

In this book he introduces a software project where the code is initially built, tested and deployed manually. He then introduces ways to automate each step in the process by using things like Ant, CruiseControl (which you've already mentioned), JUnit, WebStart (to create an installer), etc. Each chapter includes a worked example.
While his examples are written first for a Java-based development environment running on *NIX, he describes how to implement similar solutions on the Windows platform.

While I haven't personally implemented what he's done (as I have no need currently) I think the book is an excellent guide on how to achieve your goals :-)

And take a look at his web site (although he doesn't cover the topic as a single, cohesive discussion there, many of the points are mentioned).

PS: There are other books in the 'pragmatic programmer' series. They seem to be clear, helpful and concise. I've recently bought the one called 'pragmatic unit testing with JUnit' They've published a similar one called Pragmatic Unit Testing in C#
http://www.pragmaticprogrammer.com/starter_kit/utc/index.html
- see what you think...

Good luck
Julian Harty

Comment viewing options

Select your preferred way to display the comments and click 'Save settings' to activate your changes.