TL;DR
This paper investigates how introductory programming students balance natural language prompting and manual code editing when working with Generative AI (GenAI) models. By analyzing over 13,000 interactions, the researchers found that students primarily use prompting to generate initial code structures and rely on manual editing as a localized "last-mile repair" tool to fix bugs after failed test runs.
What Problem Does This Paper Address?
The widespread adoption of GenAI tools like ChatGPT and GitHub Copilot has fundamentally changed how novices learn to code. Instead of starting with a blank text editor, students often begin with AI-generated code blocks. However, AI models frequently produce code with subtle logical errors or boundary condition failures.
Educators worry that easy access to GenAI might lead to passive over-reliance, preventing students from mastering core programming and debugging skills. This paper addresses a critical gap in understanding this new paradigm: How do students actually interleave natural language prompting with manual code editing in practice, and how does this behavior change based on task complexity and student ability?
Methods
The authors conducted a large-scale study within an introductory Python programming course at the University of Auckland. They utilized Prompt Programming, a web-based platform designed for solving visual computational tasks. The platform features a tightly integrated chat interface powered by GPT-4o mini alongside a direct code editor and execution console.
The system tracked student workflows step-by-step, logging state transitions between:
- Sending a prompt (
Msg) - Attaching edited code to a prompt (
MsgAtt) - Running AI code (
RunAI) - Manually editing code (
Edit) - Running edited code (
RunEdit)
To complement these behavioral logs, the researchers collected open-ended student reflections and cross-referenced interaction data with students' performance on three independent, invigilated, pen-and-paper/sandbox coding exams to gauge baseline programming competence.
Datasets
The study collected a dataset consisting of 13,305 distinct interactions from 355 students over a three-day laboratory activity.
Students interacted with 9 programming problems across three difficulty tiers:
- Basic Functions: Simple tasks like counting negative numbers or finding an index.
- Advanced Functions: More complex single-function tasks, such as sorting a specific sublist.
- Classes & Functions: Multi-function problems requiring custom data structures (e.g., implementing a stack to validate parentheses).
Key Insights and Ideas
- Editing as "Last-Mile Repair": Students rarely use manual editing to rewrite large blocks of code. Instead, editing is overwhelmingly used for highly localized, single-line fixes (like changing a logical operator or adjusting an index range) near the very end of a problem-solving session.
- Editing is Reactive: The transition into manual code editing is almost always triggered by a failed code execution (
RunAI$\rightarrow$Fail$\rightarrow$Edit). Students test the AI's code first, see the error, and then dive into the code themselves rather than trying to re-prompt the model. - The Complementary Mindset: Student reflections revealed a clear strategic division: prompting provides speed and initial structure, while manual editing provides precision, verification, and a sense of control.
Key Results
- Complexity Drives Editing: As tasks got harder, manual editing became significantly more frequent. Only 16% of sessions in the Basic tier involved manual edits, jumping to 26% in Advanced and 28% in the Classes & Functions tier.
- Competence Reduces Interaction Volume: Students in the HighScore group (determined by exam scores $\ge$ 8/10) were much less reliant on manual editing, entering the edit loop in only 9.6% of sessions compared to 21.5% for the LowScore group. High-performing students also solved problems much faster, requiring significantly fewer total prompt messages to reach a successful solution.
Limitations and Future Work
The authors note a few limitations in their study setup. First, only the basic tasks were mandatory, meaning the advanced task data suffers from potential self-selection bias (stronger students completing optional work). Second, the study did not feature a strict A/B testing control group (e.g., comparing a prompting-only interface to a hybrid interface). Finally, the semantic content and quality of the natural language prompts were not directly analyzed.
For future work, the authors suggest designing exercises that intentionally introduce subtle bugs into AI completions to explicitly train students' "last-mile" debugging capabilities. They also propose exploring how these hybrid prompting-editing workflows scale to open-ended domains like data science and machine learning, where code refactoring demands are much larger.
Summary updated