Prompting Patterns for Code Understanding: A Controlled Experiment with Professional Developers - Azeez, Hasanain Hazim; Mohsin, Ahmed Alaa; Abdul-Hassan, Hind Ali (Technium: Romanian Journal of Applied Sciences and Technology, 2026)
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.