Chris Parnin, publishing under the name “ninlabs research”, has released a study of 10,000 programming sessions recorded from 86 programmers using Eclipse and Visual Studio. His article, titled Programmer Interrupted, has found some worrying, but entirely unexpected, data points.
- A programmer takes between 10-15 minutes to start editing code after resuming work from an interruption.
- When interrupted during an edit of a method, only 10% of times did a programmer resume work in less than a minute.
- A programmer is likely to get just one uninterrupted 2-hour session in a day
Chris continues,
We also looked at some of the ways programmers coped with interruption:
- Most sessions programmers navigated to several locations to rebuild context before resuming an edit.
- Programmers insert intentional compile errors to force a “roadblock” reminder.
- A source diff is seen as a last resort way to recover state but can be cumbersome to review
In order to determine a programmers “memory load”, Chris and his colleagues used a technique called pupillometry. In the 60’s researchers discovered that the pupils of the eye dilate when someone is working on a mentally challenging problem and constrict once a solution has been reached. This also occurs with other cognitive tasks such as memorizing and then reciting lists of words.
Another technique they used to measure memory load was subvocal utterances. In a related paper Chris wrote,
We found subvocal activity to be strongly associated with certain activites and conditionally during others. Subvocalization was strongly associated with making edits to code. During program exploration, we found limited subvocalization. Sub-vocalization mainly occurred when the subject encountered important code (logic for moving Tetris block) and (testing when block stops moving). We also found subvocalization when the developer was debugging and testing the program, which may be associated with problem formulation and solution evaluation.
Also discussed in the article is different types of memory and how they related to a programmer’s workflow. These include:
- Prospective Memory, reminders to perform future actions in specific circumstances e.g. to buy milk on the way home from work
- Attentive Memory, conscious memories that can be freely attended to.
- Associative Memory, a set of non-conscious links between manifestations of co-occurring stimuli.
- Episodic Memory, the recollection of past events.
Chris Parnin is a Ph.D. Student, College of Computing, Georgia Tech. He studies the empirical, hci, and cognitive neuroscience aspects of software development. I look at how software development occurs in practice and how certain tools help or hinder this process.