Test-Driven Development with Continuous Deployment


Continuous Delivery Album Cover

Continuous Deployment (CD) and Test-Driven Development (TDD) are two of the most powerful practices we use at Industrial Logic.

Both of these practices help us rapidly deliver value to users while significantly reducing the stress of programming and releasing to our production environment.

Over the past year, I've been observing how CD has changed the way we work, especially how we program.

One of the most significant changes CD has had on our working style is how we practice TDD.

Being long-time practitioners of Extreme Programming, we are used to continuously integrating all day long. However, when you're doing CD, every integration goes live (provided it passes the tests).

 
Does that mean you now TDD code for longer periods of time without integrating?
 

Not at all. We integrate as much as we ever did before we introduced CD.

When TDDing code, we stop every now and then to decide if we can safely release what we've built. Much of the time, we can, even if it is unfinished. This means that our TDD rhythm isn't always RED, GREEN, REFACTOR. Sometimes it is RED, GREEN, RELEASE. And right after doing that, we may engage in several cycles of REFACTOR, RELEASE.

By making it painless to release early and often, CD changes how we evolve production code.

I often say that evolutionary design is one of the most important practices in being Agile. TDD is a great tool for practicing evolutionary design. Combine it with CD and you get an even better way to evolve your software.

My colleagues and I have been working on a Continuous Deployment eLearning album. If you'd like to know when it is available, follow me on twitter (@JoshuaKerievsky).