Guest Opinion

Build Early and Often

Is the continuous build model right for your shop?

Building software takes a hefty dose of black magic. Thousands of files and dozens of scripts all run in a specific sequence. If new files are added, or if new versions of libraries are used, all of the scripts must be revalidated,and the team goes through superstitious rituals as an extra step to ensure a successful build. The software might build locally, within Visual Studio, but the official build all too often is a patchwork held together by baling wire and bubble gum.

The two or three developers who build the software are looked upon with a combination of admiration and fear -- admiration because they have the mental capacity and organizational ability to keep it all straight, and fear because there has to be something just a little bit, well, different about someone who can do that.

It doesn’t have to be like that. You don’t have to keep making sacrifices to the gods of dependencies as a part of your build strategy. Instead, you can build early and often. Start building as early as possible in the dev cycle, when you have all or most of your files in place, and keep on building on a regular basis until you ship the software. Building regularly makes you confident that you can do so when it comes time to deliver the application. If you get into this habit, the last few builds won’t be so stressful.

The latest trend is continuous build. It’s what the name implies. On every check-in, you kick off a new build. Not a local build, which you’ve presumably already done, but a product build. You may object that a full build can take a couple of hours, but, in fact, intelligent build technology will build only those files that have been changed. Depending on the extent of the check-in, a build might take only a few minutes.

There are a couple advantages. First, you know you can build because you do it all the time. There won’t be any last-minute fire drills because the application won’t build when it’s due to ship. Second, your testers get to see the results of your work almost immediately. If there’s a problem, the code is still fresh in your mind.

Building continuously, or even nightly, probably isn’t going to get you to the finish line faster. You still have the same amount of work to do; you’re just doing it earlier and a little more rigorously. You might actually be losing any productivity gains by spending more time investigating and fixing build breaks.

It’s probably not going to mean a product with fewer bugs. Granted, frequent, regular builds help you find bugs sooner, and fixing some of these early might save you bigger headaches later. But the process won’t completely stop bugs from making it into the code base.

What continuous build does is make the development process more predictable. If you know that you can build the software, then there’s never any doubt about your final steps in the process. Building frequently takes the uncertainty and guesswork out of actually putting your software together. Writing code might take longer than estimated, or requirements might change, resulting in changes to the development schedule, but if you know you can always build, that takes some of the uncertainty out of your process.

Continuous or at least frequent builds are an important component of agile development methodologies. If you’re going to deliver a new version of the software every two or four weeks, it’s best if you have built the software a few times during that interval.

Is it worth the effort to change your processes to build nightly or continuously? That part is up to you. But if you’re only building at major milestones today, that’s probably not enough. And if your build process breaks more often than it works, you’re probably spending too much time fixing broken builds, and not enough time building. Finally, if you have difficulty getting to the end of a project, and the delay is costing your company money, nightly or continuous builds are a must. I guarantee it works better than black magic.

About the Author

Peter Varhol is the executive editor, reviews of Redmond magazine and has more than 20 years of experience as a software developer, software product manager and technology writer. He has graduate degrees in computer science and mathematics, and has taught both subjects at the university level.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube