kirancodes.me
To Proof Maintenance & Beyond!

Understanding misunderstandings in source code

Dan Gopstein, Jake Iannacone, Yu Yan, Lois DeLong, Yanyan Zhuang, Martin K.-C. Yeh, Justin Cappos

Abstract

Humans often mistake the meaning of source code, and so misjudge a program's true behavior. These mistakes can be caused by extremely small, isolated patterns in code, which can lead to significant runtime errors. These patterns are used in large, popular software projects and even recommended in style guides. To identify code patterns that may confuse programmers we extracted a preliminary set of `atoms of confusion' from known confusing code. We show empirically in an experiment with 73 participants that these code patterns can lead to a significantly increased rate of misunderstanding versus equivalent code without the patterns. We then go on to take larger confusing programs and measure (in an experiment with 43 participants) the impact, in terms of programmer confusion, of removing these confusing patterns. All of our instruments, analysis code, and data are publicly available online for replication, experimentation, and feedback.

BibTeX
@inproceedings{Gopstein-al:FSE17,
  author    = {Dan Gopstein and
               Jake Iannacone and
               Yu Yan and
               Lois DeLong and
               Yanyan Zhuang and
               Martin K.{-}C. Yeh and
               Justin Cappos},
  title     = {Understanding misunderstandings in source code},
  booktitle = {{ESEC/SIGSOFT} {FSE}},
  pages     = {129--139},
  publisher = {{ACM}},
  year      = {2017},
}

Related papers