European industrial production line with successive automated quality-control stations.

Best Practices for Implementing an Efficient Continuous Delivery Process

AgileSoftware Engineering

Quick Take

Continuous delivery is not a tool or a fashionable label. It is the engineering discipline of making releases repeatable, tested and safe. These eleven practices span gradual adoption, testing, version control, peer review, feedback, release frequency, independent validation, pipeline reliability, communication, reproducible environments and continuous team improvement.

Originally published on AMIS Technology Blog, 24 March 2015. Full original article with minor spelling and grammar corrections.

In the past years I have been involved in the implementation and introduction of a continuous delivery process in a lot of software projects. The activities concerned with this are also labelled build automation, continuous integration or DevOps, depending on fashion and trends. Despite the jargon and popular buzzwords, I am convinced that continuous delivery practices are helpful for creating high-quality software in an efficient way. The following practices have helped me a lot with implementing these practices.

Here are eleven of my best practices for implementing continuous delivery. Please share your experiences in the comments on this post.

1. Step-by-step implementation

Implement the continuous delivery process in small, gradual changes. Do not use a big-bang or waterfall approach. First, work on several quick wins—the low-hanging fruit—then automate the steps in the process that will save you a lot of work and improve software quality by reducing the number of errors. Next, follow a step-by-step approach to automating the complete delivery process, each time focusing on a gradual improvement of the highest-priority issues.

This approach works best with an agile project approach. You can plan a small portion of continuous delivery work in every sprint. The team members and other stakeholders who are less involved in continuous integration and deployment automation have the chance to get used to this new way of working. This way you will get more buy-in during the implementation of the process.

2. Focus on testing

Test and review everything, and do it often. You are automating the entire process of software delivery all the way to production, so every error or misinterpretation could quickly have massive consequences. The frequency of the release and delivery cycle will increase drastically. To safeguard quality, a lot of automated testing is required, since you will no longer be able to perform thorough manual testing at such a high frequency.

When manual regression testing takes three days, you cannot keep up when you are releasing every four hours.

3. Version everything and commit frequently

Store everything in your version control system. The choice of version control software is less important than how you use it. Just choose one and use it properly. Using a file-share folder is no longer acceptable! Your version control system needs to contain every asset of development and deployment: design documents, code, database design, database scripts, environment configuration, test scripts, deployment tools and deployment scripts.

The only things you do not store in your source control are sensitive data or environment-dependent settings (endpoints, usernames, passwords). Use a release management tool for storing these settings. This means you need to store development settings, scripts and sources in your source control, in the same place as the rest of the software. Commit frequently and integrate early. At least twice a day, preferably more often.

Do not save your changes until the last day of the sprint, since your brilliant changes might break the rest of the code.

4. Peer review everything

Use your peers to review everything you make: designs, configuration plans, code, build scripts and delivery architecture. A peer review increases quality and contributes to knowledge transfer. Your team members will ask questions about your approach and methods, make sure the structure complies with the coding and architecture guidelines, and may find things you overlooked while working on the item that would otherwise lead to errors later in the deployment pipeline.

Along with this review comes the added value of knowledge transfer about the things you have created. By reviewing your code, another team member will automatically get to know your deliverable and become familiar with the changes. This will save time later when they have to work on the same code. A review checklist helps improve the quality of the peer review.

5. Accept feedback

A very important follow-up to the previous item: accept feedback. When someone provides you with feedback about anything, it is intended to improve the product or the process. Consider feedback a gift. Approach it with an open mind. Our natural tendency is to view negative feedback as a personal attack and not to accept positive feedback. Discuss this in your team and create a culture of accepting feedback as a positive step towards improving the product and/or the process.

Feedback can also be the opportunity to learn from your experiences and improve yourself and your team.

6. Speed up your frequency

When you are doing continuous delivery, speed up your frequency. See every run as a practice run for deploying to production. One of my favourite quotes from Martin Fowler is: if it hurts, do it more often. By increasing the frequency, you know it works because you have done so many trial runs. Also, the size of the changes is smaller when you increase the frequency. When something fails, you can pinpoint the origin more easily and trace it back to the change that caused the error.

This makes debugging, finding the error and solving it much easier.

7. Ask someone else to try your implementation

Always ask someone else to give your implementation a test run, even when it has passed the peer review stage. Handing your solution to another person and letting them run it without your direct supervision will unveil differences in interpretations, implicit preconditions and differences in environmental variables. Letting someone else try your software will also validate its documentation, functioning, structure and efficiency. A great test of your deliverable.

8. Always keep the delivery pipeline functioning

The top priority of any continuous delivery team is to be able to deliver software continuously. This is only possible when the complete pipeline is functioning all the way to production. When something interrupts or creates a bottleneck in the pipeline, the team has to fix this with the highest priority. Not because we like green lights on our dashboard—that is only superficial. When the pipeline is not functioning, the safeguards and controls on your codebase are not operational.

Adding more code in this situation will only increase the problem. So a functioning pipeline is the highest priority.

A release drill that reveals whether delivery really works

An automated pipeline is only useful when it produces a repeatable, recoverable release. Pick a representative change and follow it from commit to an environment that reflects production. Check whether tests run without manual intervention, whether configuration and dependencies are versioned, and whether the team can identify precisely which build is running. Then deliberately fail a test or interrupt deployment. The expected result is a blocked release, a clear diagnosis and a known route to recovery—not a developer quietly bypassing the pipeline.

Measure lead time, failed releases and time to restore service alongside deployment frequency. Those indicators should be interpreted in context, not used to reward reckless deployment volume. Ask a colleague who did not create the pipeline to reproduce the process from its documentation. If success depends on a private script or one engineer’s memory, the delivery process still has an operational single point of failure. Agile Principle 9: Technical Excellence and Good Design explains why simple, maintainable engineering practices make change safer.

9. Communicate your ideas

Continuous delivery is not something you do on your own. It affects the core of most development processes. You cannot change a process affecting many people without communicating with the different stakeholders. This is important not only for understanding the process and technology solutions, but also for developing a supportive environment for your changes. So share your ideas, explain what you are planning to do, explain your designs and solutions, and ask for—and accept—feedback.

You are probably working with a team of very smart people. Make use of this and let them contribute to your solution.

10. Virtualize

Iterative development, intensive automated testing and frequent deployment require an environment with a ‘reset’ option. You are going to use the test environment many times, often leaving it in a ruined state. It can be very helpful to have a procedure to recreate the environment in its original state. This will allow you to test the release and deployment more often, improving quality.

Virtualization helps implement this requirement through snapshots or scripting tools to recreate the environment from scratch. This is more of a challenge when using physical hardware.

11. Keep improving with your whole team

Continuous delivery is not a one-time effort. It is an ongoing project, evolving and improving step by step. It is not the effort of one team member assigned the ‘automation task’. It is the responsibility of the whole team to make software delivery as efficient as possible and to constantly search for ways to improve quality.

These tips have proved very useful to me, and I am sure they can help improve your process. Feel free to add your opinions and experiences below. I would love to hear them.