Monday, December 10, 2007

Google Maps and the Sony Ericsson W850i

A friend of mine demoed Google Maps My Location feature on his mobile phone. I had been using google maps for a while so downloaded the latest version - but alas no 'My Location' feature.

Time for a firmware update

Sony have a couple of apps required for the job. The PC Suite contains all the drivers and an update program for the firmware. Installation under VMWare Fusion was seamless. The UI is quite flash but it still took me a couple of goes to realise that the 'C' button the instructions referred to was the Cancel button rather than the 3 button (it was late in the evening).

Once the firmware was updated and GMM installed the location feature got me to within 100m - not bad as I was sitting in a basement flat! The directions feature is fab - working off a postcode the route to work (driving) was pretty good.

As a bonus the software on the phone felt a lot more responsive - although some of the options had move around.

Monday, October 29, 2007

Polygot Programming analogy

I have been following a short email thread at work on Polygot programming (developing applications in more than one language). In its simplest form it is unlikely that an application contains a single language. Most applications involve some sort of XML :)

While reading the thread and a side note on construction I was struck by the thought that one could draw an analogy between a computer language and a construction material.

When putting together a car for example the designers choose materials that are suited to the job at hand. Each material chosen for its properties and application. A car made entirely using a material with a small set of properties (e.g. metal) would at the very least be very uncomfortable (steel tires).

With this thought it mind it is surprising that people continue to maintain the premise that a software application should be written in a single language. At best you get an explosion of code around the areas where the chosen language is not that good. At worst you see huge frameworks to get around the limitations.

Getting different languages to behave nicely together is not easy. Recent developments in leveraging runtime environments (JRuby, IronPython) make this interoperability simpler to manage but the problems rarely go away. The analogy with car manufacture works quite well - it is usually the interfaces between one material and the next where problems turn up.

Pushing the analogy even further it has been some time since carpenters have joined pieces of wood using wooden pegs preferring in the main to use screws. Steel screws are stronger than brass but brass is preferred for wooden boats because it resists the effects of sea water (as well as being more aesthetically pleasing).

Going back to automobile analogy the instrumentation systems use many different materials to delivery the required user interface, whilst the business end (engine) uses a more constrained list of materials (although in recent years this too has been growing). You could consider the instrumentation to be the equivalent of JavaScript on web applications whilst the engine corresponds to the back end systems (just a thought).

Thursday, October 18, 2007

Subversion missing tools

Recently our team source code repository developed a problem. To be fair I don't believe that the problem was with subversion but with a disk fault but the effect was the same - subversion had a problem with one of the revision files.

After talking through the options we thought that we could replay the revisions using the svnadmin dump command and pipe the output into a new repository. Once for all the revisions up to the faulty one and again for those past the problem to HEAD. This did not work the receiving repository did not like having discontinuous build numbers.

I tried various utilities that reported they could fix fsfs format svn databases but non found or fixed the problem.

I ended up copying the previous revision over the faulty one - giving me nightmares about that missing revision. Now time to start digging through the backups for a good version of that file.

If anyone knows of a good tool that can dig into the svn filesystem to allow hand patches of revisions please let me know.

Thursday, October 11, 2007

Starting out with Numbers

I managed to hold out for quite some time (for me some time is past the launch date) before splashing out on a copy of iWork.

I have been using Excel on my Mac but wanted to know if Numbers (part of iWork) gave a fresh perspective on how a spreadsheet should work.

I have to confess I have not spent a lot of time with Numbers yet but so far I have not been disappointed.

Key features that work for me

  • Column and row headers as explicit items but still addressable
  • Inline computation of results as a formula is filled into other columns
  • More intuitive insertion of newlines in cells (got it on the 2nd try)
  • Simple menus and text wrapping as an option on the toolbar
  • Sheets start small and grow as the data grows.
  • Easy import of my existing spreadsheets

It is still early days but so far very pleased :)

Thursday, October 4, 2007

The beauty of small applications

A great colleague of mine just posted an article suggesting the Death of Enterprise applications.

I like the post it has a lot in common with the approach taken on for command line UNIX applications. Each command line app has a well defined responsibility, the OS provides a simple set of capabilities that allow these applications to communicate with one another. Using the applications and the 'glue' provided by the OS users can perform far more complex tasks. Adding in the shell means that applications can be developed just using the existing applications and OS communication.

In the world of web applications Sitemesh provides the glue roughly equivalent to the OS glue provided by the command shell. By developing applications in the progressive enhancement style allows web applications to be glued together to provide a cohesive web experience to the user.

Other benefits

* Each web application is partitioned into its own space. (loose coupling)
* 3rd party applications can be incorporated into the user experience more easily


For some time developers writing applications for managed virtual environments have been enjoying the benefits of being able to interrogate and control the and generate code at runtime. When used appropriately these additional elements have delivered significant advantages - particularly in the tools world. Mocking libraries would not be easy to implement in a non-managed environment.

In the world of build management we have seen an explosion of tools that make it easier to deliver components and applications into a production environment.

One element of the picture that we have not seen a lot of progress on is environment control and deployment. Currently there seems little support for automated environment setup or deployment testing.

Sloth Development

Sloth Development Update

So I have been working on [Sloth]( for a few weeks now - mostly on the back-end compiler and execution engine. The journey has been quite interesting so far. A model for Functional Integration Tests is evolving in the code base and this is making the testing and Jave code generation easier. Since the test will need to be stored somewhere (initially in the FitNesse wiki format) the engine needs a way of loading and saving the pages. This has been extracted into storage specific repositories that are responsible for mapping to and from the storage system to the model.

Essential Software for a Cooler Mac

I moved over to a Mac early in 2006 and have been impressed. It has done everything I have asked of it and more. It has become an essential part of my life both as a work tool for software development and in my personal life for music and photo management.

But one irritation is how hot it runs. I know that this is a generally a problem with laptops but I had hoped that my MacBook Pro would have solved this issue.

So after a couple of years of having a warm lap a colleague of mine put me on to smsFanControl which allows control over the system fan's minimum speed. The default 1000 rpm means that I get a hot lap. Pushing this up to 2500 or 3000 rpm really makes a difference and to my ears does not make that much more noise.

One very happy chap and would really recommend giving the app a try.

Thursday, September 20, 2007

Keep the story wall clean & tidy!

Like so many artefacts produced and consumed during a software project keeping them up to data and simple is vitally important.

For an agile project where the aim is to keep the number of such artefacts as low as possible this should be straightforward but it is easy to let this sort of project hygiene slip. After all if everything is working well the cards only live for a short time, they collect data during the iteration and perhaps into testing but after that they are of little value. If they live for such a short time why is it important that the cards be written clearly, identify where they came from for traceability etc.

Keeping the story cards clean helps the team by reducing the number of times related information is sought. For each discrepancy between the card and its context someone needs to work out what the differences are, if they are important and what should happen. By not reflecting this on the card as a simple note edit it is likely that someone else will need to go through the same process.

It is arguable that if this situation arises that the stories are too big and the cards are spending too long in development. I like to make sure that each story is a coherent vertical slice of functionality with a starting point and user visible result. Sometimes it is not practical with this constraint to slice the work into a story that is both quick to implement and satisfy the requirement to deliver a useful and visible result.

It does and should not take much to keep the wall clean. If it does then story wall hygiene is probably not your biggest problem.

Tuesday, July 10, 2007

Sloth - The lazy man's path to FitNesse

Sloth Into

Sloth is a new open source project targeting the Functional Integration Testing space. The basic idea behind Sloth is to provide an extensible development and execution environment for FitNesse wiki pages.

Personally I have always been interested in efficient frameworks and code generation and one of the ideas we came up with was to generate Java code from the test specification in the wiki page which could then be compiled and executed.

This code generation approach has a number of advantages.

  • There are many, many tools for managing compiled Java code

  • Bytecode is more compact than wiki source if the tests code needs to be moved around

Monday, June 18, 2007

Virtual Journys #1

For some time I have been a great fan of virtual hardware and the now opportunities it brings.

For most of this year I have been working on a large enterprise scale Java application targeting IBM WebSphere. Currently this configuration is only available on Windows and Linux so my Mac OS-X is out in the cold. During the day I work using windows and in the evening OS X for my own projects.

With the availability of Parallels and VMWare's virtualisation systems for the Mac new options are available. The most obvious is to create a Windows development envrionment for work running entirely in the guest Windows operating system. I thought I would try a different options. I would keep the source on the host OS X filesystem and perform builds using the virtual machine. Both Parammels and VMWare allow the host filesystem to be accessed as a network server. For windows this means that you can map the host files as a network mapped drive.

My first experiment used Parallels. The source was located on the host drive and I mapped a drive from the guest Windows system to the host source folder. I use helper batch files to move around the source and do tageted builds (e.g. bvt for ant -f custom-build.xml bvt) which seemed to be a problem for some reason. To run the CMD files I found I had to type bvt.cmd rather than bvt. It appears that the bvt is not sufficient to find and run bvt.cmd - very odd.

Otherwise things appear to work fine.

I exported the guest image using the VMWare importer tool to the host filesystem and booted the new VM in VMWare and set up the mapped drive in the same way. This time bvt was sufficient to find the bvt.cmd so there must be a difference in the way the shared filesystems work.

All the VMS are running on an external USB drive. Having the VMs there is convenient if I want to boot them on another computer and I find that the performance is faster with a second drive. I have used two types of drive. The first is a simple 160GByte laptop style drive which is convenient for travel. The other is a 150GByte 10,000 RPM raptor drive which is really sweet and I think faster indicating to me at least that USB is not the limiting factor for the slower drives.

Saturday, June 16, 2007

Terminate SQL Server processes for a database

I have come accross the same problem several times now and have had to google for the answer. This one is the best one I have found so far. I take no credit for the script but I have lost the original link so my appologies to the original author. If you read this please let me know so I can supply credit.

declare @spidstr varchar(8000)

select @spidstr=coalesce(@spidstr,'')+'kill '+convert(varchar, spid)+ '; ' from master..sysprocesses WHERE dbid=db_id('database name')

if @spidstr != '' exec (@spidstr)

The script can actually be put on a single line which makes running it from Ant (etc) very easy.

Quite often as a developer I need to rebuild my test database. However it is often the case that there are processes still running. It would be nice to track them all down but this is time consuming and it is often easier just to kill the processes in the database server and rebuild then retest.

Sunday, June 3, 2007

Why I bought Mac

Why I bought a Mac

Just over a year ago I was working in the US on a Java project. My day to day work was was done on a PC and I was looking for something different. An addicted laptop buyer I had been through a number of dells and had a very nice Veio but still I was not satisfied. I had tried customisations of the UI and alternate technologies for software development. In a recent article Martin Fowler talked about boredom when it came to Microsoft and its development tools. Maybe that was it but for whatever reason with the advent of the Intel based macs and virtualization I could run windows if I needed to in a VM but I would use the native OS for my day to day requirements.

So it is just over a year later was the decision I made a wise one? Hell yes. The day I turned on my mac and saw it boot from cold in 25 seconds was a changing point. A year later it still boots from cold in just over 25 seconds. I have installed and uninstalled lots of software and still it continues to perform. Applications start reliably in the same time that they did when they were first installed. (I had always found that I needed to reimage my windows system once a year to get it back up to speed).

So I sit as my desk typing this message

Macs Rock

Maintaining principles, values and culture

Maintaining principles, values and culture

I am currently working out of my home country on assignment in Sweden. Anyway, working away tends to means that I quite often get to spend time with my colleagues over dinner and talk about work, technology, people and generally put the world to rights.

The other evening was just such an event and after talking about work and life in general we started talking about company values and I recounted some things that I had seen during my life as a professional software engineer.

In the early life of a company the company is a direct reflection of its employers or more typically the mind of the person heading up the company. In this early period especially for software companies it is likely that the company has a very casual attitude to dress and personal expression. The people joining the company at this time are often attracted to the company because of this relaxed approach. Encouraged that hard work and thinking are valued over conforming to corporate stereotypes.

As companies grow they attract employees with a different view and customers who may expect a different set of values. This difference quite often sets up conflicts or 'growing pains'.

I believe that these changes in company culture and expectations in most companies go unnoticed or are simply accepted as part of growing up. But should this be the case? If I were to visit the offices of a design company I would expect to be surprised. I would expect a 'different' approach to office layout, dress and a more 'creative' environment. Why? Because I am looking for that type of organisation.

So why is it that when looking for someone to help with a software development problem I expect to see people in suites? Surly I am looking for creative solutions to my software development issues not someone who will try and apply a formula to my problems. My personal view is that a company should decide what type of company it wants to be rather than just become what everyone else expects it to be.

Keeping Unit Tests Small

Unit testing has become one of the mainstays of modern software development. Techniques such as Test Driven Development have delivered significant benefits in ensuring that the developed software is testable.

Designing good tests however seems to be a skill in its own right. I have seem many people struggle to hit the right level. I am not surprised by this - it took me some time to become happy with with my unit tests.

So I thought I would put some time to documenting what I have learnt about writing good unit tests.

  • One test - one feature

  • Keep the environment out of the tests.

One test - one feature

It is very tempting to shore up test code with many assertions. I have found that this makes the tests overly brittle. On failure more diagnosis is required to find
the cause of the problem. With more than one assertion you need more than the test name to find the code causing a problem.

Testing a single feature also makes it easier to name the test - name it after the feature! Not after the method name or class. Grouping the tests together for tests referring to a single class is useful for organisational purposes but beware of reflecting the method names into the tests.

A language for test

Writing tests is hard

Writing unit tests is hard. Often harder than writing the application. Our current choice of languages does not help much. General purpose programming languages were designed to solve application development problems not necessarily help us test the application under development. Virtual machines such as Sun's JVM and Microsoft's .NET runtime provide basic support by exposing the code meta-model so that test frameworks can be developed. To my knowledge 'test frameworks' have not been made high priority aspects of current language design.

Initiatives like [Behaviour-Driven Development]( (BDD) add new dimensions to verifying the behaviour of an application. BDD uses a constrained analysis language to define the intended behaviour for the domain model. This behaviour statement is then used to generate executable code that it then run against the application.

BDD is an important step but is by its nature a confined to particular types of application (those with a domain model).

So what could a test language look like?

test-case: test case name
given ::=
BankAccount (Balance => 12.50, OverDraftLimit => 100)

verify that ::=

Monday, May 28, 2007

GPS Units and the Mac

Just over a year ago I switched to one of the nice new MacBook Pro's with Intel chips in them. This was a hard decision. I had been a Software Developer on the Windows platform for just over 20 years and felt pretty tied to the platform. But life moves on and I had the good fortune to be working on a Java project and hoped to do more with Ruby so a Mac made sense. I also wanted to immerse myself into a different OS and the Mac seemed ideal.

I still had some reliance on Windows based software so made sure that I got hold of a copy of Paralells but have needed it less and less. One bone of contention though was the lack of support for GPS software. Initially the USB drivers just did not work in the virtual machines so I had to rely on PCs here and there to transfer my walk information.

I was delighted to read that Garmin have stated work on supporting Macs! Oh Happy day.

String Template for code generation

I have been a fan of the ANTLR parser generator by Terrance Parr for some years and used it in some of the tools I have developed to make life a little easier.
Recently on a project I was looking at the output stage of a Java code generator for FitNesse fixtures and thought to compare the way the code was being produced (inline strings and print statements) to ANTLR and discovered that version 3 of ANTLR uses the StringTemplate library. Further digging revealed a really cool library for text file generation based on a domain model.
Really cool

Monday, May 14, 2007

FreeMind Retrospectives

I was turned on to FreeMind by Dan North and I have to say it has been some time since I have been so impressed with a piece of software (commercial or open source). It just works in an intuitive and immediate way. Once installed I was happily brainstorming away on ideas that have been sitting in my mental todo list for quite a while.
On my current project the team is not co-located and this causes problems with team retrospectives. Working on a whiteboard does sort of work as long as the contents is regularly read out to everyone. Web cams might be an option but even over a fast link it is difficult to get sufficient quality for text to be readable. I have strongly resisted using a software tool and desktop sharing during retrospectives because I feel a lot is lost in the process of capturing the teams thoughts.
But I think FreeMind is different - speed of entry is key to capturing information quickly and FreeMind seems to have the right keystrokes for the right commands (Mac and Windows versions). Ok it helps if you are a keyboard junkie rather than a cat chasing mice! Spreadsheets and Word processors would allow similar capture speeds but then you are left with lists and headings and to be honest the results are fairly boring and require time to clean up and format into anything presentable.
Mind Maps are different. They more closely match the organic data collection process of a retrospective. The HTML export option should help those of us using Wikis to manage project documentation.

First retrospective

For the first retrospective we used NetMeeting to share a single desktop to the remote teams. One person was designated as the scribe - initially a new team member of the team but someone outside the team would have been better.
The results were impressive. I was able to keep up with the conversation, summarise the discussion and contribute occasionally. The cool part was when it came to adding actions to the items. The actions naturally entered as child nodes on the mind map to the issue and could be flagged with a simple icon.
The really cool part was after a quick export to .jpg file and an upload the results of the retrospective were on the project wiki for all to see.

Tools support but do not make a retrospective

Although I have dwelled a lot on how FreeMind has helped run retrospectives for distributed teams it is important not to let the tool drive the process. For co-located teams I am still a big fan of index cards for rapid collection of raw opinion.

MSDE Setup

Old Entry

I have been setting up MSDE a few times recently (same server) to operate as a remote database server. Out of the box the MSDE engine installs for Windows security and no network access. I also needed to use SQL security mode because I could not obtain a trusted connection to the server.
The setup parameters I used are noted here so I don't forget them and incase they are useful to someone else trying to do the same thing.

Monday, April 2, 2007

Software Projects as Rock Climbing

This post on CodingHorror struck a chord with me. I had always thought that my favourite sport was similar to writing software but this really makes the point well.

Thursday, March 1, 2007

Simple Cruise Control Block Diagram

I realized today that I had not seen a simple block diagram of a typical continuous integration system and how it interacts so I thought I would put one together.

Tuesday, February 13, 2007

Software Development Tools

Java Development

.NET Development

Ruby Development


Monday, February 12, 2007

How done it looks implies how done it is

Kathy Sierra and Dan Russell have an excellent article on prototyping and how the prototype influences the audience

Makes very interesting reading. Have to admit I have fallen into this trap before and spent some time persuading people that the application is not as advanced as the prototype could make them believe. Matching the maturity of the prototype to the maturity of the application makes a lot of sense.

Thursday, February 1, 2007

Courage to do the right thing...

Doing the “right thing” is often hard

Being sure that you know the right thing to do is not that easy either.

So why do we often need courage to do the right thing? Surely doing the right thing is what we do all the time right?

We all live in an imperfect world constrained but time, resources and our tools. Often doing the right thing seems too expensive to do and doing some less than perfect updates to the code or environment feels so much more attractive.

So why do the right thing when doing a less than optimal change delivers a result that works? Surely doing the 'simplest thing' that could possibly work says that making pragmatic decisions is ok?

Often it is difficult to put into words why doing something is the right thing to do. Often is is just a feeling that something needs to change. The trouble with these sorts of feelings is that the do not go away - and in a way I am glad that they don't because often putting off doing something about them turns out to be a bad idea.

If at all possible listen to your feelings 'do the right thing' and change the code.

Technorati Tags:

Wednesday, January 31, 2007

On the subject of lists

When I am under pressure to deliver and there are a million and one things going on both in and out of my life I start making lists. I know that I should do this all the time because I know it really works but when the number of items on the list is small I always think I can hold the list in my head. It is only when things get interesting that I resort to list making.

But what should go on these lists. The bottom line is almost everything. I keep at least two lists both in priority order, one for work and the other for the bits I try to do out of work.

The list for work items helps me maintain balance by keeping the high priority items at the top I know that I just need to work my way down the list. By having a list for personal stuff I can make sure that in the odd moments when I am not actually working I know what I should be doing.

Having the lists mean that I do not have to keep remembering what to do next.

Simplify your life - make lists!
There are some excellent descriptions of how lists can be made to work for you over at the In particular

Managing your day

Working as a coach I sometimes hear the complaint that interruptions and additional tasks cause significant pain to a development team.

Often people are asked to do things that were unknown at the start of a sprint/iteration but appear to be urgent/important when the sprint is under way. Since these activities are unplanned and unbudgeted taking on these tasks can put the sprint goals in jeopardy. It may be that the requests seem innocuous - an hour here or there, what harm can it cause?

Individually these additional tasks may not seem significant but these interruptions add up and can start taking over. They also establish a pattern for the future and people get used to asking for more and more of your time.

Switching tasks and not being able to complete one task before being pulled off onto another one should not be underestimated. It is not easy to pick up some development work even after a break of an hour or two!

Keep a list of things that you have done during a sprint that can be used to adjust capacity in the next one. Make sure that the Scrum Master or Iteration Manager is aware of these interruptions (they should be consulted anyway). Make sure that these additional tasks really are more important that the current goals!!

Pair Programming

Not sure if this is just a way of not forgetting a good blog entry or not but Naresh Jain has written a very useful FAQ on pair programming at

If you are interested in trying out pair programming or have found it does not appear to work for you then I suggest you check it out.

Monday, January 29, 2007

Testing Application fail-over using Virtual Hardware

Application availability is one of the key features of many designs. e-commerce web applications are a particular example where the application should be available to customers as much as possible. A common model to achieve this is to have a number of servers available. Should one server fail the other servers pick up the request and deliver the result to the customers computer.

Although this design is simple in concept and with a lot modern server systems straightforward to implement testing the failure scenarios is often a complex and demanding task. Typically this sort of testing is done manually by disconnecting a server from the network or terminating processes on the server.

Virtual hardware can provide a cost effective alternative and provides capabilities that are not available when using physical servers.
Lets take an example
  1. The customer clicks on the ‘Add to basket’ for a widget
  2. The request is serviced by server A and returns a page representing the basket containing the selected widget.
  3. The customer clicks the ‘Proceed to checkout’ button
  4. The request is serviced by server A and returns a page requesting payment details for the basket containing the widget.
A fail-over scenario might look something like this
  1. The customer clicks on the ‘Add to basket’ for a widget
  2. The request is serviced by server A and returns a page representing the basket containing the selected widget.
  3. The customer clicks the ‘Proceed to checkout’ button
  4. Server A has a network fault so the request is serviced by server B and returns a page requesting payment details for the basket containing the widget.
In production this might be caused by a rodent chewing through a cable at at critical moment or some other hardware fault. But how do we test this easily.

Virtual machines typically use a virtual network connection routed through a physical connection or completely virtualized on a single host server. With VMWare Server and Microsoft Virtual server this network connection can be controlled by the host or by an application controlling the host. The last option is the most interesting because it allows the connection to be controlled programatically in the test code.

A test might then look like (pseudo code)
result = http.request(“”)
VirtualHost.ServerA.Network = disabled
result = http.request (“” + result.orderid)
The ability to automate these tests should not be underestimated. More complex scenarios can be developed and executed easily. The test code can be run frequently perhaps as part of a continuous integration system. Execution time for the tests is now much faster - no manual interventions. Removing the manual steps makes the tests repeatable and less prone to execution error.

Developers, Quality Analysts and Architects gain a much greater understanding of how resilient their application is to failure which leads to a greater confidence that the application will behave as expected in a production environment.

Saturday, January 20, 2007

So what is this blog all about?

To be honest I am not too sure. I have a number of other blogs for family and one syndicated through work so why you ask should I have another one. Well this one is for me to talk to myself and anyone else out there interested in hearing what I have to say about writing software.

I love working in this industry! I see it as a privilage that I can be paid for doing someting that I love to do. Hopefully there will be some gems of wisdom here that other people will find interesting, hate or perhaps even amusing.

Only time will tell.