Geeky Learning-casts

September 28th, 2008

I’m constantly reading, watching or listening to stuff that makes me learn an I recently found the following very useful and timely for the work I’m doing at the moment (or in the near future).

Software Engineering Radio - fantastic podcast

August 24th, 2008

About two months ago I stumbled on the Software Engineering Radio podcast, and in my opinion it’s one of the best techy podcasts out there (anyone knows any different?).

There are currently 107 podcasts available and the 13 I’ve listened to (and listened to again) have been worth their virtual weight in gold.  There are a lot of interviews about many, many topics and the interviewees really know there stuff.

SE-Radio is an invaluable resource for the professional software developer.

Productivity Boost

April 26th, 2008

mouse.jpg

Inspired by Neal Ford’s talk last weekend at the No Fluff Just Stuff conference in Seattle I have recently spent a little bit of time installing a bunch of utilities and setting up my MacBook Pro ‘just so’.  I’ve always hated using a mouse, it’s always so damn far away from my hands when they are settled above my keyboard.  But being relatively new to Mac OS X (I was previously mainly using Linux for about 5 years) I wasn’t aware of what could be done to prevent the need to reach for my mouse so often.

An interesting thing to note about the NFJS conference is that all the presenters were using Macs: the majority of the attendees were also using Macs.  So it was a great chance to pick up tips and tricks.

Anwho, the changes I made:

  • Quicksilver - shortcuts to launching apps and sooooo much more
  • OpenInTextMate - open the files or directories currently selected in Finder (Quicksilver trigger: alt-shift-m)
  • OpenTerminalHere - open a terminal for the directory currently viewed in Finder (Quicksilver trigger: alt-shift-t)
  • lselect - select a bunch of files based on glob expressions in Finder
  • Zipeg - viewing archives without expanding them
  • Global shortcut to pop-open finder - ctrl-alt-cmd-f
  • Making IEs 4 Mac work with Outlook Web Access - Public Folders, Calendaring, etc.
    • Make sure you you have your WINEPREFIX pointing at the version of Wine IE is using (caught me for about an hour)
    • IE does monster my CPU, but at least I can book a meeting room myself (my team will be very happy about this)
  • Grand Perspective - a tree map view of your harddrive - no productiviy boost in itself, but it allowed me to find large files I didn’t know I had and do some spring-cleaning.
  • Witch - a better task switcher

Finder’s new toolbar

Even whilst setting this stuff up I found myself naturally using the new shortcuts, so I’m very hopeful that my productivity will get a good boost for a moderate investment of time.

The Ultimate Commit Token

April 24th, 2008

I’ve rarely had to use a commit token.  The teams I’ve worked in generally edit unrelated source items as much as is possible.  Over the years I’ve read about various amusing items being used as commit tokens: rubber ducks, action figures, hats and little flags, to name a few.  The general idea is that you should physically have the token to be allowed to commit - meaning there are no updates made to the source repository so your changes will go in cleanly.

It is possible that this could be side-stepped though - Mr Naughty Committer might pretend to be holding the Pokémon and commit - how can the source repository be expected to know where Pikachu is at any given moment??

However, one of my colleagues had a great idea the other day - ‘The Ultimate Commit Token”.  Simply appropriate one of those single use password setups with a single key fob.  You could try borrowing it from your corporate VPN setup - I’m sure they wouldn’t miss it.

The Ultimate Commit Token!

 Wire your pre-commit script into the server-side element and have the fob floating between developers.  Et Voila! One very annoying, yet extremely effective commit token!!!

I know, I know, it’s not very exotic looking, but fear not!  I reckon it would look natty glued to the back of Spud Of Nine.

 

Spud Of Nine

Don’t name your test for the class under test

March 11th, 2008

Whenever I play in a new language one of the first things I do is to install the appropriate xUnit framework to get feel for the language.  For my Java code I have been using JUnit for many years.  My use of JUnit hasn’t really changed over the years, but some things have been bugging me for a while.

One of the things that has bugged me is naming the test class for the class under test.  That is, if the class under test is Banana your test class would be called BananaTest.  There are obvious advantages to this pattern:

  1. You know where to look for the test code for a class
  2. You can find all the test classes very easily - using filename pattern matching.

However, there are several disadvantages.  One is that it ties you to having a single test class for each class which can cause problem.  I have often found myself writing or maintaining large test classes that combine testing different aspects of the class’ behaviour.  Some of these classes would exceed Checkstyle’s line length limit for a method.  One solution to this is to blindly split the class into two classes.  What then to call the new class?  Banana2Test - not very descriptive or helpful.  Maybe we should name the test for the aspect of things we are testing, e.g. BananaSlippynessTest or BananaFlavourTest.  But now the test isn’t following the original naming convention.  This isn’t a big problem, but is there maybe something we can learn from this.

Apparently there is.  Yesterday I attended an Agile Vancouver workshop - “BDD and TDD code off”.  Our group chose to use TDD which is still fairly new to me.  I was lucky though that Peter, who was in our group, was an experienced TDD’er.  It was an interesting experience and the code we produced was a little different to the code I would normally produce.  I don’t yet know if the code was better or worse, for now it was just ‘different’.

That workshop drove me to learn a little more about BDD, so I watched the Google Talk of David Astels introducing BDD and he mentioned how BDD tests are typically structured - around the different expected behaviours.  One example he gave was testing a List class.  You would likely have a test class called EmptyList which would contain the specifications for an empty list.  For example: Ensure list has size = zero, Ensure list iterator has no items.  This test class would contain the specifications for just empty lists.  I assume you would then add a test class for a non empty list, and perhaps another to ensure the ordered-ness of list, and possibly several more.

I’m not sure if I’ll be adopting this in my current project at work just yet.  Doing something different without hard and fast rules can confuse people and can put people off testing, which I really don’t want to happen.  However, in my pet projects and fiddlings I think I’ll be experimenting a little more.

Subversion Change Sets

February 19th, 2008

For some time now I have been looking around for change sets in Subversion, the ability to group files together connect them to issues and commit and track them as sensibly labelled groups with the ability to merge these groups between branches without having to specify individual files.

Many years ago when working for a telecommunications company in the UK I had the pleasure of using ClearCase and more importantly ClearQuest. I seem to remember being able to see the files I was changing for any specific issue at a glance. My job as a build engineer was also made much simpler being able to working with the change set abstraction doing just as I describe above when it came to merging. So scouting around the interweb I went.

The first interesting thing I hit upon was clearvision’s ClearQuest Subversion Integration this seemed a bit like what I was looking for and not too badly priced, except where I work now doesn’t use ClearQuest and isn’t about to. On my search went.

I eventually found this page on Auke Jilderda’s blog which detailed some of the changes coming in Subversion 1.5 to arrive late summer.

Subversion’s upcoming 1.5 release is scheduled to deliver the core merge tracking feature with subsequent releases likely extending this. Fundamental to all merge tracking related functionality is the functionality to automatically record what change sets have been copied, or merged, where. On top of this, the 1.5 release will deliver the following functionality:

  • Repeated Merge
  • Cherry Picking
  • Record Manual Merge
  • Rollback Merge
  • Block/Unblock Change Set
  • Automated Merge

That sounds pretty much exactly what I was looking for - and then some :)

The first comment on Auke’s post then led me to the SVK project which also seemed to offer a lot of these types of feature already (as the comment mentions). I agree with the later response that Subversion could do with these features in its core, rather than in a specific client, particularly as we don’t currently use that client and we use Eclipse a lot. SVK is interesting to me for another reason though, its similarity with git. From the little I understand about git it provides a very different way of thinking about version control which obviously fits the Linux developers quite well. I recently read something about git and the way it provides a decentralised approach to version control, and providing a new style of file system at the same time.

Along with the Mylyn Eclipse plugin and a few other things I’ve seen there’s a lot of fun things going on the configuration management space at the moment. I’ll be keeping my eyes peeled and hoping core Subversion change sets arrive early.

Hello World

February 9th, 2008

It does for for programming, it’ll do for blogging - Hello World!