Saturday, September 30, 2006

How much is too much unit testing?

I'm a big believer in unit tests. In my current project we have over 400 unit tests. We even sneak some integration tests into our nunit code. Many of our tests read data from an xml file containing a few objects distilled into xml. The tests rehydrate the objects, invoke a method in our application and pass in those objects. The application returns a string or xml object and we check inside the xml data file to see if it is correct. It's quite tidy.
But with some many tests adding a new feature can be work. Recently while adding a new feature I implemented it in such a way as to have a minimal impact on our test files. Bad, very bad. Should I change 150 xml files, adding in new parameters, or implement the new feature in a way that doesn't change the test files?
I chickened out and did the wrong thing. In the end, like most "shortcuts" it took more time. I went back and wrote a little ruby program to go through the 150 xml files and programatically add new xml attributes with their varying values (name of the file plus occurance in the file, eg, attr="Test5.xml:3").

I learned a few things from the experience:
1. Always do the right thing, even if it takes longer and you are really pressed for time.
2. Unit tests are great and wonderful, but they come with a price. You can have too many tests which can slow you down.

Does my project have too many unit tests? I don't think so, but I'm less sure of that than I use to be. My project partner thinks we have too many, but I still think the tests ensure quality, but the tests come with a higher price than I realized.

Wednesday, September 27, 2006

Last Night's Java User's Group Meeting

About 45 people attended the meeting focused on rapid development with open source tools.
Jean George from OpenSky extolled the virtues of XMLC for software development. Open Sky developed a stack of software components to create software including Spring, ireports, Jasper for reporting and Acegi for security.
Jean said to do any modern work you have to master HTML, CSS, and JavaScript.
He also liked Postgres much better than MySQL. But his best line was about PHP programmers, "You can't get rid of them, they're like fireants, you keep stomping on them and they keep coming."
One thing that did strike me about the direction of software development: our systems are more declarative and use convention over configuration. With that in mind it matters less whether the glue holding the frameworks together is Java or C#.

Tuesday, September 26, 2006

New Windows Unpatched Exploit

Microsoft plans to fix a buffer overflow in its Vector Markup Language (VML) dll on October 10th. In the meantime your IE browser and some email readers are vunerable to attack. To fix the problem run this command on your machine and reboot:

regsvr32 -u "%ProgramFiles%\Common Files\Microsoft Shared\VGX\vgx.dll"

This unregisters the VML renderer, which is sparsely used today. To reregister the dll after October 10th,

regsvr32 "%ProgramFiles%\Common Files\Microsoft Shared\VGX\vgx.dll"

Don't take my word for it though, read Microsoft's note here.

Wednesday, September 20, 2006

Apache Redirects For URLs with spaces

I had an external web site link to one of my pages, but a space was accidentally appended to the link, eg.,
"<a href="">Pennies</a>".

My error.log file was filling up with 404 errors. The easy solution was to do an apache redirect, but it was a little tricky because of the space. I tried putting in the "%20" at the end, but apache liked simple double quotes to define the trailing space. The line in the .htaccess looked like this:

Redirect "/Misc/Pennies/ "

Friday, September 15, 2006

Vista could create 50,000 EU jobs

A Microsoft funded study has concluded that Vista will create 50,000 jobs in Europe.
O Pelease!
This is just spin to help with Microsoft's ongoin legal troubles in Europe.
Besides, new jobs are not necessarily a good thing. A toxic waste spill in Europe could create 50,000 new well paying jobs in Europe. We could hire 50,000 painters in Europe to paint all the houses yellow, but after all the money is spent, will we be better off?

The real economic issue is whether Vista will improve the *productivity* of Europe.
Vast amounts of money will be spent training and finding new bugs, but really are we more productive? I doubt it. I've yet to see any features to really make us more productive with the exception of WinFS. Oh, I forgot. WinFS is not in Vista is it?

Besides, I still don't get what Microsoft gains by producing Vista. Most people just buy the OS on a new computer. Microsoft won't gain any new sales. Why didn't Microsoft just save all those billions and billions of dollars. They could have just improved XP for a few million. Microsoft might even lose money since Vista requires more expensive hardware leading to fewer machine sales and fewer OS sales.

Wednesday, September 13, 2006

Twilight of Patterns / "Day Coder"

Patterns were all the rage a decade ago and we all learned patterns like Visitor, Factory, and Abstract Factory patterns. Some patterns like Visitor are rendered trivial with higher level languages like Lisp. I wrote a mapcar function this morning in elisp and it finally dawned on me that patterns really are just kludges stuck into a language. I understand better what people have been saying, "Patterns are really weaknesses in a language."
Hopefully as languages like Java and C# become higher level we will have less patterns to learn - or we can switch to Ruby, Lisp, or Smalltalk - and perhaps no patterns in Ruby++.

I did learn a good buzzword today: "Day coder", a programmer with no real passion for the profession, they just work for the money.

Monday, September 04, 2006

Digital Video Recorders Compared

In our humble home we have three different types of Digital Video Recorders (DVRs).
Below are some random comments on the tradeoffs with each:

Windows Media Center: Good user interface for selecting programs. Schedule information is free and the software is reliable. The software to burn a show to DVD is decent software, although clunky on the Sony using Click2DVD.
Fastforward is totally useless. I try to skip commercials, but once past them the WMC player doesn't stop for minutes, so I have to rewind, but have the same problem of overshooting on the other end. I don't use FF or RW anymore, although the pause/start button works superbly. Using WMC for watching TV concurrently with doing any actual work on the computer is frustratingly awkward due to cpu cycles being shared. Score: 2/5.

TimeWarner/Scientific Atlanta cable box: Good user interface for watching TV. I was immediately able to change channels. Watching the current channel in the corner is userful as I search for more fodder. That being said, the interface is horrible in every other respect. I could not learn how to record a series given a title. Selecting a known title to record in the future is incredibly tedious. I was looking for "Driving Through History", but the interface only offered to jump me to the "D"s. Do you know how many digital tv shows in the next two weeks start with "D". Lots.
I had to read the manual to program the remote to control the tv, took about 20 minutes (half a dozen codes were listed for my brand of tv)
If you ever wondered what an assmebly langauge programmer from the 1960's would produce for a user interface for watching tv, look no farther. The TimeWarner cable DVR is awful. Score: 1/5.

TiVo: Tivo is sweetness and light. From the first time I turned it on, TiVo has worked flawlessly. I was able to select my TV brand from an online list. Recording shows and series is effortless. The GUI just works like you think it should.
I love the "TiVo Recommends" section. I love being able to control TiVo recordings from anywhere in the world via the internet. I don't love the monthly fee, but I'd rather pay them than use the much cheaper TimeWarner box. Score: 5/5.

Freedom is ...

A popular bumper sticker here is "Freedom is the distance between Church and State.", but it doesn't attribute the phrase to anyone. I just forgot if it was Stalin, Mao, or Pol Pot?

Saturday, September 02, 2006

New StarTrek Makeover / CGI

Reports are that the ooolllddd Star Trek series is getting a makeover with enhansed CGI effects. Apparently the cheesy background will get a digital makeover along with all the spaceshots. What StarTrek *really* needs is not CGI, but CGA. CGA is this new technology using the latest in AI technology and graphics cards. CGA stands for Computer Generated Acting. It takes old video and actually injects real emotions into the actors ("He's dead Jim") to make the shows watchable.

Check out the trailer (sans CGA):