• No results found

CONTINUOUS INTEGRATION. Introduction

N/A
N/A
Protected

Academic year: 2021

Share "CONTINUOUS INTEGRATION. Introduction"

Copied!
16
0
0

Loading.... (view fulltext now)

Full text

(1)

CONTINUOUS

INTEGRATION

Introduction

Continuous Integration is the

topic of quite a bit of buzz in

Silicon Valley and beyond. And

with good reason: continuous

integration helps teams ship

better software at lower cost.

This book will show you how

to get started with Continuous

Integration on your projects

with actionable

recommendations and practical

suggestions.

(2)

What is Continuous Integration?

Continuous Integration (or "CI") is a development process where project contributors (developers, designers,

documentation writers, etc.) frequently commit their code to a master repository, which in turn builds and tests the current code after each commit. CI thus can gives an ongoing up-to-date measure of the health of a project's codebase.

Continuous Integration helps teams find bugs and other system problems sooner. This is proven to save money and reduce scheduling risk.

(3)

Developers and project managers get an early warning on possible bugs,

incompatibilities, or new performance problems. By identifying these issues soon

after they are introduced, fixing them takes less time and costs less than doing so

at the end of the project.

2

Since problems are identified and fixed continuously, there's no

need for a last-minute scramble to fix bugs. This

means reduced schedule risk (and no all-nighters)

Higher initial quality also means lower ongoing

maintenance costs..

Integration to continuous deployment systems ensure rapid turnaround from code update to live

in production. Customer issues get resolved faster, which means increased customer

satisfaction.

1

3

4

Benefits of Continuous Integration

Since the current version of the codebase is built on

every commit, team members, QA, and sales staff always have a current

build for testing, demo, or release purposes.

(4)

Considerations

Infrastructure

Prerequisites

Platforms

Before you begin

(5)

Prerequisites

Adding continuous integration to your process

involves getting a few prerequisites in place. It's likely that you already have some or most of these in place on your project. The good news is that all of the

prerequisites provide other benefits to your project, so you can add each one without making a huge push to get CI in place or worrying that it's wasted effort. Here's what you'll want for your CI setup:

Source code repository (like Subversion, Git, or TFS) Automated build (e.g. Ant, Maven, Visual Studio, make, etc.)

Automated test suite

(6)

Infrastructure

Once you've got the perquisites in place, you can move forward with adding continuous integration to your process. While you'll get some benefits of continuous integration with only a dedicated build server, adding more realism to your automated testing environment will help you expose a larger percentage of latent bugs before your customers do. In particular, you'll want to run your tests with representative sample data to mimic what your customers will experience.

In rough order of importance, here's what you'll need: Continuous Integration software -- SaaS or on-premises Build & test servers for each of your platforms

Clone of the production environment to run tests Test databases, including test data

(7)

Platforms

If your team builds applications that will be used on multiple

platforms, the benefits of continuous integration compound in your favor. That's because a robust CI process makes it easy to build & test each build, on every relevant platform. Once you've gone through the initial effort of setting up a CI process, adding a new server is

comparatively easy. Then, building on testing on all of your platforms is transparent to your contributors. You can even provide a test

matrix to automatically test combinations of platform components. Depending on your customers' use cases, you may want to consider the following for inclusion in your build/test matrix:

Operating system & version Database & version

Language runtime & version Browser type and version

Mobile: Screen sizes & other device capabilities Internationalization settings

(8)

Tests

The key benefits of continuous integration derive from its ability to automatically run your test suite every time someone makes a change to the codebase. Your team can write tests with the confidence to know that they will be used every day, to ensure that working code stays working. Over time, as your team identifies new bugs, the test suite will grow to check those conditions. Over time, you may even find that a successful run of the test suite means the code is ready to be released.

The corollary is that if your test suite isn't thorough, continuous integration will give you less actionable

information. However, even if your test suite is limited, a CI system will notify you of build breakages and possible

(9)

Yes.

Will Continuous

Integration work with

XP/Agile/Scrum/my

(10)

Tools & Resources

The next few pages provide some resources and tools that will help you add continuous integration to your development process. While it's possible to build a continuous integration system from scratch, in practice this will involve writing and maintaining a fair bit of code. This is not likely to lead to efficiency gains, as the staff time involved in building & maintaining the CI system could outweigh the benefits to the team.

Similarly, setting up and maintaining an in-house CI server takes staff time away from core development activities on an ongoing basis. If possible, you may want to use one of the available cloud-based CI systems that offer predictable pricing and require close to zero of your staff's time to setup and administer.

(11)

Continuous Integration Software

Continuous integration software is the conductor that drives the logic involved in building & testing your code after every commit. Here are some popular tools, both cloud-based and on-premises.

Suggested Continuous Integration Systems

Apache Continuum

Hudson

Jenkins

BuildLocker by ProjectLocker

TeamCity

(12)

Source Code Repository

Your continuous integration software will need to get your latest code from a source control system. If

you're not using a source control system for your code now, you should start immediately, whether or not you plan to add continuous integration. The investment you make in a source control system will pay

consistent dividends over the life of your project.

Suggested source control systems

Git

Subversion

(13)

Automated Build Software

Once your CI system retrieves the latest version of your project's code, it will attempt to build the code using your automated build application.

Suggested automated build systems

Ant

Maven

make

Rake

(14)

Automated Test Software

Once the build is complete, your automated test suite will be run, with the results collated for your perusal. Testing is a fairly specialized discipline, and there are automated testing tools for many niches. However, there are some good general-purpose open source tools that may be a fit for your projects.

Suggested automated test systems

Appium

Capybara

JUnit

NUnit

Selenium

(15)

Bonus: Virtualization

Like all tests, automated tests provide the best quality of information when they are run in a pristine

environment. That way, you know exactly what's being tested (and you know that nobody "fixed" the machine to make the tests work there. Standardizing the test environment helps prevent the "it works on my machine" syndrome by ensuring that tests are 100% reproducible. Virtualization is an excellent way to achieve a reproducible test environment.

Suggested testing virtualization systems

Amazon EC2 templates

Docker

Hyper-V

Vagrant

VirtualBox

VMWare

(16)

Shameless Plug

is the easiest way to get continuous

integration for your projects.

Source  Control  with  Subversion  or  Git

BuildLocker  Continuous  Integration

Free  migration  &  CI  setup

Saves  staff  time  &  expense  vs.  in-­house  solutions

Reach  out  to  us  at  [email protected]  for  details.

References

Related documents

Speci…cally, I look at the e¤ects of three periods of reform: …rst, the early 1990’s, starting with the new FOMC minutes; second, reforms around the turn of the millennium when

Recurrent programmes (excl. Reruns, sports events, programmes aired less than 3 times, programmes shorter than 3 minutes)... guests in DVR- or IPTV-households,

We compare traditional methods as Action Learning and Personal Support Groups with the Interventure Method using several important criteria for facilitating change and

To complete the combinatorial proof of Equation 3.1, it remains only to consider the doubly even tilings which have at least two horizontal impuri- ties in any row that contains

In compliance with the statute governing Finnish polytechnics (546/2013), the aim of this training is to provide you with: 1) knowledge and skills to facilitate the learning of

Although client devices that do not support IEEE 802.11r can associate to a BSS with Fast Transition enabled, some client device drivers have been found to be incompatible and

Gaseous elemental mercury (GEM), reactive gas phase mer- cury (RGM) and particulate mercury (PHg) concentration measurements from Alert, Canada, from 2002 to 2011 are shown in

Resolving Chaos Arising from Timebox Re-directions - 1 1 2 2 3-1 3-1 Implements 3-1 3-2 3-2 3-3 Test Defects Tests not Conducted Unplanned Workarounds Feature Changes Changes in