Prompting Patterns for Code Understanding: A Controlled Experiment with Professional Developers
Hasanain Hazim Azeez,
Ahmed Alaa Mohsin and
Hind Ali Abdul-Hassan
Additional contact information
Hasanain Hazim Azeez: Computer Science and IT Faculty, Wasit University, Al-kut, Iraq
Ahmed Alaa Mohsin: Computer Science and IT Faculty, Wasit University, Al-kut, Iraq
Hind Ali Abdul-Hassan: Computer Science and IT Faculty, Wasit University, Al-kut, Iraq
Technium, 2026, vol. 31, 186-195
Abstract:
Even though program comprehension tasks occupy a sizable fraction of a developer's working hours, most developers still have a hard time comprehend poorly documented or unfamiliar code. While natural‑language interfaces to explore source code built upon recent advances in large‑language models (LLMs) are available, the quality of the conversation is heavily dependent upon the way questions are structured. In this paper, we inquire whether initial-highlighter prompt patterns provide benefit to developers as they understand code via LLM interaction. For a controlled experiment, we recruited thirty professional developers that tried to decode Python functions they had never seen before. As part of a within‑subjects design they first responded to comprehension questions without help, then queried an LLM with either an unstructured natural‑language query (the baseline) or one of two structured prompt patterns. Comprehension was assessed in terms of accuracy, time and subjective confidence. The results demonstrate that structured patterns significantly improved comprehension accuracy, and it also took less time to complete compared with the baseline. We provide a set of guidelines to use to leverage effective prompt designs, and indicate how prompt patterns can supplement existing documentation and code understanding tools. The findings highlight the potential of prompt engineering to augment developers’ comprehension while cautioning against over‑reliance on automated suggestions.
Date: 2026
References: Add references at CitEc
Citations:
Downloads: (external link)
https://techniumscience.com/index.php/technium/article/view/13549 (text/html)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:tec:techni:ojs:13549
DOI: 10.47577/technium.v31i.13549
Access Statistics for this article
Technium is currently edited by Scurtu Ionut Cristian
More articles in Technium from Technium Science
Bibliographic data for series maintained by Ana Maria Golita ().