Agile On the Beach

I spent two days recently enjoying being in Cornwall attending and presenting at the first Cornish agile conference Agile on the beach.

The event was a great success with world class speakers (you can see the full list on the website), and an actual beach party on the thursday night with a band (All the fires) and hogroast. The organisation was also superb, co-ordinated by Event cornwall. From the attendee perspective, It was great to meet and talk to such a good turn out of passionate developers and companies.

I have some involvement in the genesis of the event. My dad, Mike Barritt is working for a company called Oxford innovation who are helping companies in cornwall to develop and grow. At some point a while ago, I had connected him with Roger Marlow and suggested that a good way to help everyone get into agile was to host a conference. A year or so later, and I found myself down in cornwall amongst some of the people I have massive respect for in the industry. The event has also had a great sponsorship and support from ThoughtWorks, which makes me really appreciate what an amazing company it is to work for.

Some highlights for me were hearing Mary and Tom Poppendieck talking about Lean Startup and running a value stream mapping workshop, Kevlin Henney reminding us all that software should be FUN, and Jason Gorman firing us up to keep our focus on quality codemanship and staying out of the “Anaerobic” zone when developing code. It was also great to see everyone getting down to the code in a dojo with Jon Jagger, to have the fantastic Rachel Davies helping people with common agile adoption problems, and have Steve Freeman talking about TDD. Quite a line-up!

Unfortunately I couldn’t attend my colleague James Lewis’ talk as we were speaking at the same time, but I have seen the slides and it sounded awesome, so I hope to catch it another day. Parallell to us was Roger so I missed his talk too, but it sounded like he had a good time.

I managed to make a presentation myself, talking through some of the experiences I have had as a consultant working for ThoughtWorks, and in particular some developer practices. I over estimated the amount of material I was trying to get through but did manage to get to a few key points! For those who attended a couple of interesting jump points to follow up might be Martin Fowler on Feature Toggles, gource (the tool at the end), and The continuous delivery book by Jez Humble.

All in all, the event was a great time and I hope that it signifies the beginnings of putting cornwall on the world stage for software development and high tech companies!


The ‘R’ Sessions

(Image from

A few years ago whilst working on my MSc thesis I was heavily into R a statistical analysis package which has a functional language feel to it. My friend Marc Hasenbank, a few others and I ran a series of workshops for people wanting an introduction to R. I recently wanted to show this to someone so thought I would post a link. The code from the tutorials can be found here


Help JUnitMax play with Hamcrest 1.3

I have been working on converting our codebase to JUnit, with a secondary aim of trying out JUnitMax.

I ran the Max and quickly discovered that it failed when trying to execute assertions using the Hamcrest hasItems matcher.

The assertion looks something like:

NoSuchMethodException describeMismatch

This error frequently occurs because JUnit packages an older Version of the org.hamcrest.Matcher class which does not have the describeMismatch method.

I dug around a bit in the plugins directory in the eclipse install folder and found that it contains a junit-4.8.2.jar. Happy days I thought, I can simply do what I’ve been getting used to doing for a while and replace it with junit-dep-4.8.2.jar which does not contain the hamcrest classes.

Unfortunately this didn’t quite work. It turns out that you need to call it exactly the same junit-4.8.2.jar. I thought this was because there’s an entry in the MANIFEST.MF file but I tried to change it and that didn’t work too well.

Renaming the Jar file however works a treat and now I have full JUnitMax action on my box.

I’ve posted on the JUnitMax forums about the problem here.


Visualise your ANT build with Grand

Ever had the feeling that your build file was a tad complex?

The above is a visualisation provided by the excellent program grand. This particular build script utilises the ASL ant library. I think it might need some love.

Producing the visualisation is very easy. Simply download the jar file and then some ant scripting…

You need to have GraphViz installed which should give you a command line program called “dot”. You can simply try :

dot –help

On the command line to see if you have it installed.

I have a working version on github


Walk the streets of your codebase: inFusion, Code City and a MOOSE

Moose is a framework built in Smalltalk for code analysis. Here’s a brief guide to get it up and running (at least on OS X). One very interesting application which is built on top of it is called CodeCity built by Richard Wettel. The instructions below are how you go about installing and using CodeCity. The picture above is a code city generated from a project I worked on.

The size of the building is determined by the number of methods, the width and length by the number of attributes and the colour by the number of lines of code (lighter blue is more lines of code). The “districts” are packages. You can see straight away from this view that we have one large “CBD” which is a result of us having a single package called “model” rather than more granular, domain related packages (.acccount, .customer, etc) which would be my preference.

A second immediate observation is that we have a syscraper; what is this? In this case, its actually a stub class, which shouldnt even be in the production codebase. Straight away we have found some value from the visualisation. I tend to believe that this may be a result of our IDE tools (such as CTRL+SHIFT+T or CTRL+N which allow us to browse classes by name). Whilst great for encouraging Ubiquitous language I think this view of the codebase is very focused and heads down, and when concentrating on delivery, perhaps we need to come up from the detail level every now and again. Its why I enjoy the package view in IntelliJ in which multiple source folders together and presents classes as top level “leaves” in the tree so that its easy to see the structure of your packages, compare to eclipse.

I recently printed out the city and stuck it on the wall and was pleasantly surprised by the interest it generated by passers by, so I think its a really useful tool for showing the team something which is inherently hard to “see”.

These instructions are for a java project.

1) Download inFusion

Although its commercial software you can download it and use it for free. It will read in your source code and save it to a file in Moose (Famix) format. This can then be used by CodeCity.

You can download inFusion here. On its own, inFusion is a useful metrics tool and provides some interesting visuals (see below) which I won’t cover in detail here. A good reference is Michele Lanzas’ work Object-oriented metrics in practice.

You can run inFusion as a gui to explore your codebase, or if you just want to get to code city, you can run it as a batch file.

To run the ui just go into

$: cd /Applications/inFusion/tools
$: ./

or (windows)

C:> inFusion.bat

To export the codebase in famix format (must be 2.1):

$: cd /Applications/inFusion/tools
$: ./ $SOURCE_DIR famix21 $TARGET_FILE

or (Windows)

C:> cd C:\development\external\inFusion\tools\inFusion
C:> java2mse.bat $SOURCE_DIR famix21 $TARGET_FILE

You may need to chmod +x the file.

On windows you can run the .bat file.

2) Load your source code

(theres a folder icon on the right). This takes a while and eventually presents you with a html view of your project stats in the bottom window.

An example of the output is shown here:

To do anything interesting, you right click (or two finger-click on a macbook trackpad) over “java” this will be whatever the name of your root directory is, maybe “src”.

One option there is to Run tool -> Famix 2.1 exporter. This is the format you want to export for code city. Its important that its 2.1

Again you might have to chmod +x the script.

Notice that you can also run another extremely cool tool, called DuDe which analyses duplicate code fragments in your code base.

3) Now your ready for code city

Download it from here.

There are versions for windows os x and linux.

The os x app is very handy and simply runs.

4) Import your MSE file

“Import Model(s) from …” “an MSE file” button.

5) View the city!

There are some keyboard shortcuts which werent obvious to me (help -> key mapping). You do W to “zoom in”, “S” to zoom out, “A” to move the whole scene left and “D” to move the whole scene right.

You can then navigate around using the arrow keys. If you press CTRL with the arrows, you rotate around the sphere of observation.

Some other cool features are to toggle contextual edges on (its a menubar icon, hover over them). You can configure contextual edges with incoming or outgoing invocations and then select an object and see “wires” indicating where the connections are.

Other features:

Make a snapshot of the picture as png
Import a set of MSE files and see an evolving city
View class blueprint of the classes

Enjoy your city!