Maintenance Programming’s Da Bomb

I was in a situation this week, where I have been fixing bugs in one particular part of our system for total of two weeks. This situation was created by too many reasons to really list (or perhaps warrants its own separate entry) and is a relatively unusual circumstance for our project since a maximum of two days is all we tend to need for each iteration. Being immersed in ‘maintenance mode’ for so long has really highlighted the different set of skills you tend to draw upon in contrast to our normal operating mode. It has also brought to my attention a few issues that can really help or hinder you when working in this mode. Here’s a few of them:

  • Good logging statements (being careful not to damage the readability of code) that detail the complex state of a system in a readable is definitely helpful as you don’t need to add them yourself or to your debugger.
  • Fast unit tests help to give early feedback when making changes to the system and a change breaks its contract with other components.
  • Fast integration tests gives you the confidence that your system will continue to operate as it has in your production environment.
  • Identifying a bug in business requirements before code is written is definitely cheaper than fixing it later on.
  • Poor exception handling can mask the original source of error. For example, on a previous project, I remember the overly complex exception handling architecture triggered a NullPointerException when handling a simple business exception.
  • Code smells tend to become even more offensive as you wade through its source, which at least helps to identify areas that are good candidates for heavy refactoring or redesign).
  • Repeatable test scenarios for a reported bug which are then translated into code are important against protecting against regressions.
  • Though I agree with the whole philosophy of self-documenting code, I still find comments are important. I find the best ones tend to explain why a block of code was written in a particular way instead of another or the potential side effects changing that may have.

Robust Java by Stephen Stelting

I came across this book when I was trying to compose my next Amazon shipment of books. It caught my eye because I have not read much literature or talked to many people about exception handling best practices. It is certainly a topic that was never taught at University in great depth and something I find tends to be neglected in the workplace.

My initial impressions of the book after reading the foreward and first few chapters is that it is a very well written and a well published book. The author sets the expectations of his readers early with what he is trying to achieve and manages to accomplish his goals in the rest of the book. The format is well laid out and the excellent quality of the editoral work is evident by the ease of reading attained without the interruptions typically caused by poor spell checking or grammatical errors.

Read more “Robust Java by Stephen Stelting”

Otanjobi Omedeto (Happy Birthday) Yoshinkan Brisbane

Yoshinkan Brisbane LogoYesterday marked the 6th birthday of the Brisbane Yoshinkan Aikido Dojo. I attended the once-a-year self-defence lesson and continued to watch an excellent demonstration by our Sensei and the black belts held exclusively for dojo members. It’s only my second month of learning my first martial art, but it was an excellent opportunity to learn more about it as Sensei Mori discussed the theory and practical basis for the things we learn in class all the time.

Of course, it was made even more exciting as we witnessed his amazing skills actually applied in all types of scenarios, one which included dealing with five attackers at the one time and without him even breaking a sweat! The Yoshinkan Brisbane dojo was highly recommended to me, and now after having attended it, I can also highly recommend it for anyone else. The members are extremely friendly and unlike many other dojos in Brisbane is not centred about recruiting new members and making money, but is there to genuinely teach and help improve everyone’s skills in Aikido.

Another Saturday Night Catch Up

Last night we had Mike and Marie (Juicy B) around for dinner. It was originally scheduled for some time in early December, but since it clashes with Al and Suz’s St Andrew’s night celebrations, it ended up being last night instead. I hadn’t the opportunity to catch up with them since the dinner at Gunshop Cafe with Sandy so it was great to have the chance to catch up. The night ended relatively early as we all were pretty tired from the hectic week, but not before much laughing ensued about so many different topics (Marie, the answer to the hypothetical question remains as nay!)

Read more “Another Saturday Night Catch Up”

Adventures In Pair Programming

Pair programming is one of the many Extreme Programming practices that I haven’t been able to use that much on my current project. We have a substitute dubbed ‘pairing’ which attempts to reap the benefits of this practice without incurring its perceived overheads. Part of ‘pairing’ allows us to pair program in certain circumstances (other factors prevent us from doing it actively all the time) and I recently had my first experience (or should that be an epiphany?) to reflect upon.

My first observation during this process was that I found the quality of code I wrote, and even my focus of what I was writing, increased tremendously. I also found myself absorbing more history and appreciation for the code I was adding to, instead of simply getting my tests to pass.

After enjoying my first taste of pair programming, I can conclude that to be really effective at it will definitely take a lot of practice. For example, one of my pair partners commented that I tended to unconsciously ‘huff’ while he was typing (probably because I can type much faster than him or was it because I found myself the victim of the Dominant Pair Syndrome?). Appreciating the feedback (of which I find myself so undersubscribed these days) I started to scour the net trying to look for some resources that described better pair programming etiquette. C2 Wiki has a good collection of resources such as ‘How To Piss Off Your Pair’, Pair Programming Questions, and Pair Programming Doubts. I’ve now added Pair Programming Illuminated to my wish list and am eagerly waiting for a copy of Peer Reviews In Software: A Practical Guide in my next Amazon shipment.

When a Unit Test is not a Unit Test

The term ‘unit test’ was being thrown about today at work but so many things about its context were just plain wrong. Just because our testing framework is called xUnit and each method happens to be called testX doesn�t make it a unit test. People have spent (far too much) time attempting to classify all types of tests coming up with categories like functional, acceptance, integration, or unit-integration tests. In my humble opinion, I tend to think of all tests falling along a spectrum, with unit tests (those that test just enough) on one end and the functional/acceptance tests (those that test too much) on the other.

Each test along this spectrum is important but the speed and quality of these tests will be one of the factors that determine how fast you can change or add to your code base. By all means, slower, bigger tests further along in the spectrum can be substituted for faster, lighter unit tests, but its consequences usually lead to a project that is less agile and more waterfall-driven.

Here are a few signs that your tests may be masquerading as something more than just (better, and faster) unit tests:

  • Your application must be �deployed� to run some of your tests;
  • A user must interpret console output or some other type of result for the test to fail;
  • Each test takes too much time to run (it should be possible to many of these within a second);
  • Excessive amounts of set up are required for each test (a smell that this might be integration test and/or testing too much); and
  • Tests cannot be run without some external resource (such as a database, specific computer or some file);

Trance With Matt Darey

Matt DareyJust got back from another big DJ act courtesy of The Family. Matt Darey, has been one of the biggest influences to the Trance scene and deservedly so. He has remixed or produced with all of the biggest DJs (including Tiesto, Oakenfold, Sasha, Pete Tong, Ferry Corsten just to name a few) and has produced many hits including Delerium’s Heaven’s Earth (Matt Darey Remix), Liberation and Beautiful.

Yet another brilliant set (and only for just Family’s standard cover charge!) that went far too quickly. Perhaps it’s a Friday thing, but I’m completely exhausted.