Quote of the day


I’ve been writing a lot of code for the past 6 months. I have to admit, it is a welcome change from Word documents and PowerPoint presentations. Java, unlike text and graphics has a clearer definition of correct and finished.

From Software Is A Craft by Dan Pritchett

Unit testing debt


I had the pleasure to listen very interesting podcast where Scott Hanselman and Quetzal Bradley discussed unit testing named “Testing after Unit Tests“. To increase the Google Karma of the information discussed I have decided to rehash and sum up few main ideas of this discussion.

Quetzal introduced the idea of “negative coverage” – meaning that if you have 88 % test coverage, you should not see this as something positive you have achieved, but as something missing (you miss 12 % of completion) – thus the title of this post.

He also offered very nice mental model of unit tests: see all possible paths through your code as network of roads in a state. Your unit tests are like taking small car and start driving through these roads. If you go through 88% of the roads, you can at least tell that all these roads and bridges are finished and passable with the small car driving at normal speed, that there are no fallen trees on the road and so on.

You cannot say anything about the remaining 12 % roads and bridges you have not visited. They may not exist at all – or be only half finished. You simply do not know.

It is also important to understand that you do not now how many those 88% tested roads will still be OK when you try to drive through with a 18 wheeler truck – or at 250 km/h in a sports car (feel free to fill in your favorite racing car make …).

The parallel goes even further in matching the “freeways” and side roads with main execution paths vs sideroads (you have to take freeway in order to get to the sideroad) – but to get all, get a podcast, load it to your iPod (or Zune ;-)) to find out more.

I keep listening to Hanselminutes because I like the content and the style and also to keep a tie to Microsoft world during the periods I am working outside of .NET (like in last 10 months). But even if you are not developing in Microsoft environment, many episodes of Hanselminutes very often bring ideas with much wider applicability. This is one of them.


Fix for iDVD 08 crash after the start


Today I tried for the first time the iDVD 08 with intention to create DVD version of the screencast – just to find out that the application dies right after the start. From the error report (thanks for that) the problem was in missing dependency Oxygene framework – a module similar to Windows DLL. Here is the error message:

Link (dyld) error: 

Library not loaded: @executable_path/../Frameworks/Oxygene.framework/Versions/A/Oxygene
Referenced from: /Applications/iDVD.app/Contents/MacOS/iDVD
Reason: image not found 

The solutions described in the Apple discussion groups revolved around using shareware tool Pacifist – something I did not like particularly. The plain reinstallation of the DVD did not help either.

What worked for me and solved the problem was complete removal of iDVD and subsequential reinstall. I used AppZapper to remove the application, but it also can be done manually by deleting the application bundle from /Applications, removing all iDVD receipts from /Library/Receipts and all content from ~/Library/iDVD and ~/Library/Preferences (which is in a nutshell all AppZapper did).

Right after removal, insert Installation disk 1, select Install Bundled Software Only, press Customize and uncheck everything except iDVD. The program starts fine after installation finishes.

One more minor hickup after reinstall was that the Theme introduction would not play in preview – all the application showed was black screen with background music. This was resolved by selecting ‘Check for updates’ and allowing installation of the update. Afterwards, I was able to start working in my first DVD :-).

iMovie 08 and mystery of disappearing Project Library


As if the yesterday’s Firmware update issue was not enough, I had very strange experience with iMovie 08. Suddenly, for no obvious particular reason the user interface became very unresponsive, I was not able to select project in project library. Switching Event library and Project windows on or off stopped working. Windows were not redrawn properly. Creating new project had no visible effect. I could not click on project to select it (well, technically I *could* click, but nothing happened). The time sliders in Events and Projects were either disabled or invisible …

Here is how the iMovie looked like most of the time:

I tried multiple things to fix that: Logout and re-login – no change. Reboot (remember, I came from Windows where this very often used remedy ;-)). No luck. Check and repair the permissions using Disk Utility. No improvement. Verify disk. No errors and still no improvements.

I even resorted to reinstallation of iLife 08. The only effect I achieved was that I got back trial version of Office 2004 which I deleted right after installing Leopard and had to download and install several updates for Garage Band and iWeb – but iMovie still did not work. Installation of iMovie HD (from iLife 06) worked OK as well did the iMovie 06 – but that was not much help because I did not want start from scratch and iMovie 08 with all its bad features is still able to accept way more input formats than ’06.

After killing well over three hours that was supposed to be spent on finishing the screencast, I started to delete all iMovie project files and even libraries from previous attempts. And suddenly, iMovie sprung to life and was as before.

I think that reason for the issues was moving the Events library for some of the older screencasts to external disk, but leaving the Project files in iMovie. Somehow this must have confused the program and the non-responsiveness could be caused by trying to connect the thumbnails and file references from the projects to the not available source clips from event library.

Lesson learned: whenever I move done an event library used in the screencast to external hard disk, it is probably safest to backup and remove the project as well. In other words – keep these two words separated and disjunct.

But of course – this can also be a pure coincidence and everything can have completely different cause. Time will tell. Too bad that Premiere Elements does not exist for Mac platform. Maybe I should seriously consider looking at Final Cut Express ?

Mac firmware update


Today I (finally) found out that Apple pushed the long expected Java update with Java 6 for OS-X. Together with this update was another one – Firmware update. I installed both, but on next login, the same firmware update showed up again and checking the firmware version with System Profiler has shown that it was not updated.

So I installed firmware update again, and rebooted. But nothing happened again.

After some googling, I found out that the Firmware update – unlike all other updates does NOT really install itself. What it does is to download the Firmware update program. After you start this program (you can locate it by Spotlight), it will display instructions and asks for initiating shutdown. When machine reboots, you need to press and hold power button while it boots – until hearing long beep sound or seeing the sleep light rapidly flashing. After this, system shows update progress bar under grey apple and on finishing the update reboots again. Having done this, firmware is finally updated.

From technical point of view it makes lots of sense to perform firmware update this way, but it would be very helpful if Apple would at least TELL the users what they are supposed to do. This was so un-applish user interaction experience like none before …

Catching up with Hanselminutes


Thanks to great weather, the walking season is in full progress 🙂 and that means I was able to add some more listening material to my podcast collection. I still keep track with all part of TWIT network – This week in tech, Security Now!, MacBreak Weekly and Windows Weekly – but that is nowhere close enough for both walking and driving …

I have returned back to listening to Scott Hanselman blog (Hanselminutes) – mostly out of curiosity how did working for Microsoft change is very balanced and realistic view of technologies.

Fortunately – it did not.

Scott is still same great, very open minded developer that can see value and strength as well as issues and problems in technology regardless of its origin. It speaks a lot positives about Microsoft as well – by allowing this to happen.

Very good episodes are (back from 2007) from my personal point of view were:

I was pretty intrigued with the title of the episode “The Worst Show Ever with Chris Sells and Rory Blyth” – which is Episode 112 and I have to agree, the title was pretty descriptive 🙂 – but it was at least reasonably funny.

I am looking forward catching up with rest of the year, which according the Weather Network should not take too long.

Thanks, Scott. Keep up the great content coming.

Cocoa Programming for Mac OS X, Third Edition is out


as long as you are Safari Books online subscriber – see it here.

Completely updated with XCode 3.x and Objective C 2.0. The screenshots even show the iPhone project templates, indicating the XCode 3.1 in some places. So far the only difference against reality I have found is not covering the XIB resource format (which is generated by default) and sticking with NIB. This blog entry has good explanation of the difference.

If you are fan of dead tree-ware books, the official publication date is May 2008, so expect it any day :-).

Strangely enough, as of May 4th, the author’s web (The Big Nerd Ranch) does not really advertise its availability (yet)