Archive for March, 2007

Eyeing Guice

Sunday, March 25th, 2007

I’m doing a cram course in Java dependency injection (DI) frameworks, and am coming away tentatively impressed with Guice, a new framework by two guys at Google who I know to be highly competent, and, more importantly, tasteful Java developers. They’ve spent time grappling with bloat, and it shows in their design. Guice is a lot lighter weight than DI in Spring, and makes good use of Java5 annotations. The caveat with Guice is that it’s still early days, and the (limited) documentation has some gaps that require educated guesses (and dives into the Guice Javadoc) to fill in.

Planning Poker

Wednesday, March 21st, 2007

Mike Cohn, came to BayXP last night to talk with us about Agile Planning and Estimating, and I scored a set of his “Planning Poker” cards.

Planning Poker turns the Wideband Delphi estimating technique into a card game. I’ve used Delphi on past projects to flush out assumptions and to get rough-cut estimates, but it was never as much fun. Mike has an on-line version of the game at planningpoker.com. And, in true web 2.0 style, it’s a Rails app.

If the chance to hear Mike speak comes within reach, grab it. He’s full of the engaging, friendly wit that you need to arm yourself with for discussions with upper management about planning and tracking, and his presentations have awesome footnotes.

Upgrades, oh my

Saturday, March 17th, 2007

That tiny little ka-chunk sound was a software upgrade. Step two along the path to getting the blog cleaned up.

My GTD Nightmare

Monday, March 12th, 2007

My version of the Getting Things Done nightmare goes like this: I’ve just completed a weekly mind sweep, getting lots of messy stuff converted to Next Actions on 3×5 cards—stuff so messy that I can’t keep it straight in my head. I’m gathering the cards up to leave for some important appointment when I notice that one of the cards—the Agendas card—is missing. Without it, I have no idea who I’m supposed to talk to, or about what. And there’s urgent stuff that needs doing! I’m fanning through the cards in a growing panic when I notice another card has gone missing. But before I can figure out which card it is, the alarm goes off.

At least it’s not that “trying desparately to find the final exam for the class I never bothered to go to or even buy the textbook for” nightmare, or its “oops, I found the exam, but seem to have forgotten to put on pants” variation.

Almost-complete tests

Tuesday, March 6th, 2007

Having unit tests can sometimes lead to a false sense of security, particularly when you appear to have 100% code coverage but are actually still missing a test.

I ran into an instance of one problem pattern a few days ago. From the test side, it looked something like this:

public void testEncryptIsReversable() {
  String s = "some string";
  String e = encrypt(s);
  assertEquals("decrypt should reverse encrypt", s, decrypt(e));
}

See the problem? It’s easy to miss. I almost read right past it when encountering it in a larger, more complicated test.

Here’s the improved test:

public void testEncryptIsReversable() {
  String s = "some string";
  String e = encrypt(s);
  assertNotEquals("encrypt should have some effect", e, s);
  assertEquals("decrypt should reverse encrypt", s, decrypt(e));
}

This might seem silly. Of course encrypt is going to return different bits, especially when you’re using a well-tested library. But if you step back and look at this as an example of using transformation code that someone else on a project is providing, (as was the case in the code I was looking at), does it not make sense to add a tiny bit of protection against their accidentally checking in a stub implementation? Say, right before they have to run off to a meeting, and then forget correct their mistake?

It’s surprising how long little lapses can go undetected in a large project, especially when we have that false confidence that comes from almost complete tests.

Breakage ahead…

Sunday, March 4th, 2007

… and breakage behind. I’ve been told that my RSS feeds is “hosed” for Google Reader users. (Thanks, Paul.) That bumps up the priority of upgrading WordPress. A theme/plugin upgrade will happen sometime thereafter, once I’ve sorted through comment spam options.

In the meantime, check out Y Combinator: Startup News.