{"id":86622,"date":"2024-03-25T14:25:56","date_gmt":"2024-03-25T14:25:56","guid":{"rendered":"https:\/\/www.raspberrypi.org\/?p=86622"},"modified":"2024-03-25T14:25:56","modified_gmt":"2024-03-25T14:25:56","slug":"using-an-ai-code-generator-with-school-age-beginner-programmers","status":"publish","type":"post","link":"https:\/\/www.raspberrypi.org\/blog\/using-an-ai-code-generator-with-school-age-beginner-programmers\/","title":{"rendered":"Using an AI code generator with school-age beginner programmers"},"content":{"rendered":"\n
AI models for general-purpose programming, such as OpenAI Codex<\/a>, which powers the AI pair programming tool GitHub Copilot<\/a>, have the potential to significantly impact how we teach and learn programming. <\/p>\n\n\n The basis of these tools is a ‘natural language to code’ approach, also called natural language programming. This allows users to generate code using a simple text-based prompt, such as \u201cWrite a simple Python script for a number guessing game\u201d. Programming-specific AI models are trained on vast quantities of text data, including GitHub repositories, to enable users to quickly solve coding problems using natural language. <\/p>\n\n\n\n As a computing educator, you might ask what the potential is for using these tools in your classroom. In our latest research seminar, Majeed Kazemitabaar (University of Toronto) shared his work in developing AI-assisted coding tools to support students during Python programming tasks.<\/p>\n\n\n\n Majeed argued that natural language programming can enable students to focus on the problem-solving aspects of computing, and support them in fixing and debugging their code. However, he cautioned that students might become overdependent on the use of \u2018AI assistants\u2019 and that they might not understand what code is being outputted. Nonetheless, Majeed and colleagues were interested in exploring the impact of these code generators on students who are starting to learn programming.<\/p>\n\n\n\n In one study<\/a>, the team Majeed works in investigated whether students\u2019 task and learning performance was affected by an AI code generator. They split 69 students (aged 10\u201317) into two groups: one group used a code generator in an environment, Coding Steps<\/a>, that enabled log data to be captured, and the other group did not use the code generator.<\/p>\n\n\n Learners who used the code generator completed significantly more authoring tasks \u2014 where students manually write all of the code \u2014 and spent less time completing them, as well as generating significantly more correct solutions. In multiple choice questions and modifying tasks \u2014 where students were asked to modify a working program \u2014 students performed similarly whether they had access to the code generator or not.\u00a0<\/p>\n\n\n\n A test was administered a week later to check the groups’ performance, and both groups did similarly well. However, the \u2018code generator\u2019 group made significantly more errors in authoring tasks where no starter code was given. <\/p>\n\n\n\n Majeed\u2019s team concluded that using the code generator significantly increased the completion rate of tasks and student performance (i.e. correctness) when authoring code, and that using code generators did not lead to decreased performance when manually modifying code. <\/p>\n\n\n\n Finally, students in the code generator group reported feeling less stressed and more eager to continue programming at the end of the study.<\/p>\n\n\n\n
<\/figure>\n<\/div>\n\n\nUsing AI code generators to support novice programmers<\/strong><\/h2>\n\n\n\n
<\/figure>\n<\/div>\n\n\nUnderstanding how novices use AI code generators<\/strong><\/h2>\n\n\n\n