Maven Practical Reading notes (11)

Source: Internet
Author: User

one of the agile practices-continuous integration (Continuous integration)

1. The automation built by Maven is a necessary prerequisite for continuous integration

2. Continuous integration also requires developers to use version control tools and continuous integration servers

3. Subversion is currently the most popular version control tool, while Hudson is the most popular open source continuous integration Server Software

What is continuous integration?

Continuous integration is the fast and high frequency to automatically build all the source code of the project, and provide the project members with rich feedback information

What do you call fast?

The speed of integration is as fast as possible, and developers don't want their code to submit for half a day before they get feedback.

What do you mean high frequency?

The higher the frequency the better, for example, every hour is a good choice, such a problem can be reflected as soon as possible

What do you mean automatic?

Continuous integration should be triggered and executed automatically, and there should be no manual involvement

What do you call a build?

Including compilation, testing, review, packaging, deployment, etc.

What is all the source code?

The latest source code submitted by all team members to the CODEBASE

What is feedback?

Continuous integration should tell team members the latest integration status through a variety of shortcuts, and when integration fails, the feedback report should reflect the specifics of the failure as much as possible

A typical continuous integration scenario is this

The developer has made some modifications to the code, committing the changes to the code base after running the build locally and confirming the error. A continuous integration server with high-configuration hardware queries the code base once every five minutes, discovers the update, checks out all the latest source code, and then calls the Automation Build tool ( such as Maven) to build the project, which includes compiling, testing, Review, package, and deploy. Unfortunately, however, another developer submitted code changes at this time, two changes that caused some tests to fail, and the continuous integration Server created a report based on these failed tests and was automatically sent to the relevant developer. After the developer receives the report, immediately left-handed investigate the cause and fix it as soon as possible

A complete integration will often include the following 6 a step

1, continuous compilation: All formal source code should be submitted to the source control system (such as Subversion), continuous integration Server to check the source control system at a certain frequency, if there is new code, it triggers an integration, The old compiled bytecode should all be cleared, and then the server compiles all the latest code

2.Continuous Database integration: In many projects, source code not only refers to Java code, but also includes database SQL scripts, if you manage them separately, it is easy to create inconsistencies with other code of the project, and cause confusion. Continuous integration should also include database integration, and each time a new SQL script is found, it should clean up the database of the integrated environment, recreate the table structure, and fill in the prepared data. This makes it possible to find script errors at any time, and tests based on these scripts can further identify other related issues

3.Continuous testing: With a framework such as JUNIT, automated testing is possible. It is not easy to write good unit tests, and well-designed unit tests must be automated, repeatable, environment-independent, and self-checking. In addition to unit testing, some projects also include some integration tests that depend on the external environment. All of these tests should run at each integration time and generate specific reports when a problem occurs

4, continuous review: Tools such as Checkstyle and PMD can help us find bad taste in code (poor smell), and continuous integration can use these tools to generate various kinds of reports, such as test coverage reports,Checkstyle reports, PMD reports, etc. These reports can be generated less frequently, such as generated once a day, and can be used to give developers feedback when a problem is identified.

5, continuous deployment: Some errors can only be discovered after deployment, they are often specific containers or environment-related, automated deployment can help us to identify such problems as soon as possible

6, continuous feedback: continuous integration of the last step of feedback, usually an e-mail. Send the right information to the right people when it's important. If the developer has been subjected to continuous integration reports unrelated to himself, he slowly ignores these reports. The basic rule is that the inheritance failure report is sent to this integration-related code submitter, and the project manager should receive all the failure reports

Continuous integration requires additional hardware setup

Especially for continuous integration servers, the higher the performance, the faster the integration, and the faster the feedback. Continuous integration also requires developers to use a variety of tools, such as source control tools, automated build tools, automated test tools, continuous integration software, and more. All of this undoubtedly adds to the burden on developers, but learning and adapting to these tools and processes is well worth it, because continuous integration has many benefits

What are the benefits of continuous integration?

1. Early exposure issues: the sooner you expose the problem, the lower the cost of fixing the problem code. Continuously integrates, compiles, tests, reviews, and deploys project code at high frequency to quickly identify issues and respond to them in a timely manner

2, reduce duplication: continuous integration is fully automated, which avoids a lot of repetitive manual labor, developers no longer need to manually check out the code, step by stage to compile, test, review, Deployment

3, simplified project release: daily high frequency integration ensures that the project can be deployed at any time, without continuous integration, the project will have to be manually integrated before release, and then spend a lot of effort to repair the integration problem

4, Build Team confidence: a good continuous integration environment allows the team to maintain confidence in the status of the project, because most of the problem areas of the project have been covered by the continuous integration environment


Maven Practical Reading notes (11)

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.