Recommendations to Create Programming Exercises to Overcome ChatGPT

Jonnathan Berrezueta-Guzman, Stephan Krusche

Abstract

Large language models, such as ChatGPT, possess the potential to revolutionize educational practices across various domains. Nonetheless, the deployment of these models can inadvertently foster academic dishonesty due to their facile accessibility. In practical courses like programming, where hands-on experience is crucial for learning, relying solely on ChatGPT can hinder students’ ability to engage with the exercises, consequently impeding the attainment of learning outcomes. This paper conducts an experimental analysis of GPT 3.5 and GPT 4, gauging their proficiencies and constraints in resolving a compendium of 22 programming exercises. We discern and categorize exercises based on ChatGPT’s ability to furnish viable solutions, alongside those that remain unaddressed. Moreover, an evaluation of the malleability of the solutions proposed by ChatGPT is undertaken. Subsequently, we propound a series of recommendations aimed at curtailing undue dependence on ChatGPT, thereby fostering authentic competency development in programming. The efficaciousness of these recommendations is underpinned by their integration into the design and delivery of an examination as part of the corresponding course.

Introduction

The "ChatGPT era" has introduced a significant challenge to computer science education. Large Language Models (LLMs) excel at generating code from natural language prompts, allowing students to complete complex assignments by simply copy-pasting problem statements. This "facile accessibility" often leads students to bypass the critical thinking and iterative practice necessary for true mastery. This paper seeks to move beyond the debate of banning AI by providing evidence-based recommendations for instructors to create exercises that foster authentic competency development.

Methodology

The study was conducted in two phases at the Technical University of Munich (TUM):

  1. Experimental Analysis: GPT-3.5 and GPT-4 were evaluated against 22 homework exercises from an introductory Java course. Researchers measured the "one-go" success rate and the manual effort required to adapt AI code for the Artemis auto-grading platform.
  2. Implementation & Validation: Based on the findings, 11 recommendations were developed and applied to a final exam for 65 students to test the resilience of these "AI-resistant" features under supervised conditions.

AI Performance and the Context Gap

The experimental phase revealed that ChatGPT's performance is highly variable depending on the exercise structure. While the AI solved 4 out of 22 exercises perfectly in a single prompt, it found others nearly impossible.

Comparison of student averages vs. ChatGPT performance across 22 programming exercises.

As shown in Figure 1, there are several instances (such as H08E01 and H10E01) where ChatGPT failed to produce a viable solution (0%), despite students maintaining a high average. The researchers identified that the "Context Gap" is an educator's strongest tool. ChatGPT struggles when it lacks the full project context. By providing partial templates and distributing tasks across multiple files, instructors force users to manually integrate AI output, which often takes more time than writing the code from scratch.

Recommendations for Educators

To mitigate undue dependence on LLMs, the authors propose several tactical design choices:

  • Reduce Problem Statements: Keep text concise to deny the AI descriptive context.
  • Use Image-Based Specifications: Providing UML diagrams as PNGs or GUI behaviors as GIFs forces students to interpret visuals, a task where text-based LLMs often fail.
  • Distribute TODOs: Spreading tasks across multiple classes and files increases the complexity of manual integration for the student.
  • Dynamic Test Cases: Use hidden and dynamic tests to prevent students from "hard-coding" solutions to match static feedback.

Implementation Results

When these recommendations were applied to a final exam, the results highlighted a significant disparity compared to traditional homework. Without AI-resistant design, ChatGPT facilitated a 91% reduction in student effort. However, with these recommendations, the time required to "fix" AI code exceeded expected solution times by 30%.

Final exam grade averages by exercise type using AI-resistant design principles.

As seen in Figure 2, the average scores in the final exam (ranging from 52.8% to 68.8%) were significantly lower than the 86.4% average observed in homework assignments. This suggests that the recommendations successfully increased the difficulty for those relying on external tools, ensuring that grades more accurately reflect individual competency.

Conclusion

While the "cat-and-mouse" game between educators and AI developers continues, this study demonstrates that thoughtful exercise design can significantly curb AI-assisted academic dishonesty. Future work will focus on integrating these features into automated platforms like Artemis and exploring how LLMs can be transitioned from replacements for effort into effective tutors.

Summary updated

BibTeX
@inproceedings{berrezuetaguzman2023recommendations,
  author = {Jonnathan Berrezueta-Guzman and Stephan Krusche},
  title = {{Recommendations to Create Programming Exercises to Overcome ChatGPT}},
  booktitle = {Csee\&t},
  year = {2023},
  doi = {10.1109/cseet58097.2023.00031},
}
Figure