tisdag 17 maj 2011

Why not how nor what

Here's a quick summary of my career as a programmer.
  1. write working code
  2. don't understand my own code when I return to it later
  3. write lots of comments in my code
  4. still don't understand the code since the comments didn't get updated when code changed
  5. write clearer code and fewer comments
Interestingly one of the 97 things every programmer should know is write plenty of comments while another is write fewer.

Confused? No need to be. Just comment why you've done something a particular way. If you find yourself commenting on what your code does or how then make the code clearer instead.

tisdag 19 oktober 2010

Agile cyclist

Cyclists seem to be universally hated by motorists. A hate that is hardly in proportion to the inconvenience the cyclist occasionally causes.

Or is it perhaps envy? The cyclist can cruise past grid locked drivers, ignoring the normal rules of the road on a machine that costs a fraction of what the motorists paid for his vehicle. And has more fun too.

A bit like agile development really. Cheap, gets you there quickly and you have a lot more fun on the way.

söndag 19 september 2010

Stay loose

Loose coupling in complex systems is almost universally regarded as a good thing. So I've been surprised how often and how vigorously we have had to defend the system we're developing from other systems wanting to access our private parts.

Problems caused by tight coupling are not restricted to IT systems. Two recent incidents reminded me of just how important it is to think very carefully before introducing unnecessary coupling in any complex system.

A colleague, lets call him Pontus, was travelling to work in his new car when it came to an unexpected standstill. Now this particular model has a feature which reduces the engines effect as it starts running low on fuel. But Pontus hadn't run out of fuel; the petrol gauge had malfunctioned. Normally not a critical problem, unless the petrol gauge is coupled to the engine ...

This type of problem doesn't only affect cars; trains are also susceptible.

Last week I was travelling to work by train when it came to an unexpected standstill. A toilet malfunction was immediately suspected. Now a dodgy toilet would not normally be a critical problem, unless the flush uses the same vacuum system that powers the train's brakes ...

So beware of creating unnecessary coupling. You will regret it. Maybe not today, maybe not tomorrow, but soon and for the rest of your life.










onsdag 27 januari 2010

JFokus sound bites

Yesterday's journey to JFokus was fraught with difficulties (signal failure, accident, snow storm) but it was worth the journey.

Here are some sound bites I jotted down (freely translated where necessary):

That which is normal isn't always best (think royal family).

On certification: Outsourced competence judgement

On developing systems:
Everything we do, we do for the first time. Otherwise we're doing it wrongly and should be using existing components.
... which is why Gantt charts never work. You can't predict the unpredictable.

best practices proven practices

Certification again: sheep dip training

Scrumitis - done doesn't mean done done

white water rafting (doing scrum in a waterfall way)

come back when you're doing one week sprints (on scrum coaching)

On average all stories are average size. (track stories not hours)

Get good at stories (key to succeeding in scrum)

Write small stories - all stories should be size 1.

You get what you measure (dangers of focusing on metrics)

Let the architects work directly with the teams as consultants.

Hundreds of bug fixes (Maven 3)

Give positive feedback in a 5:1 ratio to negative feedback.

Create an environment for creating something new (on leadership)

Freedom leads to creativity.

Leadership cannot be separated from the situation. Nobody can be a great leader in all situations.

Information which has value is knowledge.

måndag 12 oktober 2009

FitNesse revisited

I recently wrote about FitNesse saying that our goal was to allow domain experts to get on with testing while the developers could concentrate on building new features.

Wrong. Wrong. Wrong.

What I should have said was that the key to acceptance testing with FitNesse is collaboration. Testers and developers should work together when writing tests and developing features. This is what FitNesse makes possible.

Testing will always come at a cost. The trick is to make sure the returns exceed this cost. Junit has made this possible for unit testing.

When it comes to acceptance testing, the cost-benefit relationship is not so clear. FitNesse can swing the balance in favour of automation. So here's my revised list of tips for how to do this:
  1. Collaborate when creating acceptance tests. Developers and testers should be encouraged to work together.
  2. Create separate FitNesse fixtures for setting up test data, exercising the SUT, and making assertions on the result.
  3. Names are important. The readability of your test cases will improve.
  4. Write unit tests for your fixtures. Their design will benefit.
  5. Keep your tests independent. Intra test dependencies will lead to tears.
  6. Use dependency injection. Decoupled fixtures can be reused more easily.
  7. Document your fixtures. This will help you write clear test cases.
  8. Think carefully about logging. Debugging will be less painful.

torsdag 10 september 2009

Pythagoras moment

Monday evening was spent discussing retrospectives with fellow members of the Swedish Scrum User Group. I came away from the evening with a few new ideas but it wasn't until a couple of days later that I had a pythagoras-in-the-bath moment.

But first more about Monday. Once again we used the Open Space format for this get together. As Harrison Owen puts it:

Open Space Technology is effective when real learning, innovation, and departure from the norm are required. When you aren't quite sure where you are, and less than clear about where you are headed, and require the best thinking and support from all those who wish to be involved, Open Space Technology will provide the means.

Hold your horses! Isn't that also a perfect description of a retro. A bunch of enthusiasts getting together to come up with imaginative solutions to tricky problems. Why use open space just to discuss retros when open space can be used to do a retro? Eureka! Now I know how I'm going to do our next retro.

torsdag 3 september 2009

Retrospective serendipity

If we hadn’t run out of time at our latest retrospective then I wouldn’t have discovered SurveyMonkey.com.

We usually end our retros by dot voting on a list of suggested improvements. This time the retro had been particularly fruitful – lots of interesting discussions and a dozen improvement suggestions. And then our time ran out.

With various team members already heading off to their next meetings I rashly promised to send out an internet based survey so that we could at least prioritize our improvements list before the afternoon’s planning session.

And then I started to wonder if I’d promised too much. With no time to do an in depth market analysis and after a quick google I selected SurveyMonkey. A choice I wasn't going to regret. 15 minutes later the survey was sent out and in the following planning meeting we had a nicely prioritized list of suggested improvements.

It worked so well that I think we’ll do it this way again – even if we don’t run out of time in our retrospective.