We all follow few rules while writing code. Few of the basic rules involves indentation, syntax, maximum letters in a line etc.,
I being a developer, I always wanna push good code. This can only be achieved by testing what you have written. Atleast I wanna meet my basic rules of writing code.
But is it possible to test each line of your code during a tight schedule?
There were times when my pull request was rejected for improper alignment of code. Also, there were times when I broke our Staging environment due to my code change. This is all because of lack of testing.
How will you test optimizely by utilizing time? Here, Continuous Integration comes in to picture.
What is Continuous Integration?
Continuous Integration is a software development practise of testing each change done in your central repository automatically by running automated builds and tests.
From the diagram, we can see: Developer does a code change and pushes changes to his/her own repository. As soon as he/she commit changes a webhook is triggered by the version control, in my case am using Github. Now, the commit webhook will trigger a build which actually runs all your test cases. You can use any CI/CD platform to run your build, am using Shippable.
Now if your build fails, you can go back and do the required changes. If your build passes then you can raise a pull request and send it for review.
I believe the goal of Continous Integration is to find and address bugs as soon as possible. This improves your code quality, system quality and reduce the time it takes to validate any new updates.
What is Continuous Delivery?
Continuous Delivery follows the testing that happens in CI and push to staging/production environments continuously.
The core idea here is to deliver the code to QA or any user base so that it can be regularly reviewed.
Avi Cavale, CEO of Shippable says:
“Lot of people talk about what is continuous integration and continuous delivery, I like to call it as CI which is continuous improvement which is constantly improving what your process is.”
I agree with him, as the main motivation of all this is to improve your software and ofcourse to ship good code.
I hope you find this post helpful 🙂