Interleaving Natural Language Prompting with Code Editing for Solving Programming Tasks with Generative AI Models
Victor-Alexandru Pădurean, Alkis Gotovos, Ahana Ghosh, Paul Denny, Juho Leinonen, Andrew Luxton-Reilly, James Prather, Adish Singla
TL;DR
The paper addresses how students navigate GenAI-assisted programming by interleaving natural-language prompts with manual code edits. It analyzes 13,305 interactions from 355 students across a three-day lab on a GPT-4o-based platform with a $20$-message limit per conversation, across 9 problems. The study finds that prompts typically seed initial solutions while edits follow failed runs, with edits being concise and task-dependent; higher programming competence reduces reliance on edits. These insights inform educational design to cultivate both prompting fluency and precise editing skills, and to scaffold the interplay between prompt refinement and targeted code repair in AI-assisted programming workflows.
Abstract
Modern computing students often rely on both natural-language prompting and manual code editing to solve programming tasks. Yet we still lack a clear understanding of how these two modes are combined in practice, and how their usage varies with task complexity and student ability. In this paper, we investigate this through a large-scale study in an introductory programming course, collecting 13,305 interactions from 355 students during a three-day lab activity. Our analysis shows that students primarily use prompting to generate initial solutions, and then often enter short edit-run loops to refine their code following a failed execution. Student reflections confirm that prompting is helpful for structuring solutions, editing is effective for making targeted corrections, while both are useful for learning. We find that manual editing becomes more frequent as task complexity increases, but most edits remain concise, with many affecting a single line of code. Higher-performing students tend to succeed using prompting alone, while lower-performing students rely more on edits. These findings highlight the role of manual editing as a deliberate last-mile repair strategy, complementing prompting in AI-assisted programming workflows.
