[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82896-en":3,"doc-seo-82896-105":29,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},82896,8796095461564,"Liam","https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d",8,"Research & Report","When AI Is Wrong on Purpose: How Students Respond to Buggy GenAI Code","Generative AI is increasingly used in software development and CS education, where students prompt models to produce code that matches intended behavior. Yet GenAI output can look correct while hiding subtle faults, especially in CS1 tasks where success may reduce careful inspection. This study investigates adapting prompt-centered programming by injecting realistic runnable bugs into otherwise correct solutions. Analysis of 2,636 sessions from 917 students compares naturally occurring prompt failures with deliberately injected bugs, revealing different student repair strategies and emphasizing review, debugging, and specification refinement.","When AI Is Wrong on Purpose: How Students Respond to Buggy GenAI Code  \narXiv :2607 .05068v 1 [ cs . SE] 6 Jul 2026  \nVictor-Alexandru Pădurean  \nMPI-SWS Saarbrücken, Germany [vpadurea@mpi-sws.org](vpadurea@mpi-sws.org)  \nJyotika Mahapatra  \nMPI-SWS Saarbrücken, Germany [jmahaptra@mpi-sws.org](jmahaptra@mpi-sws.org)  \nKaitlin Riegel  \nUniversity of Auckland Auckland, New Zealand [kaitlin.riegel@auckland.ac.nz](kaitlin.riegel@auckland.ac.nz)  \nAhana Ghosh  \nMPI-SWS Saarbrücken, Germany [gahana@mpi-sws.org](gahana@mpi-sws.org)  \nAlkis Gotovos  \nMPI-SWS Saarbrücken, Germany [agkotovo@mpi-sws.org](agkotovo@mpi-sws.org)  \nPaul Denny University of Auckland Auckland, New Zealand [paul@cs.auckland.ac.nz](paul@cs.auckland.ac.nz)  \nJuho Leinonen  \nAalto University Espoo, Finland [juho.2.leinonen@aalto.fi](juho.2.leinonen@aalto.fi)  \nJames Prather  \nAbilene Christian University Abilene, TX, USA [james.prather@acu.edu](james.prather@acu.edu)  \nAdish Singla  \nMPI-SWS Saarbrücken, Germany [adishs@mpi-sws.org](adishs@mpi-sws.org)  \nAbstract  \nAs Generative AI (GenAI) becomes increasingly central to software development, CS education is integrating prompt-centered workflows where students describe intended program behavior in natural language to elicit code. However, professional practice requires careful review and verification of GenAI-generated code that may appear correct while containing subtle faults. This creates a challenge for CS1-level activities, where current models often solve tasks correctly and reduce students’ incentive to closely inspect generated outputs. We investigate how prompt-centered programming activities can be adapted to better foster these practices. Specifically, we explore an approach where realistic, runnable bugs are injected into otherwise correct solutions, thus requiring students to read and repair generated outputs. We analyzed 2,636 sessions from 917 students, and examined behavior across instances of naturally occurring prompt-related failures and deliberately injected bugs within each session. Our findings show that students responded differently across bug sources. Deliberately injected bugs more often led to direct code edits and higher next-attempt success, suggesting localized repair of near-miss solutions. Prompt-related failures instead more often led students to refine prompts by clarifying constraints, updating function signatures, adding edge cases, or reframing the task. Student reflections reinforce the emphasis on review and repair, describing useful practice in code understanding, code review, and debugging, as well as a more careful verification mindset and greater awareness of GenAI limitations. Ultimately, prompt-related failures and injected bugs together support a pedagogically useful GenAI workflow, where students practice both specification refinement through prompts and debugging through code editing.  \nICER 2026 Vol. 1, Uppsala, Sweden  \n© 2026 Copyright held by the owner/author(s) .  \nThis is the author’s version of the work. It is posted here for your personal use. Not for redistribution. The definitive Version of Record was published in Proceedings of the ACM Conference on International Computing Education Research Vol.1 (ICER 2026 Vol. 1), August 11–14, 2026, Uppsala, Sweden, [https://doi.org/10.1145/3765964.3811667](https://doi.org/10.1145/3765964.3811667) .  \nCCS Concepts  \n• Social and professional topics → Computing education; • Computing methodologies → Artificial intelligence.  \nKeywords  \nnatural language programming, code-generating AI, bug injection, debugging  \nACM Reference Format:  \nVictor-Alexandru Pădurean, Kaitlin Riegel, Alkis Gotovos, Jyotika Mahapatra, Ahana Ghosh, Paul Denny, Juho Leinonen, James Prather, and Adish Singla. 2026. When AI Is Wrong on Purpose: How Students Respond to Buggy GenAI Code. In Proceedings of the ACM Conference on International Computing Education Research Vol.1 (ICER 2026 Vol. 1), August 11–14, 2026, Uppsala, Sweden. ACM, New York, NY,","cbCaivTcmM2xTSIx","https://ap.wps.com/l/cbCaivTcmM2xTSIx","pdf",1403181,1,17,"English","en",105,"# Abstract\n# Introduction\n## Context: GenAI in development and CS education\n## Problem: incorrect, variable, and insecure code outputs\n## Requirement: specification, code review, testing, and debugging\n## Emerging workflows: GenAI-supported code review and prompt refinement\n## Study motivation: prompt-centered activities with injected bugs","[{\"question\":\"Why can students struggle to inspect GenAI-generated code in CS1-level assignments?\",\"answer\":\"GenAI often produces correct solutions on well-scoped tasks, which can lower students’ incentive to closely inspect outputs. This makes subtle faults easier to miss.\"},{\"question\":\"What approach does the study propose to encourage reading and repairing generated code?\",\"answer\":\"The study injects realistic, runnable bugs into otherwise correct solutions. This forces students to read the output and fix near-miss implementations.\"},{\"question\":\"How did student responses differ between naturally occurring prompt failures and deliberately injected bugs?\",\"answer\":\"Deliberately injected bugs more often led to direct code edits and higher next-attempt success, suggesting localized repair. Prompt-related failures more often caused students to refine prompts by clarifying constraints, updating function signatures, adding edge cases, or reframing the task.\"}]",1784183771,43,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"when-ai-is-wrong-on-purpose-how-students-respond-to-buggy-genai-code","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/when-ai-is-wrong-on-purpose-how-students-respond-to-buggy-genai-code/82896/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-24","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"Why can students struggle to inspect GenAI-generated code in CS1-level assignments?","Question",{"text":75,"@type":76},"GenAI often produces correct solutions on well-scoped tasks, which can lower students’ incentive to closely inspect outputs. This makes subtle faults easier to miss.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What approach does the study propose to encourage reading and repairing generated code?",{"text":80,"@type":76},"The study injects realistic, runnable bugs into otherwise correct solutions. This forces students to read the output and fix near-miss implementations.",{"name":82,"@type":73,"acceptedAnswer":83},"How did student responses differ between naturally occurring prompt failures and deliberately injected bugs?",{"text":84,"@type":76},"Deliberately injected bugs more often led to direct code edits and higher next-attempt success, suggesting localized repair. Prompt-related failures more often caused students to refine prompts by clarifying constraints, updating function signatures, adding edge cases, or reframing the task.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":45,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":45,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]