Understanding misunderstandings in source code

@article{Gopstein2017UnderstandingMI,
  title={Understanding misunderstandings in source code},
  author={Dan Gopstein and Jake Iannacone and Yu Yan and Lois DeLong and Yanyan Zhuang and Martin K.-C. Yeh and Justin Cappos},
  journal={Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering},
  year={2017}
}
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… 

Figures and Tables from this paper

Prevalence of Confusing Code in Software Projects: Atoms of Confusion in the Wild
TLDR
This work uses a corpus of 14 of the most popular and influential open source C and C++ projects to measure the prevalence and significance of small confusing patterns, demonstrating that beyond simple misunderstanding in the lab setting, atoms of confusion are both prevalent - occurring often in real projects, and meaningful - being removed by bug-fix commits at an elevated rate.
Investigating Misunderstanding Code Patterns in C Open-Source Software Projects (Replication Package)
TLDR
The study shows that according to developers only some patterns considered previously by researchers may cause misunderstandings, and this results complement previous studies by taking the perception of developers into account.
An investigation of misunderstanding code patterns in C open-source software projects
TLDR
The study shows that according to developers only some patterns considered previously by researchers may cause misunderstandings, and this results complement previous studies by taking the perception of developers into account.
Thinking Aloud about Confusing Code
Atoms of confusion are small patterns of code that have been empirically validated to be difficult to hand-evaluate by programmers. Previous research focused on defining and quantifying this
Thinking aloud about confusing code: a qualitative investigation of program comprehension and atoms of confusion
TLDR
It is argued that thinking of confusion as an atomic construct may pose challenges to formulating new candidates for atoms of confusion, and questioned whether hand-evaluation correctness is, itself, a sufficient instrument to study program comprehension.
Atoms of Confusion: The Eyes Do Not Lie
TLDR
The present study evaluates whether developers misunderstand the code in the presence of atoms of confusion with an eye tracker, and confirms that atoms hinder developers' performance and comprehension.
Do Programmers Prefer Predictable Expressions in Code?
TLDR
It is found that programmers do prefer more predictable variants in code, and that stronger language models like the transformer align more often and more consistently with these preferences.
Evaluating Code Readability and Legibility: An Examination of Human-centric Studies
TLDR
This paper model program comprehension as a learning activity by adapting a preexisting learning taxonomy, which indicates that some competencies, e.g., tracing, are often exercised in these evaluations whereas others, E.g, relating similar code snippets, are rarely targeted.
Do People Prefer "Natural" code?
TLDR
It is found that transformations to Java and Python expressions in a distinct test corpus generally produce program structures that are less common in practice, supporting the theory that the high repetitiveness in code is a matter of deliberate preference.
Does the Introduction of Lambda Expressions Improve the Comprehension of Java Programs?
TLDR
It is argued in this paper that one can improve program comprehension when she applies particular transformations to introduce lambda expressions, and that state-of-the-art models for estimating program readability are not helpful to capture the benefits of a program transformation to introducelambda expressions.
...
1
2
3
...

References

SHOWING 1-10 OF 45 REFERENCES
A metric for software readability
TLDR
An automated readability measure is constructed and it is shown that this metric correlates strongly with two traditional measures of software quality, code changes and defect reports and suggests that comments are less important than simple blank lines to local judgments of readability.
From Obfuscation to Comprehension
TLDR
It is suggested that the ideas and experience embedded in obfuscations can be used to learn about comprehension in code comprehension, and known obfuscation techniques are surveyed and used in an attempt to derive metrics for code (in) comprehensibility.
A Taxonomy of Obfuscating Transformations
TLDR
It is argued that automatic code obfuscation is currently the most viable method for preventing reverse engineering and the design of a code obfuscator is described, a tool which converts a program into an equivalent one that is more diicult to understand and reverse engineer.
Lint, a C Program Checker
TLDR
This document discusses the use of lint, gives an overview of the implementa- tion, and gives some hints on the writing of machine independent C code.
Understanding understanding source code with functional magnetic resonance imaging
TLDR
This paper explores whether functional magnetic resonance imaging (fMRI), which is well established in cognitive neuroscience, is feasible to soundly measure program comprehension and finds a clear, distinct activation pattern of five brain regions that fit well to the understanding of program comprehension.
Letters to the editor: go to statement considered harmful
TLDR
My considerations are that, although the programmer's activity ends when he has constructed a correct program, the process taking place under control of his program is the true subject matter of his activity, and that his intellectual powers are rather geared to master static relations and his powers to visualize processes evolving in time are relatively poorly developed.
Gotos Considered Harmful and Other Programmers' Taboos
TLDR
A set of common programming taboos is examined, and both social aspects and technical reasons as to why these taboos have arisen are addressed.
Expectations, outcomes, and challenges of modern code review
TLDR
This study reveals that while finding defects remains the main motivation for review, reviews are less about defects than expected and instead provide additional benefits such as knowledge transfer, increased team awareness, and creation of alternative solutions to problems.
Improving computer program readability to aid modification
TLDR
As new software is developed, the inventory of programs to be maintained grows, and thus this high level of modification work is not expected to decrease.
...
1
2
3
4
5
...