10.1. Maintaining an EnvironmentThe useful life of the tools that make up a development environment is generally much longer than the life of the products that were created using the environment. No one wants to have to use a different bug tracking tool or a new build tool for every different release of the product. However, environments and their tools do age with time, and as tools are replaced with other tools, the environment gradually changes. The environment that you wrote code in 10 years ago is not the same one that you use noweven Emacs and vi have changed in that time. It's also probably faster now than it was back then. What's important is that older tools and their environment still have to be maintained until all the products that were developed with them are no longer supported. It's very frustrating to spend time learning about an older version of a product and making changes to the source code, only to find that you're unable to build and test that version, or that something else has changed in the environment and now you have to spend time working out what it was. Part of maintaining an environment is checking that the versions of the tools that you use are still supported. Using the latest version of any tool is somewhat risky, but is acceptable if the tool does just what you need it to. However, beware of the total amount of time that can be spent upgrading to every new version of a tool.
The more common case is environments that are set up but never maintained until some key tool stops working. Then the pressure to solve the problem, along with the ensuing discussions about fixing or replacing the tool, can greatly distract people from developing the actual product. Instead, it's far better to regularly monitor all the tools that are used, and to maintain a sense of the effort and cost to make particular changes to your environment. You can then decide whether to postpone upgrades and deal with the inevitable crises, or to spend the time to gradually upgrade tools before they break. Also, mistakes happen and priorities change in a project. If you have a good understanding of the costs of changing the environment's tools, then you're better placed to deal with these unplanned changes. Some estimated life spans of different kinds of tools in a typical small to medium-sized project are shown in Table 10-1. These are the times before the tool is replaced with an entirely new tool, not just the intervals between upgrades. The values are subjective, based on my own experience and observations about when the larger open source projects have changed the tools in their development environments over the past 15 years.
Ideally, a development environment's own SCM tool should be able to track all the changes in the development environment, including changes to the SCM tool itself. In practice, many of the tools used in an environment are inconveniently large for tracking with existing SCM tools. Operating systems can be checked in to SCM tools but they rarely are, for just this reason. In this case, making copies of the important disks, CDs, and DVDs is appropriate. Another approach that's quicker when you want to reproduce an environment later on is to use Norton Ghost, g4u, or VMware to create copies of key machines, and then to store those copies elsewhere. Even if the original files for the tools themselves are too large for your SCM tool, you can use files that describe the environment, and these files can be controlled using your SCM tool. One approach is to use a collection of files named the environment documents. Some of these files are updated by hand (for example, when processes and policies change). Other files can be automatically updatedfor instance, if the build tool generates a list of tools used and their versions. This is also a good place to record the location of copies of large tools. Another aspect of a development environment that needs to be regularly maintained is the test environment, since making changes in an older environment is doubly hard if you don't have the same test environment that was originally used. Just as with the current environment, it's important to be able to use both development and production machines in an older environment. 10.1.1. Migrating Your DataThe purpose of many tools such as SCM tools and bug tracking systems is to make stored information easily accessible. Part of maintaining an environment is migrating data from one tool to another as you change which tools are in active use. Good practice with data is to use well-defined and open (i.e., license-free) file formats. Structured ASCII text, XML, and Ogg Vorbis for audio are all examples of open formats. Before adding data in whatever format a specific tool uses, you should ask yourself how you could extract the data in the future. Many tools such as Microsoft Word use proprietary formats that only tools from the creator can fully understand. This is, of course, part of the sales strategy for such tools: if you can't extract your files and data from the tool, you are locked in to the tool and can be forced to pay for upgrades, generating more income for the product. The simple test of how easy it will be to migrate away from a tool is to search the tool's documentation for "export" and "Save As." Count the number of different formats that are supported and compare this to the number of different data formats that the tool can import. The numbers should be about equal. Data migration is one part of defining an exit strategy for the tools in your environment. You can't define the tools that you will use five years from now, but you can make it easier to change to those tools when you have to. |