Marty Andrews

artful code

Saturday, February 21, 2004

Blatant company promotion

The ad below ran last week in the IT section of Tuesday's "The Australian". I don't know if its socially acceptable to place occasional ads for your company in a blog, but I'm doing it anyway...

As a place to work, ThoughtWorks pretty much rocks. The people are top notch, our projects are technically really interesting, and we get to do agile development (which I reckon is just bloody great).

Come join us. You'll be glad you did.

Thoughtworks Ad

Tuesday, February 17, 2004

CI Demo Part 3 - Maven Build

At the Sydney Geek Night this week, I spent spent some time with Mike Cannon-Brookes putting a Maven build on my template application. Ok, I just sat back and watched while Mike did his thing, but in any case, I learned a bit about Maven.

The biggest eye-opener for me was the slashing and burning Mike did on the default script. The conversation kind of went like this:

Mike: "Ok, so lets grab this sample script off the documentation as a starting point. This section here is pointless, so we'll get rid of that. You don't need this bit here either. We'll throw away this crap as well..."

Me: "Whats the deal with all these reports here?"

Mike: "Oh yeah - most of those are irrelevant, so we'll get rid of these ones"

Within a few minutes, we had a working build up. It took a while to run the first few goals, because it downloaded a bunch of jars get started. Once it was done though, it did almost the same thing as my Ant build but with much less time spent on development.

Some instinctive reactions to my first Maven build:

  • My Maven build file is about 30 lines long versus about 130 lines for my Ant build file. Nice...
  • When I look at my Maven build file, I can't tell what things I can run on my build. Not so nice...
  • My Ant build uses a patched jcoverage.jar file. So far it seems like it might take more moving parts to get Maven to do that.
  • My Ant build takes about 7 seconds. My Maven build takes about 15 seconds (but that includes site generation).

I like the setup enough to keep looking into it, but I'm no convert yet...

Sunday, February 15, 2004

CI Demo Part 2 - Template Application

I've started down the road to building my continuous integration demo by setting up a template application with some of the basic tools listed previously.

There's no real code to speak of yet, just a HelloWorld class and an associated test, but most of the surrounding tools are set up in a directory structure that I like. You can download the application template if you like to see how it works. Its about 2MB in size, as the tools for all jars are included. You'll need Ant 1.6 to build it.

There's a couple of interesting things about the build which I don't see all of the time. Firstly, I separate the application source and test code. Not so dramatic, but I don't see everyone do it. I also compile each source tree to their own classes directory, which enables application source to later be bundled into the distribution without tests. The technique is also a sanity check that application source does not depend on test source.

This was my first attempt at using Ant 1.6, and I've had a go at creating some macros for compilation and testing respectively. So far I like it. My build file is certainly cleaner for the effort.

The remaining tools were simian, checkstyle and jcoverage. I haven't done anything too fancy with them, and I haven't completely tweaked the checkstyle config to my liking yet. In any case - they're in and working. The version of JCoverage includes the patch for simple bean-like properties produced by Jon Eaves.

Thats it so far. My next step is to expand it to be a simple web-app with a FIT test. Then I'll wrap cruise control around it and start building actual features ;)

Saturday, February 14, 2004

Demonstrating continuous integration

I'm currently working together with Jason Yip to collect all of the information we can about Continuous Integration. I figured it would be nice to demonstrate some of our knowledge about continuous integration techniques with a practical application.

The plan is pretty simple really. I'll build a simple web app and continuously integrate it. Some of the tools I intend to use are:

  • CVS
  • Java
  • Ant
  • JUnit
  • JCoverage
  • Simian
  • Tomcat
  • JWebUnit
  • FIT
  • FatCow
  • Cruise Control

I chose these tools for a couple of reasons. Firstly, they represent a failry typical Java-based web application. Secondly, they're all free. Anyone can get these tools at no cost and build their own continuously integrated app.

Ok - now that I've published my plans to the world, I'd better quit procrastinating and get stuck into it...

Monday, February 2, 2004

My CSS adventure

I spent some time on the weekend learning about cascading style sheets and applying my new skills to my own website. The look is not that different, but lots of stuff has changed.The most dramatic change on the site was the banner and navigation. My original version had about 75 lines of HTML code. This included a couple of tables with lots of rows, background colour manipulation and some text style changes as well. Yhe new version is about 15 lines of HTML code with no tables, colours or style definition (everything is now in the stylesheet). Check out the listamatic for some other ideas on navigation menus with CSS.Coming second in terms of major change was the menu items on the right-hand side of the blog. They use to all be tables as well, but now each section is just text wrapped in a div tag to get the effect.The rest of the stuff was mainly making sure I was using "natural" HTML code (ie. paragraphs and headings etc). Then styles were just declared for those elements.I like the result. It seems visually more structured to me with much less code. I changed the whole site (except the wiki) in about a day, and it seems much more maintainable to me too.