Skip to main content

Continuous Integration as Metaphor for Agile Methods

Build and SCM practices are essential for agile teams to deliver working software on a periodic basis. Continuous integration is an essential practice for agile teams, as described in the XP book: Extreme Programming Explained: Embrace Change, and Paul Duvall's excellent book: Continuous Integration: Improving Software Quality and Reducing Risk.

For those not familiar with the continuous integration (CI), it's a practice where a team has an automated build that monitors the source code repository for changes and builds and tests the software periodically. CI allows the team to monitor the state of the project and detect mistakes and integration errors quickly, minimizing the risk of someone on the team being stuck because they checked out broken code, and thus enabling the team to deliver quickly.

Continuous integration is also a good metaphor for agile software development not just because it's about providing feedback and enabling change, but because of the way that CI tools work.

While the concept is called "continuous" integration, most, if not all, CI tools work in "sprints." CI tools can be configured to check the repository using two parameters:
  • A polling interval: How often to check the repository
  • A quiet period: How much time should elapse between changes before a build starts.
There are a couple of reasons for not building after every commit. The first is that people can sometimes be undisciplined about committing change sets. You may forget a file and check it in minutes later. In this case the quiet period saves you from failed builds that are "false negatives."

The other reason for the quiet period is that, even if all the developers were perfectly disciplined about committing atomic change sets, the build system might not be able to keep up with the work of the team if it built after every change. Building after a couple of closely related changes gives you the information you need to keep the codeline healthy. Building more frequently could put you at risk of getting more feedback in a less timely manner.

While the "keeping up with the developers" problem can be fixed with technology, the idea of working efficiently by not building more often than necessary also describes how agile teams work. Teams periodically check to see what work there is, and once requirements are "stable enough" they plan and execute. This approach is valuable because chaotic change can lead to churn and reduced productivity. For example, a Sprint starts with a fixed backlog that the team plans and quickly executes. If the requirements change too much during the Sprint, the Sprint is supposed to be terminated and re-planned. In practice many teams allow for some changes to requirements, changing direction too often can waste energy.

Agile is about embracing change, but being agile is not the same as being chaotic. We configure our tools to work effectively to give the feedback we need; we can do the same with our teams.

Comments

Popular posts from this blog

Continuous Integration of Python Code with Unit Tests and Maven

My main development language is Java, but I also some work in Python for deployment and related tools. Being a big fan of unit testing I write unit tests in Python using PyUnit. Being a big fan of Maven and Continuous Integration, I really want the  Python unit tests to run as part of the build. I wanted to have a solution that met the following criteria:
Used commonly available pluginsKeep the maven structure of test and src files in the appropriate directories.Have the tests run in the test phase and fail the build when the tests fail.
The simplest approach I came up with to do this was to use the Exec Maven Plugin by adding the following configuration to your (python) project's POM.

<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <configuration> <executable>python</executable> <workingDirectory>src/test/python</workingDirect…

Displaying Build Numbers in Grails Apps

Being a fan of Continuous Delivery, identifiable builds, and Continuous Integration: I like to deploy web apps with a visible build number, or some other way of identifying the version. For example, having the build number on the login screen for example. In the Maven/Java world, this is straightforward. Or at least I know the idioms. I struggled with this a bit while working on a Grails app,  and wanted to share my solution. There may be other, better, solutions, but the ones I found approaches that didn't quite work they way that I'd hoped.

My requirements were:
To display a build number from my CI tool, where the number was passed in on the command line. In Bamboo, for example you might configure a grails build as
-Dbuild.number=${bamboo.buildNumber} warTo only change build artifacts and not any source files.To not misuse the app version, or change the names of any artifacts.To be simple and idiomatic.I realized that that Grails itself changes the application metadata (appl…

Motivation Visibility, and Unit Testing

I've always been interested in organizational patterns (such as those in Organizational Patterns of Agile Software Development). I've recently found myself thinking a lot about motivation. I'm now reading Drive: The Surprising Truth About What Motivates Us and just finished Rob Austin's book on performance measurement. Being the parent of a three year old, I'm finding more and more that "because I said so, and I'm right" isn't too effective at home. My interests in motivation are closely related to my interest in writing software effectively. Writing software is partially a technical problem about frameworks, coding, and the like, but the harder (and perhaps more interesting) problem is how to get a group of people working together towards a common goal. Agile practices, both technical and organizational, build a framework which makes having the right amount of collaboration and feedback possible. But there's a bootstrapping process: How do yo…