Continuous integration and daily building

Source: Internet
Author: User

Everyone who has experienced a complete game project development will always clearly remember the pain points from development to Operation: BoringCode submission,Code Update,Compile,Submit executable programsToTestThe process of updating the new version, the bug that can never be changed, the bug result modified to introduce more bugs, and a new function added to make the original feature unusable, and so on.

 

Some people say that technological advances are intended for the functionality of lazy people. Indeed, when we don't want to do the tedious work, we have these convenient automated tools: for example, we will writeBatch FileIt is used to automatically submit and update code, call the Compilation Program for compilation, and then copy the compilation result to a specified directory. I believe that most people will write such batch processing scripts in their programming careers, or use similar scripts. Of course, we may also make these scripts more visualized, for example, add a beautiful GUI interface. In fact, the projects I used to participate in have also done these things.

 

There are also more mature solutions for bugs, such as unit testing, system testing methodology, and related testing tools and framework code, such as cppunit.

 

If you are starting a new project, you may have a similar script that you have already completed to use, alternatively, you may arrange one or two people to develop a new automatic compilation tool. Of course, a better solution you can choose is to use a ready-made open-source solution. The tools provided by the open-source community are nothing new. In the field of automatic building, there is also a very good tool calledCruise control.

 

You don't need to talk about how to write the configuration file config. xml of CC. The document that comes with CC is the best material. After reading it, you will naturally understand it. Of course, in fact, I also encountered some troubles when doing configuration tests. Finally, I turned to Google to solve the problem. If you encounter a similar problem, for example, no matter how you try, CC cannot properly checkout code from the svn repository, so you can look at it here

 

Http://www.oracle.com/technology/products/jdev/tips/mills/cruisecontrol/jdev_svn_cc.html

 

In fact, ant's SVN task is not complete enough, so someone has made another one and added many useful functions to help us implement more automated tasks.

 

Another point is CC publisher. CC itself also has multiple publishing methods, including uploading through FTP and sending email notifications. But in fact, according to my personal observation,It is not easy for programmers to actively check emails or view a webpage.Programmers always have a variety of seemingly reasonable excuses to explain why the compilation results are not viewed in a timely manner. Even the powerful notification programs attached to the notes are not quite open. Therefore, developers must be notified of the compilation results in a more direct way.

 

We tried a method to send the compilation results to them through the most common im tools of programmers. Although programmers are not good at verbal communication, they are quite fond of chatting tools. Therefore, there is no reason not to pay attention to the results here.

ThenAutomated Testing. I think the complete automated testing process can only be at the unit test level. It is not easy to implement complete system testing and integration testing, especially for the network game project I am involved in, therefore, I only need to implement the unit test step in this automated integration environment. In fact, the function of each unit module is correct, and the number of System Bugs has been reduced by more than half.

 

There are also many testing frameworks. From the established cppunit to the recently launched Google test frameworks, programmers can choose one based on their preferences, eventually, external tasks of ant are integrated into CC.

 

FinallyRelease of version. If you have participated in the complete operation of the game project, you must know that the game is officially launched in many versions and is messy, how to manage these different versions is what our automated integration environment can do. For example, there will usually be a normal version, there will also be an Internet test version with some test functions added, and some activities customized for specific servers, modifies the numeric version for a specific server, and so on. When it comes to server maintenance, it is often a headache for the management of these versions, as well as the management of the PDB and Map Files corresponding to each version.

 

If there is an automatic solution that will help us to automatically generate, classify, and archive these versions, it will be a great thing to save a lot of attention. In fact, as long as we make the configuration, CC can indeed help us complete this tedious work.

 

After automatic compilation, let's talk about continuous integration. In fact, adding up the above work constitutes continuous integration, but these work needs to be completed continuously. Of course, they are also completed automatically by machines, rather than manually.

 

In general, continuous integration is implemented continuously and frequently. When new modifications are added, the author of the modification can be notified in a timely manner whether the modification is complete while adding new features.

 

Use CC to describe the continuous integration process. In addition, although CC is written in Java, it does not mean that CC can only be used for integration management of Java projects. c ++ is the same. YesLet CC regularly update the latest code from the svn repository, then call ant's external commands, execute make or msbuild to compile the project, and then call the cppunit framework for unit testing, then, the compilation and test results are sent to the IM tool. Finally, the compiled executable files are published to the specified directory and archived..

 

CC is actually like a general command that schedules external work, such as automatic compilation, automatic testing, and automatic release. Every external task can be defined freely. Of course, most of us use ant, because ant is powerful enough.

 

The last thing I want to talk about is that the tool must be powerful.How to use it. For example, whether continuous integration is implemented in the Automated unit test is implemented according to the original idea, rather than just showing the boss, do programmers write test cases for each interface of each module as required and add them to the test framework? This requires the project manager to promote and supervise them.

 

 

Although this process may be as pleasant as the original one at the beginning, when it is on the right track, it will certainly bring considerable benefits to the entire development process.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.