liveBook · Manning

Continuous integration

As explained in Test Driven: Practical TDD and Acceptance TDD for Java Developers

A software development practice of integrating changes into a shared source repository frequently and verifying the integrated code, typically with automated tests.

Continuous integration means frequently integrating small changes from developers’ workspaces into a shared source repository. It also generally includes verifying the integrated code with automated tests: compiling says the code can be built; tests help check that it works. section 1.5.3

Small, frequent integrations help keep developers’ work from diverging. Waiting longer to check in while the rest of the team keeps changing the repository can make manual merging more likely. section 1.3.4 section 1.5.3

A fast check followed by a full build

Suppose the full test suite takes too long to run after every small change. First, run the tests most relevant to your change locally. Then commit the change to the repository. A continuous integration server detects it, runs a clean build and the full test suite, and sends a build report. You can move on while the longer checks run. section 1.5.3

Figure 1.12. This is a typical scenario of a developer (1) running a relevant subset of automated tests locally before (2) committing the change to the source repository. In the third step (3), the change triggers a new build on the continuous integration server (using a commit-hook in the repository or by frequently polling the repository for changes). Finally, after running a clean build with the latest changes (4), the continuous integration server sends a build report to the developer via email.

Follow the change from local tests and commit through the server build and report. section 1.5.3

This is a trade-off: a quick local subset gives faster feedback, but it may miss a failure that the full suite finds later. Also, a server alone is not continuous integration. If developers do not integrate frequently, their workspaces can still diverge while the server sits idle. section 1.3.4 section 1.5.3

How Test Driven: Practical TDD and Acceptance TDD for Java Developers covers it

How deep it goes
Explains the integration workflow and the speed-versus-confidence trade-off, without detailing server configuration.
Examples
Uses a developer’s local test subset, repository commit, server build, and emailed report to illustrate the workflow.
What you can do after
Evaluate a continuous integration workflow by distinguishing frequent integration from server automation and weighing the risks of a partial local test run.
How it connects
Connects continuous integration with test-driven development, refactoring, automated testing, and source control.

Also explained in

Compare how 5 books explain continuous integration →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Test Driven: Practical TDD and Acceptance TDD for Java Developers. The section links point to the parts of the book it draws on.