Paul Julius > Blog

Cup of Coffee Metric for Continuous Integration

September 14th, 2009

How much can you learn in the time it takes to get a cup of coffee?

How much can you learn in the time it takes to get a cup of coffee?

What happens in the time it takes to get a cup of coffee can tell you a lot about the quality of your continuous integration system. Try something out for me. Commit some code. Leave your desk to get a cup of coffee, or some other tasty beverage. When you get back to your desk, do you know whether your changes were any good? No? Yes? I hope so, and so should you. It’s called the cup of coffee metric.

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.

Enterprise CI Culture Maturity Model

September 14th, 2009

Feature Branches are Poor Man’s Modular Architecture

September 3rd, 2009

Refactoring CruiseControl Configuration Files (From Agile 2009 Demo)

September 1st, 2009

CITCON Paris 2009 Almost Here

September 1st, 2009

“The CI Guys”

December 1st, 2008

CITCON Amsterdam Almost Here!

September 4th, 2008

Got CI, TDD, Pair Programming, …?

February 11th, 2008

Accepted New Position at Stelligent!

October 22nd, 2007

CruiseControl 2.7.1 Final Release

September 4th, 2007