TY - GEN
T1 - Prevalence of confusing code in software projects
T2 - 15th ACM/IEEE International Conference on Mining Software Repositories, MSR 2018, co-located with the 40th International Conference on Software Engineering, ICSE 2018
AU - Gopstein, Dan
AU - Zhou, Hongwei Henry
AU - Frankl, Phyllis
AU - Cappos, Justin
N1 - Publisher Copyright:
© 2018 ACM.
PY - 2018/5/28
Y1 - 2018/5/28
N2 - Prior work has shown that extremely small code patterns, such as the conditional operator and implicit type conversion, can cause considerable misunderstanding in programmers. Until now, the real world impact of these patterns - known as 'atoms of confusion' - was only speculative. 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 these small confusing patterns. Our results show that the 15 known types of confusing micro patterns occur millions of times in programs like the Linux kernel and GCC, appearing on average once every 23 lines. We show there is a strong correlation between these confusing patterns and bug-fix commits as well as a tendency for confusing patterns to be commented. We also explore patterns at the project level showing the rate of security vulnerabilities is higher in projects with more atoms. Finally, we examine real code examples containing these atoms, including ones that were used to find and fix bugs in our corpus. In total this work demonstrates 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.
AB - Prior work has shown that extremely small code patterns, such as the conditional operator and implicit type conversion, can cause considerable misunderstanding in programmers. Until now, the real world impact of these patterns - known as 'atoms of confusion' - was only speculative. 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 these small confusing patterns. Our results show that the 15 known types of confusing micro patterns occur millions of times in programs like the Linux kernel and GCC, appearing on average once every 23 lines. We show there is a strong correlation between these confusing patterns and bug-fix commits as well as a tendency for confusing patterns to be commented. We also explore patterns at the project level showing the rate of security vulnerabilities is higher in projects with more atoms. Finally, we examine real code examples containing these atoms, including ones that were used to find and fix bugs in our corpus. In total this work demonstrates 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.
KW - program understanding
KW - programming languages
UR - http://www.scopus.com/inward/record.url?scp=85051661014&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85051661014&partnerID=8YFLogxK
U2 - 10.1145/3196398.3196432
DO - 10.1145/3196398.3196432
M3 - Conference contribution
AN - SCOPUS:85051661014
SN - 9781450357166
T3 - Proceedings - International Conference on Software Engineering
SP - 281
EP - 291
BT - Proceedings - 2018 ACM/IEEE 15th International Conference on Mining Software Repositories, MSR 2018
PB - IEEE Computer Society
Y2 - 28 May 2018 through 29 May 2018
ER -