Entries from June 1, 2006 - June 30, 2006

Friday
Jun302006

Poor Abstractions as a cause of Software Failures

From Software Abstractions - Logic, Language and Analysis by Daniel Jackson (MIT Press, 2006):

The case for formal methods is often based on the prospect of catching subtle bugs that elude testing.  But in practice the less glamorous analyses that are applied repeatedly during the development of an abstraction and which keep the formal model in line with the designer's intent, are far more important.  Software, unlike hardware, rarely fails because of a single tiny but debilitating flaw.  In almost all cases, software fails because of poor abstractions that lead to a proliferation of bugs, one of which happens to cause the failure.

Saturday
Jun242006

Design by Guesswork

Over at Aftermarket Pipes Tim Lesher has a nice explanation of some strange behaviour of  Windows Notepad.  However, I disagree with him when he says "we can't even blame Notepad: it's a limitation of Windows itself".  The documentation for the IsTextUnicode Windows API call is quite explicit that the call makes an informed guess and might give a wrong answer.  The mistake made by the designers of Notepad was to hide from the user the fact that a guess was being made.  Lesher approvingly quotes Tim Peters'  "In the face of ambiguity, refuse the temptation to guess", to which I would add "but if you have to then don't hide the fact from the user".

This all reminds me of the following story reported by Edsger Dijkstra in EWD 466(pdf) :

...  Niklaus [Wirth] told a terrible story about CDC software.  With 10 six-bit characters (from an alphabet of 63) packed into one word, CDC used the 64th configuration to indicate "end of line"; when for compatibility reasons a 64th character had to be added, they invented the following convention for indicating the end of a line: two successive colons on positions 10k+8 and 10k+9 --a fixed position in the word!-- is interpreted as "end of line".  The argument was clearly that colons hardly ever occur, let alone two successive ones!  Tony [Hoare] was severely shocked: "How can one build reliable programs on top of a system with consciously built-in unreliability?"  I shared his horror; he suggested that at the next International Conference on Software Reliability a speaker should just mention the above dirty trick and then let the audience think about its consequences for the rest of his time slice! ... 

Saturday
Jun102006

Reading University Panorama

whiteknights-house-tiny.jpg
This afternoon (during the England - Paraguay football match) I went up the university grounds and took 17 images of the above panorama using a tripod.  I used the built-in spirit-levels to level the tripod but, even then, I had to correct the final image for a 1-degree tilt.  I made all the images overlap their neighbours by about 30% which allowed me to avoid  mismatches due to distortions near the edges of images.  Also, I took the light readings for each of the images off the same part of the house in the centre.  I used GIMP 2 to edit and combine the images.  I was so pleased with the result that I uploaded it to my Flickr site, however I was disappointed to discover that, because I have only a free account, the image was reduced to 1024x138 pixels. So I have put a copy of the full-sized image here.

Saturday
Jun102006

A DNS Problem and its Solution

On Wednesday afternoon Zoe and I got home to find that our connection to the web had stopped working. When we tried to go to a web-site such as www.google.com the browser would just sit there waiting for a minute or so before giving up. We couldn't think of anything we had done since the previous evening that could have caused the problem.

We have two computers that connect to the internet through a Zoom ADSL X5 modem router. The problem was common to both computers so the problem was either with the modem or with our broadband supplier. I opened up a MS-DOS window in Windows XP and tried to ping Google:

  ping www.google.com

Google replied. Then I pinged Google from a terminal window in Linux, with the same result. So, the underlying internet connection was working. The problem must therefore be with the DNS name lookup (the mechanism which converts URL's such as "www.google.com" into the 4-number network addresses such as "245.10.45.97"). I dug out the printout I kept of my broadband supplier's connection instructions (you should always have a copy of these, either as a printout or as a file on your PC because when something goes wrong you won't be able to get to their web-site!). What I needed were the addresses of primary and secondary domain name servers (DNS) which were 195.74.102.146 and 195.74.102.147. The Zoom ADSL modem router is configured using a web-browser interface.  I started Firefox, entered http://10.0.02 as the URL and pressed 'Go'.  I then logged into the modem router with the username and password which I have noted down from when I installed it.  Then I went to the DNS Setup page (its under Advanced Setup).  The existing DNS setup was 'Use Auto Discovered DNS servers only'.  I changed this to 'Auto Discovery + User Configured' and entered 195.74.102.146 and 195.74.102.147 as the Preferred and Alternative DNS servers.  I then saved the changes and wrote then to Flash.  The modem rebooted and then we could get through to Google (and the rest of the Web) again. 

I still don't know what caused the DNS lookup to fail when it did, but I don't care because I have got it working again and Zoe thinks I am a hero!

Saturday
Jun102006

Ubuntu 6.06 (LTS) Upgrade

Last night I upgraded the operating system on my IBM Thinkpad R50e lap-top from Unbuntu 5.10 to Ubuntu 6.06 LTS (Long Term Support). 

The whole process took less than an hour and was completely automatic except for one point where it asked me if I wanted it to delete some packages that were no longer maintained (I said yes as I didn't notice anything in the list that I used).  There was only one minor problem (well, more of an annoyance) in that an icon I had set up for a shortcut to Idle (the Python IDE) must have got deleted which resulted in lots of "Can't find icon" error boxes.  However, this was simply fixed by deleting the shortcut (I will set up a new one when I use Idle again). 

The only differences that I have noticed after the upgrade are that the login screen is more glossy and Firefox is now at version 1.5.0.4 instead of 1.4.2.  On the whole, I am very impressed with Ubuntu.