Of Butterflies and Bugs
At a fundamental level, the computer is a deterministic machine based entirely on pure logic – the machine does exactly what is asked of it by the software, no more, no less. In contrast, the human world consists of chaos. It is the software developer who must model the real world in the computer, an often difficult task.
Who among us has not been frustrated by a program that crashes and loses our work, is buggy and slow? Problems can occur on many levels throughout the complex process that is software development. In this series of articles I give a developer’s-eye-view of the sources of these everyday problems. This article introduces the gaps between the development environment and the end user’s environment; and between student experience and expectations on the professional developer.
There are two types of software: the application software you get on CD that you install on your computer (Microsoft Office), and the web applications you access through your web browser (e.g. Gmail, Facebook). The two types of software might seem quite similar at first – both run on your computer and operate in a similar manner – but from a software development perspective, they are different in a number of ways.
In application software, there are numerous ways for problems to occur, many of them outside the developer’s control:
• The environment that software is run in is a wildly diverse one; people use a massive variety of hardware and software configurations. Even if one application is well written, it can often be affected by other, badly written software. This is one of the reasons why Apple sells the Mac OS (Operating System) to only run on Apple hardware – since they control both the operating system and the hardware, they only have to make the OS work on one hardware platform, and develop the OS to be fully and perfectly compatible with that hardware (in theory at least).
• A program may have to support many operating systems (Windows, Mac OS X) and OS versions (Windows 2000, Windows XP, Windows Vista, OS X 10.3, 10.4, 10.5). Unless the software company devotes a lot of resources to testing the software on multiple OS versions, the program may receive little or no testing at all on anything but the most common OS and OS version (most probably Windows XP at this point in time). This compromises the detection of bugs including the potential consequences of changes in the operating system across versions.
The issues that web applications face, though fewer in number, can feel like solving riddles without all the clues. The primary issue web application developers face is that the developer has to support both new and older web browsers, such as Microsoft Internet Explorer 6. These older browsers, while impressive at their time of release and widely used, appear quite dated next to the current generation of browsers – including Mozilla Firefox, Apple’s Safari, and Opera. The older browsers have numerous bugs that have to be worked around; and because some of these bugs are still not widely known, it can take hours of frustration to fix them.
The act of programming in and of itself is fraught with problems that would seem ridiculous to an outsider; a simple example is that in nearly all programming languages, a simple typing error – such as writing a colon instead of a semicolon – will either stop your program from working entirely, or worse, your program will still work, but will only fail when a particular aspect of the application is tested – something that may take some time to discover.
The difficulty in programming is made even more challenging because the university education a software developer will receive can be lacking. According to Joel Spolsky, a noted technology blogger and author, many universities are ‘dumbing down’ their courses to increase the pass rate of students; thus the students receive insufficient levels of training. This carries through into the workplace, in that programmers who have graduated from these courses are put to work on complex systems for which their training is inadequate. This is through no real fault of their own, having completed their university course successfully. The fact remains, however, that they are working on things which they do not fully understand. In this environment, there is a high likelihood of introducing subtle bugs (in concurrent programming, for example) that may not show in development but only after the software is used by the masses.
The workplace itself can burden software development. Many organizations put programmers to work on old, patched-up systems with little or no documentation. Documentation is the description of how the program should behave and the details of any deviations from the norm in how it is implemented. One of my first jobs involved documenting code written by a previous employee prior to extending that software with code of my own. Soon after, the IT department was given instructions to stop writing documentation into code to speed things up. Despite not enjoying the task of documentation, I argued successfully against the removal of this step from the development process because I could see the longer term issues that would arise in an environment where staff turnover was on the rise.
Organisatons often place no emphasis on proper development and testing procedure, making the coder’s task all the more difficult. Programming is often rushed by management, most especially towards the release of an application. Programming is usually the last stage in a project, so delays in previous steps of a project can cause the time left for programming to be compressed. This adds stress to the people programming the application, increasing the likelihood of bugs.
Software applications and web applications are increasingly complex – the largest with millions of lines of code. This means that a developer can only be expert on a small part of the project. If the software is not designed well, this means that a developer might change something in one part of the application, and it can break other parts of the application.
All in all, programmers are set up for failure in numerous ways. In this context, it seems amazing that they can produce software that works the majority of the time. So the next time you get crash or a bug, spare a thought for the complexities of the process and observe the wonder of human endeavour that attempts to span the infinite diversity of humanity with an infrastructure built of zeroes and ones.
03:57 PM on Saturday, 22/08/2009

