1
Return

Tracing vs. comprehension: On different levels of understanding Boolean expressions

delete2026-02-19
delete0
delete
OA
AI
A
A. Zvie Bar-On *
D
Dror G. Feitelson
DOI:10.1007/s10664-026-10818-2delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Reading and understanding existing code is a crucial part of software engineering. We focus on the understanding of Boolean expressions, which control the flow of the execution. Such expressions can often be written in different ways that are logically equivalent, but there has been no systematic research on the possible advantages of one formulation over another. Our goal is to examine the effect of various factors on understanding such expressions, leading to guidelines for selecting the most understandable version from a set of logically equivalent expressions. To achieve this goal, we conducted a controlled experiment using all 16 simple Boolean expressions with two variables, a connecting operator, and possible negations. We define and empirically compare two distinct levels of understanding these expressions: tracing, which involves following the program’s execution for a specific input, and comprehension, which encompasses a generalization of how the code behaves for all possible inputs. The experiment involved 362 participants, 57% of which had more than 6 years of programming experience. The results reveal that comprehension not only takes longer but also leads to a higher error rate compared to tracing. Furthermore, expressions involving the logical operator OR were found to be more challenging on average than those with AND, but this difficulty manifested only at the comprehension level. One of the sources of this difference appears to be an interaction between the logical operators OR and NOT, and we discuss possible models which may explain this effect. The observed differences in understanding equivalent expressions highlight the importance of selecting which expression to use. Our findings suggest that Boolean expressions with AND and fewer negations tend to improve code readability, making them preferable for writing understandable code. But these recommendations need to be verified in the general context of Boolean expressions, including those that are more complex than the ones we considered.
Keywords:
Code Comprehension
Boolean Expressions
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

Empirical Software Engineering cover
Empirical Software Engineering
IF:
3.6
Papers:
1.9K
Citations:
5.3K

Organization

C
computer science
Scholars:
1.5K
Papers: 737
Citations: 0
Cited Papers

Cited Papers

Citing Papers

Citing Papers