Loony Tunes: Bugs blare in software set to music

Imagine a band playing “Here Comes the Bride” in the middle of a funeral dirge. It would be jarring, to say the least.

Now, British researchers are exploiting the attention-getting effect of musical flubs to highlight errors, or bugs, in computer programs. In a test of a new software-to-music scheme, student programmers found bugs more easily when they listened to melodies representing computer programs than when they used only conventional debugging techniques.

Software bugs cost some $60 billion annually in the United States alone (SN: 7/20/02, p. 45: Software bugs cost big bucks). One way to reduce that impact is to convert computer programs into music, propose James L. Alty of Loughborough University in Leicestershire and Paul Vickers of Northumbria University in Newcastle-upon-Tyne.

“We took a deliberate, structured musical approach,” Vickers says. The goal was to convert software into familiar musical forms, such as classical or rock, that listeners would find easy to recognize and follow.

That’s in contrast to previous attempts at software-to-music conversion in which researchers arbitrarily assigned musical notes to program instructions, he says. Those approaches resulted in unfamiliar, atonal forms of music.

In their work, Vickers and Alty composed brief melodies representing various commands in the Pascal programming language, though the technique could be applied to other languages, too. For the test, the British team translated only instructions that involve making a decision about which path the program will take.

To indicate the outcomes of decision commands, Alty and Vickers relied on standard features of conventional music. For instance, to represent two different processing paths, the researchers offered similar melodies in a major key for one path and in a minor key for the other. Samples can be heard online at http://computing.unn.ac.uk/staff/cgpv1/caitlin/phd1.htm.

To a programmer familiar with these motifs, a program becomes a musical score, Vickers explains. The programmer then detects bugs by noticing when the performance doesn’t follow the expected musical flow.

“I consider it a good step forward for that general application,” comments Gregory Kramer of Portland, Ore., a pioneer and consultant in converting nonauditory information into sound.

However, Eric Somers of Dutchess Community College in Poughkeepsie, N.Y., questions how well the scheme would work for debugging even medium-size programs with thousands of lines of code. Vickers agrees it would be tedious. However, he expects programmers to use other techniques first to narrow the bug search to certain stretches of code.

In their test, Alty and Vickers gave eight programs to a group of computer science undergraduates and asked them to search for bugs, half the time with music and half the time without. With the musical assistance, students found about 20 percent more of the programs’ bugs than they did using only conventional techniques. The researchers report their results in the December Interacting with Computers.

****************

If you have a comment on this article that you would like considered for publication in Science News, please send it to editors@sciencenews.org.


More Stories from Science News on Computing

From the Nature Index

Paid Content