ROKITT BLOG

Tuesday, 09 June 2015 13:05

10 steps to Continuous Integration Featured

Rate this item
(3 votes)

Continuous Integration is defined as a development practice that requires developers to merge code with a shared repository several times a day.  Each check-in should be verified by automated build and test, allowing development teams to detect problems early.  While Continuous Integration can seem like an obvious process to adapt, it has only recently started gaining momentum, especially in large enterprises. 

 

In the recent years, Agile has become a household name in the Development and Testing organization alike.   While many teams are adapting Agile practices like Daily Scrum, shorter Sprints and Retrospectives, they are still struggling due to manual build and deploy processes, slow and insufficient testing and integration issues.  One needs to realize, that Agile cannot truly function without CI and CI without Agile.  

Here are 10 steps that will help any company to get on the path of Continuous Integration and move closer towards the coveted Continuous Delivery.  

1.       Setup common repository for Development, Build, Test and Deploy Artifacts   This should include Source Code, Build Scripts, Unit Tests, Automation artifacts, Automated Functional Tests, Environment Configuration scripts.  Develop a procedure for creating branches and checking-in code from local branch to Main Development Branch, QA Branch and Production Branch.  

2.      Document Build, Test, and Deploy process flow.  This usually involves talking to various teams including Development, QA, Operations and Deployment.  Once all the steps in the delivery process are identified, we can then outline all manual steps, thus highlighting the bottlenecks in the process.  While some bottlenecks can be resolved by simply automating the manual steps of the process, others might require fundamental changes to the process itself.   These Bottlenecks will make up our Continuous Integration Roadmap and will need to be prioritized and added to the backlog.

3.      Automate the Build process and minimize the build time.  This will include creating automated build scripts using tools like Maven, Ant or Gradle. 

4.      Setup a Continuous Integration server.  Setup a Build server using open-source tools like Jenkins. Create a job to run automated build scripts either nightly or after every commit. 

5.      Adapt TDD and develop automated Unit Tests.  Test Driven Development promotes writing of automated unit tests before writing the code, thus ensuring 100% unit test coverage. Add these Unit Tests to the CI Server and run them as part of every build.   “Definition of Done” should be updated with the rule that Unit Tests passed with 100% pass rate. 

6.      Collect Automated Code Quality Metrics.  Setup CI Server to automatically perform Code Coverage and Static Code Analysis.  Jenkins has plugins for Code coverage tools like JaCoCo and Cobertura and Static Analysis tools like PMD, Checkstyle and FindBugs.  

7.      Create Automated Smoke test that verifies if application is ready for testing.   This should include checks for application availability, web and database server availability, memory and hard disk space validation,   validity of test usernames and passwords, automation framework validation, etc.  Add the Automated Smoke test to Continuous Integration process to run after build and unit tests are completed.  

8.      Run automated regression testing at least nightly.  While traditionally regression testing is a big task which is usually performed post-development, there is a huge advantage to running regression testing continuously by triggering it from the CI server.  This allows engineers to quickly discover if the check-in broke something that previously worked and will enable them to fix it almost real-time.   In addition, this also has a positive side-effect of continuously verifying our automated regression suite.   In order to make this process successful, we will also need to automate the Test Data gathering, creation and cleanup procedures.   

9.      Automate Environment configuration and provisioning.  Environment management is one of the most time consuming tasks of the Testing Lifecycle process however it has not yet become a common practice to automate it.  There are numerous tools available on the market, like Chef, Puppet, Ansible and Salt which allow to create scripts documenting environment setup and provisioning.  Tools like Docker and Vagrant help to easily spin up this environments, even on-demand.  This can be added as one of the steps in the CI process to ensure a clean test-environment before every automated test execution, thus minimizing environment related failures.  It also gives engineers an opportunity to easily replicate bugs found during testing. 

10.   Automate Test Results analysis.   Main reason for adapting Continuous Integration process is to minimize the feedback loop.   Developers need to know as soon as possible if their code broke the build or anything during integration or regression testing.  Using tools like Jenkins allows to automatically send emails to concerned parties notifying them about build or test failures.  In addition, we can develop automated scripts that analyze test results and send meaningful reports to minimize debug time. 

While adopting Continuous Integration and following these steps does not guarantee smooth releases 10 times a day, it definitely puts the company on the right track towards faster releases with higher quality and happier employees. 

If you are interested in streamlining you delivery process and releasing higher quality software, you can reach out to Rokitt for a FREE assessment and recommendations tailored to your current process and goals.

 

References:

 

https://www.thoughtworks.com/continuous-integration

Read 436 times Last modified on Tuesday, 09 June 2015 13:23