<
a meandering series of thoughts about everything and nothing
The Two Ends 
Sunday, January 11, 2004
“In life, you’re given two ends—one to think with, the other to sit on. Your success in life depends on which end you use the most. Heads you win, tails you lose.”
- U.S. Senator Conrad Burns

Test Driven Development: It's not about testing! 
Friday, January 09, 2004
I just read Dan North's November 2003 Java Developer's Journal article (subscription required) on this subject. His article did a great job of clearly condensing all the different things I've read and lectures I've heard on the subject.

Think of the following interview question: What is the point of test driven development?
Well, Dan points out that it has nothing to do with testing. His answer to the question is "Its about seeing how little you actually need to do and how cleanly you can do it!"

The test serves as a machine that simulates the customer's acceptance of your solution. So the idea is to write a test first that checks to see if a requirement is met. You'll be writing this test code as though the program we're testing was already written. Obviously it won't even compile because it doesn't exist yet, so your next step is to write some code that lets the test compile (and nothing more!!!!). Now the code compiles but the test fails because you haven't written any code to pass the test yet. Next you write code that will pass the test in the simplest way possible. You'll likely hardcode a response initially. As you write more and more tests you'll refactor ruthlessly to whip the code into an acceptable shape.

You might ask, "Why go through all this trouble? I'd rather write the code to begin with and skip all this extra nonsense." Sure you can do it that way too, but by testing first you focus on delivering only what's absolutely necessary. Dan North points out that "In the large, this means that the system you develop does exactly what's necessary and no more. This in turn means that it is easy to modify to make it do more things in the future as they are driven out by more tests." In addition, as the collection of tests gets larger and larger, it can serve as a way of validating that we didn't break any existing code with our new mods. That makes us more confident as we develop. And that confidence lets us be bolder in our refactoring which lets to code become better over time. What I've found is that by doing test first development, I've come up with solutions that weren't obvious right off the bat.

So get off your duff and do some test driven development today! Or at least read more about it on the Agile Alliance website.

More about harrassment and spam 
Wednesday, January 07, 2004
Well, a quick, cursory google later and I've got more info. My suspicion was correct. Spam could be viewed as a "hostile" work environment that the company you work for needs to correct. That's too bad, because the company has no recourse against the spammers themselves. All it can do is block the spam, which may also block legitimate email coming in. Here's an interesting article from News.com about the danger that porn spams pose to a company. It turns out that if the company doesn't correct the problem, ie put in filtering, the complaintant can sue for damages. The damages are HUGE. There seems to be a mandatory punitive damage that's about $200k. Ugh. Yet another reason to hate the spammers.

Would you like some spam with that spam 
I need to rant about the scumbags that send spam. Yesterday I got 42 spams from the same dirtbag(s). Yes, 42 in one day. Luckily I use spamcop which does an incredible job of keeping my inbox free of spam while at the same time not killing legitamate email. But still, 42 in one day is beyond me. I'm even getting spam at work now. Unlike my home email account, my work email account gets mostly porn spam. That pisses me off more than anything. The first one I got was had the sender tag labeled as "michelle". I had just sent out an email to my friend Michelle, so I was sort of expecting an email from her. The subject line was fraudulent, something like "How are you?" so I opened it up. It pulled down a full web page (Why Outlook displays stuff in HTML is beyond me and the subject of a whole other rant) with a lovely young lass in what I'll tastefully describe as a "boudoir" photograph. Let me just say that the photo was anything but tasteful. By opening that email I violated company policy on several fronts; Viewing sexually explicit material on company equipment; Storing sexually explicit material on company equipment; and on some level I might have also broken California sexual harrasment laws since I talked about getting the spam with several co-workers.

So to protect me the federal government recently passed a law (CAN Spam which effectively gives spammers the right to spam me (See the spamhaus article: United States set to Legalize Spamming on January 1, 2004) ... wonderful. It also killed the California legislation that actually had some teeth.

So I've been thinking, could I use federal and state sexual harrasement laws to attack the spammers that are sending porn to my work mailbox? I'm being harrassed by unwanted sexual advances so how is this different? Unfortunately, though I haven't looked into it, I'm afraid that my only recourse would be to sue the company I work for, not the scumbag spammers (that's redundant isn't it?) that send me the crap. That's not exactly the kind of relief I'd want.