Thursday, May 25, 2006

 

Early Bird

We have an entry field in our application that allows the user to enter a time of day. By default, it comes up with the current time. We received reports from QA that the entry field often came up with "garbage." After a few days of requestnig additional information, they gave us an example:

  72:6-

Unfortunately, we couldn't reproduce this in our development environment. We examined code, we tested the application extensively, but couldn't get it to show us this behavior. Every time we tried it, we'd get a good-looking time, like this:

  11:35

This remained an open issue for a couple of weeks.

Finally, last night while driving home from work, it hit me. The problem was that the field was not properly handling the case where the hour needed a leading zero. When it was displaying "72:6-", the actual time was "07:26".

Why couldn't we developers reproduce it during our own testing? Because we are never in the office before 10:00!


Comments:
Two seconds... That's how long it took me.

I think it's because I spend waaay too much time thinking/writing military time. In fact, I spend a considerable amount of brain converting from "East Coast" to "Central Time". Apparently the folks at HQ think the rest of the country understands eastern time.

That's why I type the time with timezone (eg: 1434 CDT) and the date as "26 May 2006".
 
I think it would have come to us a lot faster if we hadn't spent a few days trying to figure out why "random garbage" was appearing in the entry field. I'm also a little surprised the QA people didn't realize they were seeing the correct time, just with some extra stuff.

I often write dates as "2000-05-26". I'm surprised at the amount of confusion this creates among non-computer people.
 
The best part about using 2006-05-26 is using it in file names. Here's my file naming system that I use in the office:

[Filing cabinet category]-[date]-[file identifier].[extension]

For example:

TPS-2005-12-12-Cover sheet memo.doc
TPS-2005-12-13-Cover sheet memo.doc
TPS-2005-12-14-Cover sheet memo.doc

It's a poor man's version control. (Of course, svn is free, getting a svn server installed in my office is not a trivial task...)
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?