Technical Guide: continuous integration with open-source tools
Source: Internet
Author: User
Technical Guide: use open-source tools for continuous integration-general Linux technology-Linux programming and kernel information. The following is a detailed description. When talking about continuous integration, let's talk about integration first. In general, integration in software development is to combine various related parts to form an available software. For example, a software project is completed by several groups, and each group is responsible for implementing some of the functions. Typically, in online game development, a group is usually responsible for engines, A group responsible for game logic, a group responsible for the Art Team, which developed things that must be combined to form an available game. Each member in each group, they write different parts of code every day. These developers must combine their respective results to accomplish their common goals. In this sense, from the daily development of every developer every day to the combination and splicing of various software modules, software integration is everywhere, a complete and available software, it is formed by constantly integrating the code of every developer.
Everyone who has developed software can realize that software development is never smooth sailing. The code developed by everyone will never be combined by magic. When new functions are added to the original software, the original functions are often accidentally destroyed and some bugs are introduced. When old bugs are fixed, other bugs are often generated. What's worse, these bugs are often not detected in time. When the team members complete the modules they are responsible for and finally integrate them together, they may be prepared to fix the integration problems. All of these are the pain points of every developer. So what is the problem?
Let's try another way of thinking, so that we don't have to stay on fixing bugs and problems in the integration process. The ideal situation we desire is, whenever we develop new code and add them to the original system, if we can be notified in time whether we have destroyed the functions of the original system, then I will be able to respond in a timely manner, fix these parts. If the granularity of this process is fine enough and frequent enough, we can expect that the damage caused by each introduction of new functions will be small enough and the restoration will be simple enough, if every developer is able to enjoy such convenience and ensure that the newly added features do not affect the original features, our entire software process can take a steady and reliable pace, instead of adding new code, you can fix the bug until it is discovered. I want to keep the software process steady, reliable, and incremental. It is an ideal process for every developer. From the developer's point of view, after all, no one wants to feel annoyed when they find that their modifications destroy the original functions.
Speaking of this, I think smart readers should be able to think that what we just talked about is the continuous integration mentioned earlier. In general, continuous integration means continuous and frequent integration. When new modifications are added, the author of the modification is notified in a timely manner whether the modification introduces new functions while ensuring the integrity of the original functions. If the entire software development team took this approach from the very beginning, our software could be built steadily and reliably.
At this point, readers will soon have a question: "What you are talking about is just an ideal situation, everyone wants to know whether their code breaks the original functions when they add new code. But how can we do this? Who can tell us in time where there is a problem? The idea of continuous integration is good, but how can we achieve continuous integration ?" I think these problems are very good and critical. is continuous integration feasible? What should I do if it is feasible? Let's take a look at what is the difficulty of continuous integration. The main difficulty of continuous integration lies in how to judge whether the entire system is still complete when new functions are added; who will tell me about errors or successes and how to tell me; when everyone works together, how can we ensure that everyone can be notified accurately without confusion. Let's analyze these problems one by one.
First, the means to ensure the functional integrity of the system is to test. If we have a complete test of all the functions, when new functions are introduced, if some original tests fail, it means that the new modification destroys the original functions, and the failed test can accurately tell us which original functions are damaged by the new modification. Secondly, the continuous integration tool will tell us whether the integration is successful. The continuous integration tool will notify developers Based on the test results by running tests throughout the system and which tests fail to cause the integration failure. Each software project usually uses version control tools such as SVN and CVS. Whenever a developer adds new modifications to the system code base, the continuous integration tool checks out the latest version of the code base, use automated building tools such as Ant and Rake, automatically compile the code in the project, deploy the entire application, prepare the environment and data required for the test, and run all the tests, including unit test, function test, and integration test, after the entire process is completed, the result is reported. The continuous integration tool identifies errors in any process and reports the errors to developers accurately. In the case of multi-person collaboration, the version control tool ensures that the modifications of each developer are saved correctly and orderly. Before each developer wants to submit their own modifications, you must first ensure that the changes submitted by the previous person are successfully integrated before submitting your own code. If your code is correctly integrated, your work is complete. Otherwise, you must fix the error and submit it again until it is successfully integrated.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.