" /> kasia in a nutshell: September 2005 Archives

« August 2005 | Main | October 2005 »

September 28, 2005

The most useless unit test ever

This is an actual unit test I ran into today.. I've made minor modifications to the code just to make it appear less like taken straight out of some application (although it is) and perhaps make it more fun to read.. but other than that.. the test is exactly as I found it...

So what's wrong with it? If you have to ask you'll never understand... or at least not before you program for a few more years, go off.. code something.

But it has comments! Yes.. yes it does. A lot of them and every single one utterly useless.

How did I run into this gem? It continuously fails on my daily unit test run, I finally decided to investigate why.. and well, the reason is obvious. It checks for a hardcoded value that was likely deleted long time ago.. as you know, test databases get wiped on regular basis and stuff.

It's obviously not finished! You say.. actually hasn't been touched in ages in an actively developed project.. so I have to assume it is meant to be this way.

Why am I not posting this to daily wtf? I'm not sure it's actually submission worthy.. It's just well.. so.. oh well, that, er, yah.

So what does it actually test? As far as I can tell.. JDBC works like a charm, good job Sun!

September 20, 2005

Sad, sad times

A tragedy of sorts happened at my house today.

I don't subscribe to cable, I absolutely refuse to pay the high programming fees, box rental (apparently you can no longer subscribe to analog cable in my area) and assorted other charges to the tune of $70 a month, just so I can watch an average of 2 hours of tv a week. That's four half-hour long Daily Show viewings a week for those keeping track. See, I have a cable modem. Add one of those to a non-cable-subscriber and you'll end up with a badly-designed filter on the cable line that lets through some higher-number channels.. among which (until very very recently) was Comedy Central for my daily Jon Stewart fix.

Comcast has decided to re-number channels.. not only did I lose Comedy Central, I gained Fox news.

gah, shoot me now.


PS: anyone know a good torrent site for Daily Show downloads?

September 07, 2005

JIRA, I think I love you

A few months ago, I posted an entry asking about bug tracking tools. A few people recommended JIRA and after evalutation, showing it off to our team and a happy gleam at the price tag we purchased an enterprise license and have been using it ever since. It's really a great tool and likely the best bug tracking one I've ever used.

Months went by.. project has grown and today was the day to move our bug tracking to a newer, faster non-ppc based server. Since JIRA is Java-based, the move is really nothing more than tar and un-tar.. what could be easier? We're just hopping linux boxes here!

As with any project, a test run is required, so of course about a week ago (September 1st to be exact) a tar of JIRA was created, un-tar'ed on the new server and tested to make sure all runs.. And it did! Like a charm.. piece of cake.

Today.. the moving day. All I had to do was create a fresh, new tar and un-tar it (yet again) on the new server.. what could be easier!

tar -xzvf jira.tgz jira-directory

Yah.. I typed "x" instead of "c" and of course.. there was already the previously tar'ed file (from September 1st) there and since I was pulled into a meeting as soon as I hit "enter" I didn't even notice this.. that is.. until I brought up JIRA on the new server and saw all the missing data.

Ahh!! Blew away a week's worth of work! What's worse.. not even my own work but that of other people!

This is where the love of JIRA comes in.. the default configuration backs up its data every 12 hours into xml files.. and since the file has the date in the name, the new backup files were not over-written when un-tar'ing the old files over the location..

Thank you.. oh blessed JIRA developers you saved my back-up-deficient ass!
(Yah, we'll be backing up the new server regularly).