Author
Listed:
- 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)
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.
Suggested Citation
Hasanain Hazim Azeez & Ahmed Alaa Mohsin & Hind Ali Abdul-Hassan, 2026.
"Prompting Patterns for Code Understanding: A Controlled Experiment with Professional Developers,"
Technium, Technium Science, vol. 31, pages 186-195, March.
Handle:
RePEc:tec:techni:ojs:13549
DOI: 10.47577/technium.v31i.13549
Download full text from publisher
Corrections
All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:tec:techni:ojs:13549. See general information about how to correct material in RePEc.
If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.
We have no bibliographic references for this item. You can help adding them by using this form .
If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Ana Maria Golita (email available below). General contact details of provider: .
Please note that corrections may take a couple of weeks to filter through
the various RePEc services.