Controlling Your Software Development Environment And Release Cycle In An Agile Way
Fear Of Deployment
When you start working on a new project there are four really important pieces of information you should be aware of regarding the deployment of your software
- Are you unafraid of deploying your code to production?
- Do you know how your code will react in your production environment with production configuration?
- Does your code react in the same way in your production environment as it does in development?
- Are you confident in the repeatability of your installation procedure?
Fear and uncertainty in the deployment of software projects is a common theme I’ve seen across all the companies where I’ve worked and it’s never good for your project. The fear of deployment is always a good indicator of the confidence your staff have in the project they are working on.
A project with unknown qualities and suspicious (or known but unreported) bugs often causes an serious fear of deployment. There’s nothing like the fear of deploying an application and reducing a business critical system to it’s knees.
I’ve worked on a handful of projects where I’ve taken it upon myself to reign in this deployment fear and chaos, and more often than not, the fear has it’s roots in an uncontrolled development environment.
Configuring A Development Environment
I have very few suggestions regarding which tools you should use to develop your software. I think that you gain the maximum benefit by allowing developers to pick and choose the absolute best tools for the job, be that technically or by preference. Allowing developers to use their tools of choice makes happy developers.
By contrast however, the one thing I’m really certain about is that every development environment should start with an absolute base configuration that should not be changed. This is the first way to solve the eternal “works on my machine” developer problem. In essence, if all the development environments start off the same, there’s no excuse for a “works on my machine” error. Not only will this reduce friction between team members, but it’ll speed up the development process because you’re all working to one known configuration.
Furthermore, the development environments alone shouldn’t share this configuration, they should share the base configuration with your production servers. A huge percentage of software release issues are relating to the differences between production and test and development and the only way to solve what amounts to human error is to make this discrepancy go away.
In the current IT landscape where virtualisation is painfully simple (and often free) there are no excuses not to have a development environment (or at the very least development staging virtual machine) that accurately and completely mirrors your production server. If you’re struggling with licenses of third party software, produce mocks / proxies / approximations. I can assure you that the time you spend building these glorified testing rigs will work healthily towards eradicating development-to-production errors.
If It’s Worth Doing Once, It’s Worth Doing Three Times
Another nasty pattern I see frequently is the development-to-production pattern. If you’re compiling software on your development machines and releasing it to production, “you’re doing it wrong”. What’s worse than a “works-on-my-machine” conversation with a colleague? You got it, a “works-on-my-machine” conversation with a system administrator. It’s not an excuse. Stop it.
You need to start dog-fooding your deployments, and this means environment cloning and real test servers. I always follow a simple pattern; developer machine -> developer test box -> system-test box -> user acceptance test box -> production.
In order to do this you’ll need a series of environments (physical or virtual)
- Developer machine
- Developer environment
- Test environment
- UAT environment
- Production environment
That might sound like a lot of hardware but it really isn’t. Use virtualisation and use it well. Clone your virtual environments if need be. Use snapshots and rollbacks to test deployments. It shouldn’t take any time to administer (and I’ll explain why in the next section) and by the time your code is running on production you’ll have moved it through three different environments. This is absolutely key to having faith in your deployment procedures. When you’ve deployed your code so many times that you’re sure it works, in an environment that’s a mirror image of production, production is a far less scary place to be deploying to.
The key to this technique is that the environments all have very clearly defined purposes. The developer produces his code changes to a system on his development box. The code seems to work so it’s deployed to the developer environment and checked into your source control repository. The development environment should be treated as a place where things could potentially get messed up, but it’s also a good place to host joint resources (a database, some middleware) that all the developers make use of. If the code works in the developer environment it can be promoted to the test environment for the system tester (or a developer wearing a system testers hat) to test. Once passed on the test box, the code changes can be promoted to the UAT environment for users to preview coming code releases. Once these changes have been accepted, the code is released into production.
Beware of release insanity. It makes perfect sense to frequently deploy to the developer environment but only occasionally promote code up to test and UAT. This should fit around your way of working, just be sure to keep the conceptual integrity of the environments. If you find a bug in test, don’t fix it in the test environment, fix it in development. It’s up to you to ensure you know what code is running across your environments to avoid any nasty surprises.
One Install To Rule Them All
At this point you’re probably thinking that this all sounds like a huge amount of effort but it isn’t. The reason it isn’t is that you should, for the most part, be able to deploy your entire system in about 5 clicks / commands. Don’t let your deployment mechanism be the week link in your application. There are tonnes of install technologies on the market, both free and costly, to match whichever platform and tool chain you’re working in.
I wish I could remember where I read it, but one of the pieces of setup advice I read long ago that always stuck with me is that you should aim for a one-click install. You might not achieve it, but you should aim to get very very close.
You need to invest time in configuration management for your application. Build tools to auto-generate configurations for your deployment environments, build tools to automate setup and deployment. These tools are worthwhile, because from the moment they’re built, you never need to worry about deploying your software. They remove risk, and anything that removes risk from software development should be embraced.
Once you’ve build these tools and installers you’ll find your able to do things that you only thought were possible in large companies with seemingly limitless resources. You’ll be able to configure nightly builds using a continuous integration package of your choice and have the nightly builds install themselves in your developer environment, You’ll be confident that at any point you can provide a working copy of your software on request.
No Fear Of The Unexpected
The wonderful benefit you get at the end of this process is confidence in your software.
So you’ve released your system to production, do you then feel the need to slavishly test the system in
the live environment?
Imagine that urge going away, knowing that by the time the code hits production that any environmental glitches that could manifest have had the ability to fail three times already. Any amount of cursory testing you could perform at this point should pale in comparison to the testing you did in the test environment and the user testing environment. If your “at a glance” testing somehow discovers a bug, you’ve done something very very wrong in the lead up to release. You should be confident in the fact that your code has been run exhaustively and often by the time it’s reached production.
The world isn’t perfect however, and it’s obviously advisable to a quick audit of the software once installed, just don’t force yourself to repeat your system tests in production (an obvious anti-pattern) and you’ll gain no benefits from doing so.
If you can devise an automated tool to verify your deployments after install, you’ll be able to round off your sense of deployment-security.
A Zen-like State Of Satisfaction
I opened this piece with a few simple questions.
- Are you unafraid of deploying your code to production?
- Do you know how your code will react in your production environment with production configuration?
- Does your code react in the same way in your production environment as it does in development?
- Are you confident in the repeatability of your installation procedure?
I can answer yes to all three questions because I understand my environments and I hope you can too.

March 23rd, 2009 at 2:30 pm
Hi David,
I appreciate coming across posts like yours as it helps foster discussion around the software release process and configuration management. I’m biased to the version control and change management product for complex parallel, geographically distributed and Agile development known as AccuRev, as I am hte company’s corporate communications manager. One very simple low level feature this product provides is the ability to “Keep” a file to your local workspace as many times as you like before integrating with the team.
Let’s say you have just finished something and you aren’t ready to commit it just yet, but you want to version it. In AccuRev, you just do a Keep to create private versions. Do it as many times as you want. When you are done, you do the commit (we call it promote) and it is just as though you never had a private stream (branches in other tools) and it is just like you no longer have a private stream. So, most of the time you might do update/commit and then sometimes you will want update, keep, and commit. Some folks really like keep and they will have update, keep, keep, keep, keep, keep, and commit (and then perhaps
a bit more keep).
When you create private versions you can then do things like revert back to a prior keep, diff against prior keeps, annotate, see comments, let other folks see your private versions, access your private versions over the Web, and generally do all of the operations that are usually only done against public versions you can now do with your private versions.
If parallel development is becoming a tricky endeavor, or if you have remote teams that are always getting bogged down or you’re unable to reallocate resources or projects easily, take a peek at the tool sometime by reviewing the 2-minute demo at the link above on my name.
Thank you again for a great educational post.
Alex
March 23rd, 2009 at 6:49 pm
David,
Great post! I definitely subscribe your advice to “aim for a one-click install”.
If you manage to set-up your environments in a way that your deployment process is almost all automatic, then you’ll reach a state of Deployment Zen.
The more you automate deployment, the more Agile you can be (fear of deployment makes it impossible to follow an Agile methodology where you are expected to release often – to any environment).
I think that the problem you describe has also to do with the divide between the development and deployment activities.
These are still looked at as separate pieces, and usually have different people working on each of them.
I think that’s one of the break points that limits the ability to automate the process.
At OutSystems we’ve been following the 1-click Mantra for a long time. When we include a new feature into the Agile Platform, we make sure it has zero impact on the deployment automation.
Today, deploying a web application (and rolling it back to a previous version) is really a 1-click activity.
Check this video to see how it looks like http://www.outsystems.com/evaluationcenter/DemoScreen.aspx?SelectedMovieFolderId=4506 (you’ll need to fill in a small form to see this one).
You can also take a look at this other video, which also shows the 1-click-deployment process in action and doesn’t need any sign-up http://www.outsystems.com/evaluationcenter/DemoScreen.aspx?SelectedMovieFolderId=4504
Let me know what you think!
Michel
September 30th, 2009 at 4:00 pm
I am glad you can answer yes to all three questions, shame there are four, I think that is what you meant
James