Wednesday, December 19, 2012

How Programmers Read Code

From the article How Do We Read Code?
I recently got to participate in a psychological experiment for programmers. A friend of mine, Mike Hansen, is doing research on how people comprehend programs. The goal is to figure out some way of measuring what features in programming systems help programmers understand what they are doing, and how this can be used to make systems that lead to higher quality software. Mike is currently running an experiment where he shows people several short Python programs and asks them to tell the output of the program. The test subject is sitting in front of an eye tracker, so afterwards Mike can see where you were looking at various times during the experiment.
I recommend pausing the video for a second and studying the code yourself and then watch the eye-tracking as the participant solves the puzzle. Quite interesting.

1 comment:

annom said...


The function names are descriptive so the only thing I did was check if it does what the name claims. Then there was not need to go back to the function when computing its output.

It is a simple example. That's what you need for research and comparison with inexperienced programmers.

I am also interested to see more complex examples.