Convergence with Continuous Integration

Learn how to work in a team for continuous integration.

Localized tests

“It works on my machine!” cries Pat. “Must be something wrong on your machine,” he says to Dale.

Unit tests aren’t going to fix all such problems, but they are a standard of sorts. Any changes to the code can’t break the collective set of tests, otherwise the standards have been violated.

The ability to use unit tests as a team-wide standard requires a shared repository, of course. Developers check code out from the repository or create local branches, depending on your preference. They then make changes, test locally, and check the code back into the shared repository which is also known as integrating the code.

Old-school mentality

The cutting edge of the old-school mentality was to run a nightly build against the shared code. If everything was built okay, chances were that the integrated code was in good shape in theory.

Adding units and other automated tests to such a nightly build increases its value dramatically.

Knowing that the software passes all tests when run on a machine other than ours while integrated with other recent code changes should increase our confidence about shipping it.

The new school approach

Nowadays, the nightly build seems quaint and inadequate. A team of developers can add several hundred lines of code to the system in a day. The more code other developers add, the more likely our code won’t work in conjunction with it.

With only nightly test runs against the integrated software, it could be nearly a full day before we find out about conflicts. It could be another day to unravel how the combined code works and to find the problem. Lastly, it could be yet another day to merge the clashing code areas.

Continuous integration (CI)

Enter the notion of continuous integration (CI).

CI means that we integrate code much more frequently and verify the results of that integration each time.

The more quickly we know that our code doesn’t work well with other changes, the better off our team is.

Continuous integration (CI) server

Get hands-on with 1200+ tech skills courses.