Sun, May 11, 2003 Test Driven Development
Spent the whole day saturday trying my hand out at test driven development to get a feel of how easy/hard is the whole thing. I keep hearing varied opinions that I had to find out for myself what is the effort involved. I started out to write a partially non-greedy string searching algorithm that would help me match patterns to search and replace on source files. Here is what I found
- The initial time taken is high - I would suspect the real cause of this is that - its been a while since I had actually written anything non-trivial in Java plus I had to learn JUnit API, setup the environments etc., I would assume that this is not an issue for a competent developer. Took me nearly 3 hours to write the test cases and code for basic string searching.
- The benefits I got by being able to revisit my code so many times to "clean" it up (as I learnt new classes in Java API) while making sure that every combination was still working was worth the trouble. What the test cases gave me is what poets would call as "artistic license" the leeway to keep tweaking the work but still deliver acceptable goods at the end - a luxury that I didnt have in a while.
I actually read a paper about this somewhere I forgot the source. The paper claimed that we are actually writing "legacy" code nowadays as we build an application - basically the article went about defining "legacy" as anything that developers would not touch with a stick simply because they are afraid of breaking something somewhere. What a good suite of automated test cases give us is the ability to keep refactoring code all the time since we have the safety net of test cases to verify the functionality continuously. Today I think I agree with the author. I am liking this TDD paradigm.
Friends came over saturday evening. Went to the beach and found a delightful juice shop on Besant nagar beach near the temple (next to the bus stand) called "Fruit shop on Greams road". Greams road ?? Besant Nagar? I didnt bother to ask. They did serve extermely good and fresh fruit juices with zero additives - a rarity. A bit expensive but real nice in the summer.
I badly need a spam filter. My mail account signal to noise ratio has degraded so badly that today I received 20+ email - all spam and one from my brother in law. I am getting sick of viagra and free porn mails!
I searched the web and found an open source Win32 version called Spamihilator distributed on GNU GPL. Seems quite slick and complete. I have set it up. Now I have to see what it catches.
Sat, May 10, 2003 Open Source
The poster is now behaving strangely when it works across different timezones. Interesting problem this. When I query advogato for the last posted date, it responds with a date/time information. This is converted by the apache XMLRPC client for java into a Date Object. This date object for some strange reason has my local timezone embedded in it instead of the timezone of the server. Since I live in a timezone that is about 12 hours ahead of Advogato, strange things happen when I use this date to decide on what local files should be posted to advogato. Anybody has any ideas on this? Please drop me a note - vivekv at magic hypen cauldron dot com.
I am hosting the software on my site. Please look at the link called Advogato Poster under the software section. Except for the one bug mentioned above, I think the software works fine.
Spending a relaxed weekend at home. Too hot to attempt to go anywhere. My siste-in-law and family will come over tomorrow. Planning to go to the beach to cool off in the evening.