Wednesday, September 30, 2009

Aiki and Agile Software Development

I know it may seem like a bit of a stretch to compare agile software development with the Japanese martial art of peace and harmony. But if I can draw parallels between software development and playing football, it really doesn't take that much to stretch the imagination a bit further and compare it to Aikido.

Take this for example: a person's natural instinct when threatened with bodily harm is to move away from the threat. In Aikido, students are taught something that goes against this natural instinct: irimi, or entering into an attack.  Turns out this can be a valid and very effective response, too, as long as you know what you're doing and you observe a few very basic principles.

For many programmers, their natural instinct when faced with a coding problem is to start writing code to solve the problem. Writing a unit test first to explore the problem and a possible solution is as counter-intuitive as moving in closer to the source of a physical threat.

However, with practice, both programmers and students of Aikido soon realize that sometimes the safest and most effective way to deal with a problem/threat is that which goes against their natural instincts, again with the caveat that some very basic principles must be followed. With even more practice, new habits are formed and moving in or writing a unit test first becomes the new natural instinct.

Some of the basic principles used when executing an irimi movement include tai sabaki or moving your body to a position that will render the attack harmless and from which you can begin to control the attacker, kuzushi or breaking the attacker's balance or otherwise gaining control of their center, and zanshin or "remaining mind" where you maintain a mindful connection with the attacker after executing a technique so that you can transition smoothly to the next action, if necessary.

For the agile programmer, irimi is making the decision to ignore your natural instinct to start writing code or reach for your debugger but instead write a unit test first.  Tai sabaki is finding that first condition to test that will isolate the problem or at least the most pressing part of the problem so that you can start identifying a solution to apply.  Kuzushi is running your test and seeing it fail, to demonstrate clearly that something is broken or out of whack.  Zanshin is going back over the code once your test passes, being mindful of other problems that may arise in the future because of the quick solution you just wrote and refactoring the code until the threat of bad code is mitigated or eliminated.

If you're still not seeing the parallels, I suggest you try finding a dojo and joining a class.  Most dojos will let you try out a class or two for free.  It's actually quite enjoyable since people who practice Aikido seldom really get hurt. And it's a great workout.  Actually, you can say the same thing about test-first development, too.
Post a Comment