Debugging reinvented: Asking and answering why and why-not questions about program behavior – Ko and Myers 2008
Today’s choice is another great example of the value of constantly challenging the status quo and asking if there might be a better way.
In more than half a century of research on debuggers, there have been countless ideas of how to make program understanding easier.
Why is troubleshooting and debugging still so hard?
A simple problem underlies this statistic: once a person sees an inappropriate behaviour, they must then translate their questions about the behaviour into a series of questions about the programs code. In doing this translation, developers basically have to guess about what code is responsible.
(This also reminds me of Dijkstra’s comments on minimising the gap between program layout and runtime flow, as we saw in a previous #themorningpaper : “for this reason, we should do our utmost best to shorten the conceptual gap between the static program and the dynamic process” )
Ko and Myers develop a new kind of program understanding and debugging tool called a Whyline to help with this problem.
The idea is simple: rather than requiring people to translate their questions to code queries, the Whyline allows developers to choose a why did or why didn’t question about program output and then the Whyline generates an answer to the question using a variety of program analyses.
It’s easiest to understand the process visually, so I encourage you to check out the paper for screenshots of the tool in action. The most important question of course is does it work?
Evaluations of the tool on one task showed that novice programmers with the Whyline were twice as fast as expert programmers without it.
There are some limitations to the implementation in the paper, being centred on Java rich client applications, but the approach is fascinating and should generalise to other forms of I/O.
This paper is one of those referenced by Jamie Brandon as influencing the design of Eve so I can’t wait to see what they’ll be able to do to take the idea forward. Though the Eve development blog suggests they are some way away from this topic at the moment.
The Whyline today is part of a fascinating collection of Natural Programming projects at CMU looking at ways of creating a more natural programming experience. Their work on API Usability looks interesting to me, who knows, maybe it will feature in a future #themorningpaper edition!