Duplicate Code

We have a suite of applications that we maintain for our customer. Each application has its own build script. This is pretty good since there is a code controlled way to generate a release. Any developer should be able to log into a configuration controlled machine and run the build script. Our project takes this further in that no programmers actually run the build. A separate configuration management team runs the build.

Recently we upgraded the tools we use for development. This has created the need to modify our build scripts to use the new tools to build the software. The script modification task has been distributed among a couple developers. It is strange that a number of the developers have asked me where exactly the build script code is located. These guys are not slackers. They did the work and searched our source code control system. The problem is that they found 3 separate copies of the build script code checked in.

Off the top of my head I did not know which of the 3 versions was the real build script code used for Production. Maybe this is written down somewhere. But it is definitely not documented in any well known location. I gave the developers my best guess as to where the build script code would be. But this has identified some break downs in our build process. The same code should not be duplicated in multiple locations within our source control system. And more importantly, the location of the code should be documented somewhere along with other details about the build process.

I truly do not know whether we will be correcting these process problems any time soon. It appears we are now in a rush to get the build scripts modified and working with the new tools. There is a schedule to keep that is critical. This reminds me of some similar problems in the actual code base of the applications. We have a number of functions that are duplicated in our code base. When the function is needed, one of the copies is called at run time. You can imagine the maintenance problems this will incur. If you fix a bug in one of the location, you need to know that the code is duplicated in many places, and track down and fix the code there as well. A lot of times this problem was created due to schedule constraints.