Abstract - Background: Code confusion concerns source code characteristics that make code harder for authors and reviewers to comprehend. Atoms of Confusion (AoCs) are a set of low-level programming idioms for C-like languages that have been proposed as a potential source of code confusion; previous studies have empirically evaluated the extent to which they (i) are confusing to developers and (ii) introduce risk to software products.
Aims: In this study, we further explore Atoms of Confusion and question the assumptions associating them with defects, and associating their removal with defect-fixing activities.
Method: We mine 76,610 pull requests from six Java open-source projects, extracting and analyzing changes relating to AoCs.
Results: First, we find no relation between the existence of AoCs and defect-fixing activity. Second, we observe that for some types of AoC—such as infix operator precedence and conditional operator—although quantitative analysis suggests a relation between their removal and fixes for defects, removing them does not contribute to the defect-fixing process. Finally, we find that project- and language-specific factors can affect the prevalence of AoC types, such as pre-increment/decrement and type conversion AoCs.
Conclusion: While prior work reported that AoCs impact defect proneness in C and C++ systems, we find that the presence of AoCs did not affect defect proneness in open-source Java projects. Our results suggest that future work is needed to investigate project- and language-specific factors such as project style guides and implicit type conversion that may impact the defect proneness of AoCs.
Preprint - PDF
Bibtex