TL;DR
As generative AI tools become ubiquitous in software development, introductory computer science education must shift its focus from syntax mastery to code evaluation and prompt engineering. This paper introduces Prompt Programming, an open-access web platform that teaches students how to solve complex, multi-function programming tasks through iterative, multi-turn dialogues with Large Language Models (LLMs). A deployment with over 900 undergraduate students revealed that providing on-request code execution successfully incentivizes students to critically read and evaluate AI-generated code before testing it.
What Problem Does This Paper Address?
Computing students are increasingly using generative AI tools like ChatGPT and GitHub Copilot to complete assignments, often without formal instruction on how to use them effectively or responsibly. Traditional introductory programming (CS1) courses focus heavily on syntax—teaching students how to translate a problem statement into working code. However, because LLMs can now generate syntactically correct code instantly, the core human skill shifts to reading, critically evaluating, and iteratively refining AI-generated solutions.
Prior educational interventions, such as "Prompt Problems," challenged students to write single-shot prompts based on visual specifications. However, real-world software engineering rarely happens in a single shot; it requires breaking down complex problems into interdependent functions and debugging them via dialogue. The authors address this gap by developing a platform that supports multi-turn conversations, multi-function architectures, and controlled code execution.
Methods
The authors developed Prompt Programming (available at promptprogram.org), a free web-based platform supporting Python and C.
The platform introduces three core features designed to foster authentic AI interactions:
- Multi-Turn Dialogue: A chat-like interface where the full conversation history is sent to the LLM backend (
GPT-4o mini), allowing students to incrementally correct errors or expand functionality. - Multi-Function Problems: Tasks that cannot be solved with a single monolithic function. Students must guide the AI to generate multiple helper functions and structures that work cohesively.
- On-Request Execution: Instead of automatically running code on every prompt, students must explicitly click a "Run Code" button. A counter tracks the number of runs, encouraging students to mentally trace and verify the code before executing it.
The platform was deployed in a large introductory C programming course (1,031 enrolled students) at the University of Auckland, spanning three weekly laboratory assignments.
Datasets
The study evaluates interaction logs collected directly from the platform deployment. The dataset consists of anonymized queries, LLM responses, code execution counts, and optional open-response student reflections.
The tasks were split across three weekly labs:
- Lab 7 (Simple Single-Function): 3 problems focusing on basic array operations (e.g., counting negative numbers).
- Lab 9 (Complex Single-Function): 3 harder problems (e.g., matrix propagation, subarray sorting).
- Lab 10 (Multi-Function): 3 complex problems requiring helper functions and custom structures (e.g., password validation, stack-based parenthesis checking, robot grid navigation).
Key Insights and Ideas
- The Shift to Iterative Prompting: As problem complexity scaled from Lab 7 to Lab 10, students naturally abandoned monolithic, single-shot prompts. They adopted an incremental strategy: writing a long initial prompt to set up the problem context, followed by short, highly targeted adjustments based on the AI's feedback.
- Hub-and-Spoke Problem Solving: By analyzing student progression paths through directed graphs, the researchers discovered that students solving multi-function problems frequently converged on "hub" states. Students typically focused on getting all helper functions correctly implemented first before attempting to tie them together with the main coordinating function.
- Prompting Fosters Critical Thinking: A common educator fear is that generative AI makes students passive consumers of code. However, the data showed that students were highly selective about when they chose to execute code. They frequently chose not to run code that was incorrect, proving they were actively reading and debugging the LLM's output in their heads before testing it.
Key Results
- High Success Rates: Despite the novelty of the platform and the difficulty of the later tasks, student success rates remained remarkably high: 96% for Lab 7, 96% for Lab 9, and 97% for Lab 10.
- Increased Conversational Depth: The average number of total messages per problem grew significantly with difficulty, rising from 5 messages in Lab 7 to 12 messages in Lab 10.
- Selective Execution Behavior: Across all sessions, students requested code execution only 65-70% of the time. Crucially, they were significantly more likely to execute code when it was actually correct versus when it contained errors, confirming strong code comprehension and critical judgment.
- Student Preference for Hybrid Skills: In post-activity reflections, the vast majority of students indicated that an equal mix of natural language prompting and manual code editing is the ideal workflow for tackling harder programming problems.
Limitations and Future Work
- Monolithic Testing Constraints: The current multi-function testing framework uses a single driver file to validate all functions simultaneously. If a student tries to test a partial solution before all helper functions are generated, it causes compilation errors. The authors suggest moving toward a modular testing framework.
- Sequence Bias: Because students completed the labs chronologically (Lab 7 $\rightarrow$ Lab 9 $\rightarrow$ Lab 10), their refined behavior in the final lab may have been influenced by learning effects from the earlier, simpler labs.
- Lack of a Control Group: The study did not feature an A/B testing design to directly compare single-turn prompting against multi-turn prompting.
- Long-Term Impact: The study does not measure how learning via prompt programming affects a student's long-term ability to write independent code without an AI assistant.
Summary updated