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

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.

Authors

Institutions

Publication Details

Journal
Empirical Software Engineering
Published
2026-02-19
DOI
https://doi.org/10.1007/s10664-026-10818-2
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Dror G. Feitelson, Aviad Baron
Empirical Software Engineering
Software Engineering Research
article

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

Dror G. Feitelson, Aviad Baron
article en

Abstract

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.

Empirical Software EngineeringVol. 31(3)
Hebrew University of Jerusalem (IL)
Quality Education
Openalex Percentile: Top 65%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Tracing vs. comprehension: On different levels of understanding Boolean expressions — Dror G. Feitelson, Aviad Baron · Empirical Software Engineering (2026) | TGRS Research Map | TGRS