Book Review: Continuous Integration

Continuous Integration
Continuous Integration is an easy read that anyone directly involved in the software development process could gain a lot from. Even though it doesn’t really introduce anything new, it ties everything most developers have learned over time into a single process, called continuous integration. Here are a few of the things that I really liked about the book.

Automation

Automate everything. Automation limits the ability for bugs to creep into a process and it also makes processes easier to follow. After reading this book, I was really motivated to automate everything and so far it has been a great decision. Some good examples of things that should be automated are:

  • Tests
  • Environment setup and teardown, especially databases
  • Code inspection
  • Deployment

Databases

Very often, databases are not part of a build process or version control. This allows differences between different environments to potentially cause bugs. Putting database schemas and test data in version control can help prevent this. But, what I like the most, is it documents the setup of the database so potentially any developer could setup a new one.

For example, when a new developer starts, I can show him the NAnt or MSBuild task to execute in order to generate a new developer DB. This is much easier than having to guide someone through MySQL, MSSQL, or any other database for the first time.

Transparency

Lastly, the biggest thing I learned from this book is how easily continuous integration can provide project transparency. In my experience, all to often the developers and the rest of an organization get out of touch regarding a project’s status. Continuous integration, combined with more agile development practices, allows a project to be completely transparent throughout an organization, from developers, to QA, to designers, and even senior leadership. No longer does a looming release date bring surprises for those outside the development team.

Geocities Nostalgia

I am doing some home wiring at my parents house and Googled around for some info on wiring phone jacks. I came across this page, which strangely reminded me of my first website on Geocities 13 years ago.

It was a website on Duke Nukem, and made heavy use of frames, animated gifs, and some sweet back ground music. I also had a badass page hit counter.

Man I wish I could find that site. I think they deleted it.

LINQ’d up

I just used LINQ for the first time ever in code. Pretty exciting. For me, it doesn’t get much better than transforming some mundane 6 liner into an elegant one liner.

This…

int count = 0;
foreach (string email in this.emails)
{
    if (email.EndsWith("@mydomain.com")) count++;
}
return count;

becomes this…

return this.emails.Count(email => email.EndsWith("@mydomain.com"));

In some weird kind of way, I feel like an emo Ruby developer. Maybe I’ll start wearing some tighter clothes.

Amazon S3, JungleDisk, and Me

I have been meaning to buy an external hard-drive to backup a lot of my data. Well, today I decided to try out Amazon S3 as my storage medium instead of an external hard-drive.

JungleDisk has proven a great program to transfer files to S3. In addition to working on Windows, Linux, and Mac, it allow the mounting of S3 buckets as hard-drives. Very good program to work with. Right now, I am backing up my Linux desktop and my Windows laptop.

Whether or not I stick with it, I don’t know. Right now, I have around 40GB of data to backup, which is $6 a month on S3 and $4 for initial upload. I am guessing, I will probably have to spend close to $10 a month for this service. Considering 500GB external hard-drives run about $100 right now, it doesn’t seem extremely cost effective. Then again, I am also paying for data redundancy and recoverability, right? Something tells me, this service will get me to organize my files better and delete files I don’t care about. Either way, I can afford to try it out for a few months, which is something you can’t really say about a hard-drive.

Lastly, here is a good guide on using rsync with S3.

NUnit and RowTest

I have been researching different unit testing tools for .NET lately. Obviously, NUnit was the first I came across, but MbUnit had the RowTest attribute, which allows parameters to be added to tests. This saves a lot of code and is really a must have feature. Luckily, I found an NUnit addin for RowTest here. The latest version here is linked to NUnit 2.4.6, so I rebuilt it from source to use NUnit 2.4.7.

To install for TestDriven.NET, just create an addins folder in the %install root%\TestDriven.NET 2.0\NUnit\2.4\ and copy NUnitExtension.RowTest.AddIn.dll to the newly created folder. Then in your test project, just reference NUnitExtensino.RowTest and you are set to go.

Here is an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
namespace TestExample
{
     [TestFixture]
     public class Tests
     {
          [RowTest]
          [Row(-4,4)]
          [Row(-5,5)]
          [Row(-6,6)]
          public void TestAddEqualsZero(int x, int y)
          {
               Assert.IsTrue((x + y) == 0);
          }
}