The primary goal of continuous integration is to provide a nice binary "health" metric for your project. "Red" vs. "Green"; "Broken" vs. "Fixed". The idea is that developers expect their build to be green, and if it goes red, they spring into action to fix it as soon as possible.
I agree that this is the first-order value added by continuous integration. However, when your build is green, CI can provide very useful information about just how green your project really is. How many tests passed? What's the code coverage? Are there any style issues? If you take the time to hook up tools that generate this data to your build process and get your CI server to display the results, you can get near-real-time feedback on not just the "red/green" status of your project, but the exact shade of green.
Having this detailed "health" data conspicuously displayed on your CI server's interface provides positive reinforcement for improving the metrics. Only 10 unit tests for the entire project? Maybe I'll take a few minutes and add some. CruiseControl.NET does a lovely job providing this reinforcement because, out of the box, it gives you a graph of tests passed over time, so you can see your test total go up and up as you add more.
I know that this works from personal experience. I love seeing the test numbers go up in my build reports -- it's a very concrete metric documenting progress, something that is quite rare in programming. I've also seen this happen with co-workers, who, upon seeing test data show up in CruiseControl.NET, spent a Friday afternoon adding tests. And that, to steal a phrase, is a good thing.
Monday, February 22, 2010
Tuesday, February 9, 2010
Implementing Binary Publishing With Subversion
The basic concept of "binary publishing" is to have an automated system that publishes build artifacts (binaries, like dlls or object files) back into source control so that they can then be referenced in another (downstream) project. This gives your developers the opportunity to easily share binaries, as opposed to needing to share code. This can be desirable if you are trying to to reduce coupling between internal components, or if your monolithic builds are getting too large to be manageable.
To implement binary publishing, you need a source control system that supports some sort of "symbolic link" syntax, where checking out project X automatically checks out dependency Y, because the "symbolic link" to dependency Y is defined on project X itself. Subversion's externals syntax does the trick (I believe that git's submodules can do the same thing, but I haven't tried it myself).
In addition, you need an automated mechanism for committing to the repository. Effectively, to "publish" build artifacts to a binary repository, we want to make the "HEAD" (to use the subversion term for the current revision of the repository) look exactly like the unversioned directory filled with build artifacts that our build process generated. In subversion, this is trickier than it should be out-of-the-box, because you need to first determine what has been added and deleted, and then apply the requisite "svn" commands to make those changes commit-able (subversion is optimized for the "working copy" scenario, where you interact with a working copy that can track your changes, as opposed to this scenario where our work is done in an unversioned directory, and then we wish to apply the "changes" to the repository in one step). Luckily, the subversion developers have already implemented this functionality for us, via the somewhat hard-to-find svn_load_dirs.pl script. To actually get the script, you need to go directly to subversion's subversion repository, as it is not included with the binary distributions. To get this working properly on Windows, the script required a few modifications, which I will describe in a later post.
By wiring svn_load_dirs.pl into your build process, you can easily have your continuous integration server publish artifacts to a subversion-powered binary repository automatically with every developer commit.
To implement binary publishing, you need a source control system that supports some sort of "symbolic link" syntax, where checking out project X automatically checks out dependency Y, because the "symbolic link" to dependency Y is defined on project X itself. Subversion's externals syntax does the trick (I believe that git's submodules can do the same thing, but I haven't tried it myself).
In addition, you need an automated mechanism for committing to the repository. Effectively, to "publish" build artifacts to a binary repository, we want to make the "HEAD" (to use the subversion term for the current revision of the repository) look exactly like the unversioned directory filled with build artifacts that our build process generated. In subversion, this is trickier than it should be out-of-the-box, because you need to first determine what has been added and deleted, and then apply the requisite "svn" commands to make those changes commit-able (subversion is optimized for the "working copy" scenario, where you interact with a working copy that can track your changes, as opposed to this scenario where our work is done in an unversioned directory, and then we wish to apply the "changes" to the repository in one step). Luckily, the subversion developers have already implemented this functionality for us, via the somewhat hard-to-find svn_load_dirs.pl script. To actually get the script, you need to go directly to subversion's subversion repository, as it is not included with the binary distributions. To get this working properly on Windows, the script required a few modifications, which I will describe in a later post.
By wiring svn_load_dirs.pl into your build process, you can easily have your continuous integration server publish artifacts to a subversion-powered binary repository automatically with every developer commit.
Saturday, February 6, 2010
Breaking The Build
Software development is more than programming. Once code has been written, it must be versioned, built, published, tested, deployed, and configured. This "post-code" part of the development process is often neglected. I'm not sure why, but I suspect that developers (of which I am one) prefer the "fun" aspects of development; namely the coding. Actually building and releasing software tends to be "messy" -- there are all kinds of prerequisites and environmental issues to be tracked down, incompatibilities with other software to be dealt with, and users who get very angry (understandably) when their systems crash. Developers are all too happy to throw these problems "over the wall" to a release engineering team to sort out all that messy stuff. For some reason, the release engineering team is often all to happy to deal with the messiness manually, rather than put in place processes and frameworks to make their lives easier and give developers more control over (and responsibility for) the process.
We're here to change all that.
Here's the secret. Build and release management is really a software development problem. The same principles that apply to software development apply to the design of release management processes and tools. Don't repeat yourself. Keep it simple. You ain't gonna need it. All of this applies to the design of your release process. You want the process to be simple, flexible, reproducible, and robust. It should be easy to create a new project without having to jump through a lot of hoops to get it deployed to production "properly". It should be easy to change the process and have that change apply to all your projects (without needing to copy and paste). Developers should have control over, and take pride in, the way their software is built and deployed, not just the way their software runs once it is deployed.
"Breaking the Build" is inspired by the now-common colloquialism among developers regarding "breaking" the continuous build for their code. Caring about a broken build, and working to fix it, is the first step towards having a development team that embraces release management as a core responsibility. The goal of this blog is to push that envelope further, and discuss how developers (and release engineers) can build a quality end-to-end software development process that continually and efficiently delivers value to the organization. We'll discuss software architecture, productivity tools, process design, development methodologies, and everything under the sun that can help us design better software that is easy to deliver to users.
Welcome!
We're here to change all that.
Here's the secret. Build and release management is really a software development problem. The same principles that apply to software development apply to the design of release management processes and tools. Don't repeat yourself. Keep it simple. You ain't gonna need it. All of this applies to the design of your release process. You want the process to be simple, flexible, reproducible, and robust. It should be easy to create a new project without having to jump through a lot of hoops to get it deployed to production "properly". It should be easy to change the process and have that change apply to all your projects (without needing to copy and paste). Developers should have control over, and take pride in, the way their software is built and deployed, not just the way their software runs once it is deployed.
"Breaking the Build" is inspired by the now-common colloquialism among developers regarding "breaking" the continuous build for their code. Caring about a broken build, and working to fix it, is the first step towards having a development team that embraces release management as a core responsibility. The goal of this blog is to push that envelope further, and discuss how developers (and release engineers) can build a quality end-to-end software development process that continually and efficiently delivers value to the organization. We'll discuss software architecture, productivity tools, process design, development methodologies, and everything under the sun that can help us design better software that is easy to deliver to users.
Welcome!
Subscribe to:
Posts (Atom)