15 minutes for CI – Continuous Integration

Tram Ho

WHAT IS CI?

In the theoretical definition CI (Continous Integration) is a software development practice where members of a team integrate their work on a regular basis, often with little integration. especially every day – leading to multiple integrations in one day. Each integration will be re-tested by an automated build (including test) to detect integration failures as soon as possible. Many have found that this approach greatly reduces integration problems and allows a development team to write software faster. In short, the CI is the method used to ensure that the code of the whole project is always built, always running properly (Pass all test cases).

BENEFITS WHEN USING CI

Before talking about the benefits of using CI. We try to consider the example if there is no CI, what will happen:

Man is a dev working at programming company A. Every morning, team members update code from Git, code drunk, then commit the code before going home. Sometimes the code could not be built, the whole team would frantically “find the culprit”: Mr. Kieu Son B corrected the code but forgot to commit the new file, Ms. Nguyen Thi B corrected the connection string, … A fixes the code, Ms. B fixes the code and makes the part of Man run faulty, so Man suffers. Every weekend, the whole team has to OT to integrate and fix bugs. And with such a process, the software product cannot be sold because of too many errors, slow release and worse, the reputation of company A, … The benefits of using CI can be mentioned. as follows:

  • Reduced Integration Risk: Working on projects means many people will work on separate work tasks or parts of the source code. The more people, the greater the integration risk will lead to error correction as well as overcoming these risks. Doing the integration every day or even more often can help minimize these types of problems.
  • Improve code quality: No need to worry about problems and focus more on the features of the system that help us write higher quality products.
  • Detect code errors early: If the build fails, you and your team will receive immediate notification and will have a plan to fix the problem before others in the team pull the error code back, leading to risks. ro later.
  • Reducing controversy among members: The system brings objectivity in place to help reduce disputes among members about who caused the mistake because just looking at the CI report will find the culprit immediately.
  • A little help with testers ‘work: Because the system has integrated running test cases so that fundamental bugs are detected early helps reduce the amount of testers’ work and they can spend effort on other things.
  • Reduce deploy time: Deploy the project is a very tedious and time-consuming job, and automating this process is essential.
  • Relaxation: We won’t be productive if we are afraid it will ruin something. The application of CI will help members feel comfortable, thereby concentrating on creating better results.
  • New members can mingle more easily: The build process can speed up a new member’s adaptation to his or her team.

Summary:

Do not use CIUse CI
Lots of bugsLess bugs
Commit is infrequentCommit often
Release is sporadic, slowReleases work regularly
Difficult to integrateEasy and effective integration
Testing happened lateTesting happens early and often
Difficult to fix the problemsQuick and effective troubleshooting

PROCEDURE CI

Go back to the example above. After applying CI in the project:

  1. Every time someone commits code, the CI system will get the code from SVN, and build. The system will send email notifications to all members if the build fails. The whole group just read the mail, see who committed that revision, and “take the head” of the culprit, making him fix the error.
  2. Nam’s project is written Unit Test very carefully and completely. When Mr. A, Ms. B fix the code, commit it, the system will build and run all Unit Test again. If any case fails, the whole team will receive a notification, and Mr. A, Ms. B must quickly fix the code for these cases to pass.
  3. Integration takes place every day, several times a day. Every time someone commits code that damages the build or makes a mistake, the whole team can solve the problem IMMEDIATELY.

CONCLUSION

Currently there are many 3rd parties that provide the CI tool. Using these CI tools helps ensure the entire process and allows us to add and extend functionality easily. Technically, CI tool is not required, just like IDE is not required for soft development, but implementation would be significantly more difficult without such a tool. The widely known CI tools can be found here .

The article focuses on CI. In the next article I will cover the concept of CD (Continuous delivery). Thank you for watching the article.

REFERENCES

https://toidicodedao.com/2015/08/27/giai-thich-don-gian-ve-ci-continuous-integration-tich-hop-lien-tuc/ https://code-maze.com/what- is-continuous-integration /

Share the news now

Source : Viblo