The idea is simple. In the about the amount of time it takes to get a cup of coffee you should be able to get information about the quality of your changes. Look at it this way. You just committed some work. You need a short break before you move on to your next task. You don’t want to wait too long, or you might find yourself surfing the web instead of writing code. So, leave your desk. Get a coffee. Take a bathroom break. See what’s hot around the water cooler. Once refreshed, return to your desk. You don’t want to move on until you make sure your last commit didn’t cause any immediate problems. A good CI system will support this behavior by giving you some feedback in about that much time.
The level of information may not be complete. Enterprise build systems are notorious for the length of their builds. Enterprise systems are also notorious for waiting to provide any feedback until the end of the build cycle. That sucks. A little information would be better than none. It might only be an initial piece of feedback, like “Your changes compiled!” If that’s all your CI system can get done in cup of coffee time, that’s better than nothing. Your CI system might tell you everything is going smoothly, only to return later to tell you something broke. No worries, sometimes that will be the case. Hopefully not always.
As a build engineer, I am going to try my darnedest to provide you with as much information as possible while you are getting your refreshment. That’s how I keep my team humming along. I might even use a “build pipeline” to help facilitate this sort of thing, but that’s an implementation detail. I am always asking myself, “What’s the most I can possibly discover about a commit within about 5 or 10 minutes from the time a developer presses the button?”
This idea came from Jeffrey Fredrick’s real life experiences. He and I co-present on various topics. We talk about CI a lot at CITCON, of course. Invariably we discuss the cup of coffee metric when talking about evaluating CI systems. I stole the idea from him for use in my consulting. (Most of my good ideas come from our community. Thank you internet!) With his permission, I figured it would make sense to write it up for the world. So, here you go.
