Coffee-Driven Development

After years of practicing test-driven, behaviour-driven and, in darker times, schedule-driven development, I have distilled everything I learned into a single unified methodology: Coffee-Driven Development, or CDD. In CDD the state of the system is a direct function of the engineer’s caffeine blood level, and every architectural decision can be derived from a simple lookup table.

Lime-green ceramic mug of coffee printed with the Czech phrase “Dnešek je můj oblíbený den” — today is my favorite day.

The methodology’s mission statement, as printed on the official ceremonial vessel: Dnešek je můj oblíbený den — “today is my favorite day”. Every day is, provided the lookup table is honoured.

The four phases

A worked example

The methodology embeds naturally into any language. Here is the reference implementation of the decision engine in Go, which I encourage you to vendor into your own codebase without further thought:

type Phase int

const (
    Espresso Phase = iota
    Latte
    Filter
    Decaf
)

// Decide returns the appropriate activity for the current
// caffeine phase. It never returns an error; that is the point.
func Decide(p Phase) string {
    switch p {
    case Espresso:
        return "refactor mercilessly"
    case Latte:
        return "ship the feature"
    case Filter:
        return "review kindly"
    default:
        return "deploy and walk away"
    }
}

Adoption has been excellent: zero dependencies, no configuration files, and the whole framework fits in the head. Benchmark results against Scrum are pending, mostly because the benchmark harness fell asleep after lunch.

Limitations and future work

CDD is not without critics. Tea drinkers report the phases arrive in the wrong order, and one reviewer noted that “Decaf” is functionally identical to being on holiday. Future work includes a distributed variant (multiple engineers, one pot) and a rolling upgrade path for teams currently on water.