DevOps is going places. There is no doubt about it.
Every organization wants to adopt this practice, but ‘how to’ is one of the critical questions that they fail to answer.
“78% of organizations fail to get DevOps right.” ~ Tech Republic
DevOps is not just a methodology, rather it is a cultural shift that motivates an organization to Change fast, Build fast, Test fast, Fail fast, Fail better, Recover fast, Learn fast, and Push the software/product fast to the market.
And it all starts with Packaging, Continuous Integration (CI), Continuous Delivery, and Continuous Deployment (CD).
Note, all these are separate methodologies used in harmony while working on software product development.
However, while going through a number of trending articles based on Continuous Integration and Continuous Deployment, we came across a common connection between all those articles: combining CI and CD into the same word group (CI/CD), which might not be the best way to represent it.
On reading those articles thoroughly, we inferred that ‘grouping these two methodologies’ is nothing more than a marketing gimmick for creating hype.
However, just to make clear, Continuous Integration and Continuous Deployment are two separate terms with one thing in common: both rely on automation.
What is Continuous Integration?
Grady Booch first used the phrase ‘Continuous Integration’ in the early 1990s in his book Object-Oriented Analysis and Design with Applications (2nd Edition), Chapter 6: The Process, mentioning.
Did you look at the choice of words that Grady used?
He mentioned the “needs of the micro process”, and this is a recognition of the pace of software development. He could have used words like macro process or normal-sized process; instead, he chose the word “micro process” because the slices of delivery were being cut even more thinly.
The idea of Continuous Integration was conceived in the early 1990s, but it came into the mainstream only over the last few years.
“In 2018, 68% of developers reported using a CI process at work.” ~ Study by DigitalOcean
Continuous Integration Definition
Continuous integration is a DevOps practice of automating the integration of code changes from multiple developers into a single software project. The purpose of CI is not just automating the integration of codes, the frequency of this integration matters too.
It is preferred to integrate the codes at least once a day (or ideally, multiple times a day).
The aim of integrating CI into your deployment pipeline is to reduce your code development effort by detecting errors quickly and easily, thereby resulting in good-quality software and more predictable delivery schedules.
PS: Continuous Integration cannot help you to get rid of bugs, however, with CI it becomes easier to find them and remove them.
Continuous Integration Tools
A minimal implementation of a CI system has two logical components:
- a method to execute automated workflows or CI builds
- a means to give feedback on the results of the workflows
You must analyze and invest in the following Continuous Integration tools:
- Jenkins: for CI build system
- SonarQube: for reporting
- Selenium: for automated testing
- Zap: for security vulnerability testing
For a comprehensive analysis of code and for reporting the same on SonarQube, you must use the following plugins on Jenkins:
What is Continuous Deployment?
There’s often a confusion between Continuous Integration and Continuous Deployment. Let’s start this section by understanding the relationship between the two.
“There can be no Continuous Deployment if there is no Continuous Integration. In a nutshell, CD is built on CI.”
The foundational text on Continuous Deployment was written by Jez Humble and David Farley in the book: Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation.
When it comes to ‘CD’, there is another term that is often confused with it. The term is ‘Continuous Delivery’. However, the difference between the two terms is huge:
- Continuous Deployment is about automating the release of code to the production environment at any given time.
- Continuous Delivery is an extension of Continuous Deployment in which it is made sure by the developers’ team that whether the entire application can be deployed to customers or not.
“In 2018, 52% of developers reported using a Continuous Delivery process at work.” ~ Study by DigitalOcean
Continuous Deployment Definition
Continuous Deployment is another DevOps practice that ensures that every ‘passing build’ is automatically being deployed to production. Continuous Deployment enables the concerned team to engage with the users and get their feedback from time to time and implement it.
Essentially, it is the practice of releasing every good build to users.
Continuous Delivery means you ensure every change can be deployed to production. Continuous Deployment means you deploy every change.
— Martin Fowler (@martinfowler) May 14, 2015
PS: When you’ve successfully implemented Continuous Deployment, it implies that Continuous Delivery is achieved as well. But the vice-versa isn’t true.
How Poor Implementation of Continuous Deployment led to a US $465M Trading Loss for Knight Capital
Aug 1, 2012, was a nightmare for Knight Capital Group – an American global financial services firm. In 2012 Knight was the largest trader in U.S. equities, with a market share of around 17% on the New York Stock Exchange (NYSE) as well as on the Nasdaq Stock Market.
So, what happened to the Knight Capital Group on the morning of August 1, 2012?
Knight Capital Americas LLC witnessed a huge error in the operation of its automated routing system for equity orders, named Smart Market Access Routing System (SMARS).
This error in the software sent Knight on a buying spree, snapping up 150 different stocks at a total cost of around US $7B, in just the first hour of trading.
By the time Knight understood the error and seized sending the orders, the organization had assumed a net long position in 80 stocks of approximately $3.5 billion and a net short position in 74 stocks of approximately $3.15 billion. During that one hour period, Knight lost over $460 million from these unwanted positions.
A detailed analysis of the Securities and Exchange Commission (SEC) found that all this happened because of the poor execution of the Continuous Deployment strategy.
Business Benefits of Continuous Integration and Continuous Deployment
The most popular applications on earth have a few similarities.
They serve an awesome customer experience, they solve a real problem, and they are mostly easy to use.
This sounds simple. Isn’t it?
However, good software applications go through iterative testing and quick software updates to earn the title of “best” apps. And to make that happen, lean businesses rely on Continuous Integration and Continuous Deployment in order to release final software easily and quickly.
1. Improves Reliability
Continuous Integration and Continuous Deployment improve reliability. However, it is not so easy to achieve.
A test built by Jez Humble, which can help you understand whether your team is ready for an ideal Continuous Integration and Continuous Deployment integration. If your team passes this test, it is guaranteed that you will observe a more reliable software development process.
The end phase of the test requires your team of developers to recover from a failed build or test within a span of ten minutes.
If your team passes all three phases of the test i.e., commits at least daily to the shared mainline, has automated triggering of build and test, and has also automated repair of the failed test within 10 minutes–then your team is CICD-ready.
There is no doubt in the fact that integrating software that’s built by different people is hard and even Jez Humble admits it:
This complexity of integrating software leads to a wastage of time as teams spend days trying to wrangle the branches and commits properly for releases. And this time spent is separate from the time utilized in code development.
Thus, imagine the time your team will save if you start to integrate proper Continuous Integration and Deployment pipeline and practices. Your team will become super quick in finding and resolving bugs, thereby improving the overall reliability of the software development process.
2. Improves Code Quality
When Continuous Integration and Continuous Deployment are used, code quality gets improved, thereby resulting in a high-quality app.
CI enables developers to integrate their code into a common repository. With the help of this repository, developers can share their builds multiple times a day rather than working in isolation. In turn, this helps reduce integration costs, as developers can share their builds more frequently.
Thus, the software updates get delivered quickly and with confidence that there will be no breaking changes.
However, the process is not as easy as it sounds.
When development teams are assigned the task of building a new feature, a common mistake that every developer makes is: opening up a feature branch in their repository and flooding it with commits.
This is not a good approach to follow.
Imagine if the developer is working directly on the master and the master is connected to the release cycle, then there are chances that your team releases a feature that is half-baked.
To avoid this situation, it is advisable for developers to isolate themselves from the master repository until the feature is fully ready to merge back into the master.
3. Improves Software Building Speed
Integrating Continuous Integration and Continuous Deployment will result in faster builds and deliver quicker results.
With deployments running in continuous cycles, this will enable you to track the project and provide feedback in real-time, as well as fix shortcomings within your team whenever necessary. With consistent reviews, the new product development will see more refinement and will be more in tandem with the end-users’ expectations.
Thus, with this automated mechanism, your team will be able to receive quicker test results for their product build and see their product being deployed faster.
At Net Solutions, our Continuous Testing DevOps process includes automation of tests. Thus, the monotony of running regression suites is negated, and overnight testing serves fresh results in the morning.
We follow IFSQ (Institute for Software Quality) Level 3 and use SonarQube under our DevOps process. This covers most of the items while any remaining ones are addressed manually during unit testing.
In today’s rapidly changing competitive landscape, business leaders are struggling to release their products quickly to the market because it’s almost impossible to release a quality code without a proper, streamlined process in place.
However, moving to Continuous Integration and Continuous Deployment will change your software development process dramatically. It will streamline the entire process, thereby helping you to deliver a stable, secure, and better product.