## Tests of how programmers read code may measure the wrong skills

URL: https://theprimary.com/ai-tech/2026-12-03/code-comprehension-testing-proxies
Published: 2026-12-03T00:40:44.573Z
Updated: 2026-12-03T00:40:46.333Z
Category: AI-Tech

Standard classroom experiments measuring code comprehension fail to reflect professional judgment, according to a study comparing student testing proxies against an expert panel.

When software engineers open a computer program, they do not read it from top to bottom like a novel. Instead, their eyes skip across variable names, jump directly to functional units, and trace how data moves through internal operations to achieve a specific goal. Reading and making sense of existing code is the single largest consumer of an engineer's workday, yet because comprehension happens entirely inside a human mind, observing it directly remains impossible. To study how difficult a piece of software is to grasp, researchers have long relied on standing stand-ins known as comprehension proxies. These indirect assessments ask volunteers to read short snippets of code and either summarize what the program accomplishes, predict its output, answer multiple-choice questions, or rate how difficult the exercise felt on a numerical scale.

For decades, computer science researchers have treated these proxy tasks as interchangeable measurements of code comprehensibility. That assumption matters because software engineering depends on accurate measures of mental effort to guide how programs are written, refactored, and maintained. Development teams rely on these findings to decide whether modern coding styles reduce confusion or whether newly generated software from artificial intelligence systems is safe and easy for people to inspect. If the tests used to evaluate code fail to capture how human minds actually process instructions, then an entire generation of tools designed to make software clearer may be optimized for the wrong behaviors.

Understanding code requires a chain of cognitive steps that unfold in a precise sequence. First, a reader must recognize the basic syntax of the language, identifying where statements begin and end. Next, the reader must track the program's execution paths, holding the values of changing variables in working memory to deduce how the system responds to different inputs. Finally, the reader must synthesize those operations into an abstract mental model that explains why the program behaves as it does. Because each step imposes a different kind of mental demand, a testing method that evaluates one stage cannot automatically reveal how well someone handles another.

A study by Erfan Arvan and Martin Kellogg at the New Jersey Institute of Technology, together with Nadeeshan De Silva and Oscar Chaparro at William & Mary, indicates that many widely used comprehension proxies do not reflect the difficulty experienced by seasoned professionals. In a paper posted to the arXiv preprint server and presented at the 41st IEEE/ACM International Conference on Automated Software Engineering, the authors report that common tests based on program syntax fail to reflect expert judgments of code difficulty, while exercises that measure response time during behavioral input-output reasoning provide the most dependable signal.

## Why is measuring how developers understand software so difficult?

Measuring code comprehension is challenging because an engineer's internal understanding leaves no direct physical trace. To examine comprehension empirically, researchers construct a proxy by pairing a specific task with a specific measurement strategy. The literature contains a wide variety of tasks, such as asking participants to predict a program's output, write an English summary of what a function does, locate a deliberate bug, or provide personal opinions on difficulty. Researchers pair these activities with quantifiable metrics, including the total seconds spent reading, the correctness of the final response, self-reported ratings on numerical scales, or physiological recordings from eye-tracking devices and brain scanners.

The task and the chosen measurement strategy are completely interdependent. An accuracy measurement is meaningless if a question is trivial, while a deeply informative task reveals very little if the metric cannot separate guessing from genuine comprehension. Compounding this challenge is the problem of who actually participates in software engineering studies. A recent survey by Stefan Wyrich and colleagues established that approximately 90% of code comprehensibility studies published between 2010 and 2019 used university students as their experimental subjects. Academic laboratories frequently rely on students because undergraduates are accessible and inexpensive, but researchers routinely generalize their conclusions to senior software developers.

Novices and professional developers process computer code in fundamentally different ways. Laboratory investigations using functional magnetic resonance imaging have shown that experts and beginners activate different regions of the brain when inspecting the same software routines. Novices tend to read code sequentially, progressing line by line as though following a written narrative, and they concentrate their attention on literal statements and basic syntax. Experienced software engineers direct their visual attention non-linearly, navigating immediately toward functional units, method interactions, and semantic regions that serve the program's primary goals.

Because professional experience reshapes how the human visual system and working memory interact with software, an exercise that confounds an undergraduate may present zero obstacle to a practicing engineer. Prior survey data indicate that professional developers spend between 58% and 70% of their total working hours attempting to comprehend existing code. When the empirical foundations of software engineering research rest on proxies collected from students, the literature risks measuring classroom unfamiliarity rather than authentic engineering difficulty.

## How do experts judge the difficulty of reading a program?

Senior developers determine code difficulty through iterative deliberation over functional interactions rather than structural metrics. To establish an objective benchmark of code difficulty, the researchers organized a formal consensus panel composed of five senior software engineers. In the absence of an absolute physical standard for comprehensibility, the authors reasoned that consistent agreement among seasoned practitioners represents the most practical ground truth available. If experienced engineers converge on a unanimous ranking of which code samples demand the most cognitive effort, that consensus provides a dependable baseline against which candidate proxy tests can be judged.

The authors established this reference ranking by adapting the Delphi method, an iterative consensus framework originally developed during the Cold War for national security forecasting and later adopted in clinical medicine. Five professional developers evaluated eight self-contained Java methods selected to represent diverse algorithmic and structural characteristics. Across three structured rounds of evaluation, the panelists ranked the eight code snippets by comprehension difficulty, submitted detailed written rationales for their choices, and reviewed anonymized feedback from other panel members to resolve disagreements.

Achieving total harmony among practitioners proved impossible even after three rounds of structured deliberation. Martin explained that "There were a few snippets that the engineers never agreed on, actually, and so our final ordering was actually a partial order." The researchers checked whether this lack of complete consensus destabilized their experimental conclusions. Martin noted that "We evaluated whether changing the few snippets where they did disagree changed our overall experimental results, and found that it didn't, so the details of that are in an appendix in the full version of the paper: no matter how we treated the remaining disagreements, we still saw big differences between proxies."

While the Delphi panel reached consensus on a difficulty ranking for the eight programs, the researchers conducted a parallel empirical investigation involving 44 undergraduate computer science students from two universities in the United States. These student participants performed a comprehensive battery of comprehension tasks on the exact same eight Java methods. By collecting performance data across the student cohort, the authors measured 14 distinct comprehension proxies drawn directly from prior software engineering literature.

To categorize these proxies systematically, the researchers extracted 111 comprehension questions from prior empirical papers and classified them through an open-coding analysis, achieving an inter-rater agreement score of 0.89 under Cohen's kappa statistic. The resulting taxonomy split questions into three broad categories: program function, semantics, and syntax. Semantics included tasks requiring simulated execution, such as determining program output or calculating the final value of an internal variable. Syntax questions focused strictly on structural components, such as counting the number of loops or verifying whether an identifier was initialized to zero.

## Which comprehension tests actually reflect how professionals work?

Timed tests based on input-output reasoning showed the strongest alignment with the expert rankings. When the authors conducted a correlation analysis comparing the 14 student-derived proxies against the ground-truth rankings established by the professional Delphi panel, proxies requiring participants to reason about program behavior consistently outranked all other testing formats. In particular, the elapsed response time that students needed to answer input-output questions proved to be the single most reliable proxy evaluated in the entire study.

A critical finding from the evaluation is that time-based measurements consistently outperformed direct measures of answer accuracy. While correctness on input-output questions still showed a positive relationship with expert difficulty rankings, the duration of time that participants spent calculating the answer reflected the true difficulty of the code far more faithfully. When students encountered challenging logic, they often managed to arrive at the correct answer eventually, but their hesitation and prolonged mental simulation left a clear record in the timing data. Discussing the cognitive foundation behind this pattern, Martin noted that "we suspect that a lot of the problems are easy enough that there is a cliff effect: we can't tell the difference between "correct but it was hard" and "correct and easy" except via the timing proxy, because both look like "correct" in our data otherwise."

Conversely, subjective self-assessments and open-ended text summaries performed poorly when evaluated against expert judgments. Likert-scale ratings, in which students were asked to grade how easy or hard a code snippet felt on a simple numerical scale, showed weak correlations with the panel's ranking. Free-text summaries written by students and subsequently evaluated by human judges also failed to mirror the difficulty perceived by professionals, suggesting that verbal articulation captures a different skill set than operational code reading.

The most striking breakdown occurred in proxies based on syntactic questions. When students were asked to identify structural properties of a program, such as counting conditional branches or tracking variable declarations, the resulting measurements exhibited near-zero or negative correlations with the expert consensus ranking. A code snippet could possess intricate, highly nested loops that scored as difficult on a structural test while remaining transparent to an experienced practitioner who instantly recognized the underlying design pattern. These findings call into question conclusions from earlier published papers that relied exclusively on syntactic questions to evaluate code maintainability. Addressing why structural tasks decoupled so sharply from expert reality, Martin explained that "A lot of those proxies come from much older work that adapted techniques from psychology; they've gone out of favor recently, exactly because they're not measuring anything semantically-meaningful. It's nice to validate the community's intuition, but we weren't really surprised."

## What the results cannot tell you

These findings come with specific structural boundaries that reflect how the experiment was designed. The study relied on a panel of five professional software engineers evaluating eight self-contained Java methods, meaning the absolute rankings reflect a small sample of algorithms rather than large, multi-file software architectures. Furthermore, the ground-truth ranking was derived through structured consensus under uncertainty rather than an involuntary biological readout of mental strain.

Scale remains a central technical boundary for this evaluation. Regarding how expert rankings might alter on industrial systems, Martin cautioned that "It could have shifted a lot - one of the big limitations of this study is the small size and self-contained nature of the code snippets that we used." Recruiting working engineers for massive codebases presents severe practical hurdles. Martin noted that "The problem with doing a larger scale study is the expense - engineers were willing to help us out by looking at these little snippets during their free time, but "real work" would require real senior-engineer compensation, which academics just can't afford."

Because the investigation evaluated 44 undergraduate computer science students from two American institutions, the proxy performance figures reflect students trained in similar educational contexts. The paper itself is an academic report posted to the arXiv preprint repository and presented at an academic conference, meaning its empirical claims describe specific observed correlations rather than universal psychological laws. Most importantly, while the results demonstrate that syntax questions correlate poorly with expert difficulty rankings, they do not prove that structural features have no influence on readability in larger codebases. When asked where the predictive power of response times might break down in broader production environments, Martin observed that "we just don't know - we followed prior work in using small, independent snippets because we were interested in investigating how the proxies used in prior work related to ground truth."

## What happens next in code measurement?

The immediate implication of this research is that future empirical software studies should phase out reliance on syntax-counting questions and subjective Likert-scale polls when testing code comprehensibility. Instead, researchers designing experiments can focus on measuring the elapsed time participants require to predict program outputs. This provides a practical, defensible metric that remains feasible to administer to student cohorts while maintaining a genuine statistical connection to professional judgment.

Yet the researchers emphasize that their results do not represent an absolute verdict on behavioral metrics. Martin cautioned against treating behavioral tests as a settled standard: "Comprehension is a complex process, and our work shows that different proxies don't capture it equally. While our findings do suggest that behavior input-output questions and time measurements were best, it's just one study - further work is needed to actually be confident that these proxies really are the best. I'd characterize our work as showing that it's necessary to evaluate a proxy against the ground truth at all, rather than as a statement that behavioral input-output reasoning is definitely the way to go."

The findings also provide a fresh lens for re-evaluating historical literature on developer productivity and automated code generation. As software teams increasingly rely on language models to generate code, deciding whether AI-written functions are readable has become an urgent industry priority. Evaluating those automated systems through simple structural metrics risks rewarding code that looks clean on the surface while remaining deeply confusing to maintain. Establishing reliable proxies ensures that when researchers claim a new tool makes code easier to read, they are measuring human understanding rather than superficial mechanics.
