Yes, this is something that every programmer should know, but sometimes…we forget. But always, always, always test your applications before releasing them into the wild. Preferably under multiple accounts.
I'm in the process of putting the finishing touches on a new application–I'll have more details to post soon–and my wife suggested that I put together a series of screenshots to show people what it's capable of. This made sense to me, and I wanted to do shots from the start onwards, so I created a new user, giving me a clean slate to work from. Supposedly.
Of course, it wasn't that easy (or else I wouldn't be posting about it here, now would I?). One of the first things I noticed was that certain calculated numbers were decidedly…off. A little digging around, and I found that I had some analytic functions that weren't partitioning properly; the application was adding data for my original user to my fresh one, resulting in rather screwy numbers. And it turns out (I'm ashamed to admit this, but…) I had a hard-coded value that only worked for my test account. Oops.
Luckily, I was taking the time to document the tool carefully, so I was able to notice these oddities before releasing the application. So, here's my pledge: I will always test every part of my applications with at least two accounts. And
when if I fail, I'll blog about it here…so that the embarrassment will help me remember in the future.