R – What are the reasons to use build scripts and continuous integration

continuous integrationmsbuildtesting

I'm trying to grasp the idea with build scripts, nightly builds and technologies like continuous integration, but I fail to see the advantages. Take this as an example:

We are a 4-person team developing an application, without unit tests. We also use Subversion for source control.

What benefits do we get by using custom build scripts and things like continuous integration? Do you "need" unit tests for this?

I can also mention that we develop on our local machines, and when the code is working we just update the svn checkout on the production server.

Best Answer

If you don't have continuous integration you will need to wait until someone decides to do an integrated build to find out about conflicting or inconsistent commits. An integrated build is one that incorporates changes from all developers. If each developer is diligent about updating their local working copy then you might be able to get away without a regular integrated build, but really, why wouldn't you automate it?

A test suite will also help uncover changes to behaviour that break things but that do not necessarily cause an integrated build failure.

It is also standard practice to perform a smoke test on the fresh integrated build.

In addition to detecting conflicts and changes that break things, a nightly integrated build means you will always have a recent build that incorporates everyone's work to date. This is a boon for testing and demo purposes.

There's also some fun to be had in thinking up suitable punishments for whoever breaks the nightly build -- the implication is that they committed stuff without checking it was ok, so they should feel some pain in addition to resolving the build-breaking commit.