Objective
Learning to program is hard, and many beginners struggle. Generative AI (GenAI) tools such as ChatGPT can explain code, write examples and give feedback, so they may help novices. But earlier studies disagree. Some found that students who used GenAI wrote better programs, while another found students finished faster without learning more. Few studies have also looked at how students actually behave while working with GenAI.
This study looked at four questions:
- What are the effects of GenAI on the quality of students' programs and on their ability to apply knowledge later (knowledge transfer)?
- How does GenAI support affect students' programming self-efficacy (their belief that they can do programming tasks)?
- How does GenAI change what students do while they program?
- Which behavior patterns among GenAI users go with higher or lower performance?
The authors link their work to the idea of hybrid intelligence, in which people and AI complement each other, and to concerns about cognitive offloading (handing the thinking to a tool).
Methods
This was a quasi-experiment, a study that compares two groups but does not assign students by lottery. It can show differences between groups, but other factors may still explain them.
The 55 participants were undergraduate Physics Education students at a public university in China (26 male, 29 female, average age 21). All had finished a basic Python course, but none had used the Python Turtle library (a drawing tool for beginners). Based on a Python knowledge test, they were placed into two groups with similar skill: 27 in the experimental group and 28 in the control group. The groups did not differ meaningfully in age, gender or programming self-efficacy before the study. Students were told they could withdraw at any time, and the institution approved the project.
Both groups received the same task sheet: learn the Turtle library, make a mind map of it, and complete five programming exercises. They worked in computer labs for 120 minutes. The experimental group could use only ChatGPT (a simple platform running the GPT-3.5-turbo model) and received a short user guide. The control group could use other internet resources. After this, all students took a self-efficacy questionnaire and then completed two harder programming tasks in 40 minutes without any outside resources.
Two raters scored programs from 0 to 4 on six criteria, such as syntax, logic, completeness, algorithm design, code structure and code style. Self-efficacy was measured with a 5-point scale. A recording script captured screenshots, keystrokes and mouse actions, which the authors coded into behaviors and analyzed with statistics and process mining (a way of mapping the order of actions). Within the experimental group, students were clustered into two behavior patterns, of 13 and 14 students.
Key Findings
With ChatGPT, students did better on the practice programs and reported more confidence, but the advantage did not carry over to the no-help test overall. The authors link this to how students used the tool.
Program quality
- On the practice programs, the ChatGPT group had a median score of 22.3, compared with 18.75 for the control group, a statistically significant difference. The gains were in algorithm design, code structure and code style.
- On the later test, where no internet was allowed, the groups' overall scores did not differ significantly (p = 0.538), although the ChatGPT group's average was a little higher (17.796 vs 17.580).
- On individual test criteria, the ChatGPT group scored lower on logical correctness (p = .025) and completeness (p = .020), and higher only on code style.
- In plain terms, ChatGPT users wrote programs that were cleaner and better organized when they had the tool, but when it was taken away, they were less able to get the logic right and finish the whole task than the control group.
Self-efficacy
- The groups were alike before the study.
- Afterward the ChatGPT group scored higher on self-regulation (3.61 vs 3.34, p = .008) and on complex programming tasks (3.39 vs 2.81, p = .014).
- They did not differ on independence and persistence (3.99 vs 3.80, p = .266).
- These are self-ratings on a 5-point scale, so they show how capable students felt, not how well they performed.
What students did
- The control group did more independent coding (average 11.00 times against 4.44) and more content revising (19.54 vs 10.67).
- The ChatGPT group copied more code (12.63 vs 6.29) and searched for information more often.
- The ChatGPT group's map of activity had 11 types of behavior and the control group's had 13, and independent coding did not appear in the ChatGPT group's map.
- Process maps showed the ChatGPT group often moved from reading AI content to copying it, then running it.
High and low performers in the ChatGPT group
- Type 2 students (14) had a higher average post-test score (19.34) than Type 1 students (13, average 16.13), a significant difference (p = 0.039). The learning-gain difference was not significant.
- Lower performers tended to copy AI code whole. Higher performers asked follow-up questions, thought for themselves afterward, gave feedback on the AI's answers and applied the code selectively.
Implications
The authors present these results as guidance for teaching programming with GenAI.
For instructors
- The authors say ChatGPT can raise programming self-efficacy and practice-task quality when built into self-study activities.
- They warn that students need to be ready to solve problems without outside help, since the practice advantage did not carry over to the test overall.
- They recommend structured guidance, scaffolding and activities that push students to question and critique AI output, not copy it.
For students
- The study suggests that how you use the tool matters. The students who asked follow-up questions and checked the code themselves did better than those who pasted it in. This reading comes from the behavior data, not from advice the authors gave directly to students.
For institutions
- The authors suggest developing guidelines for balanced GenAI use that keep the learning benefits while protecting problem-solving skills.
For researchers and developers
- The behavior patterns of the stronger group, such as repeated questioning and independent thinking after each AI answer, could inform tool designs and prompts, for example features that nudge students to ask a follow-up or explain the code before moving on. The authors do not describe such features.
Our reading (not the authors' recommendation):
- Teachers could ask students to explain or change AI-written code before they use it, and then schedule a short task with no AI to check what they learned.
- Because the study was small and short, these suggestions are a sensible reading, and not firm proof of what works.
Limitations
The authors say the sample size and the short experiment limit how widely the findings apply and tell us little about long-term effects. The study covered only programming, and only Chinese students, so other subjects and countries are untested.
The paper does not mention, but students were put into groups by a skill test and not by random assignment, so unmeasured differences between the groups could still affect results.
The paper does not mention, but the study was one session of 120 minutes plus a 40-minute test, so it cannot show how skills would develop over a full course. The control group could use any internet resources, so what the comparison measures is ChatGPT against a mix of other sources, not against no help.
The paper does not mention, but the self-efficacy tables list 27 control students although the group is described as 28, and the post-test means for the two behavior groups differ between the text and the table (19.50 and 15.96 in the text, 19.34 and 16.13 in the table). Readers should treat the exact values with some care.
The paper does not mention, but with 13 and 14 students in the two behavior clusters, those comparisons rest on very few people.
Future Directions
The authors suggest two directions for later work. First, similar studies in other cultures and countries could check whether the results hold. They also note that the study focused on programming, and that future work could extend to other fields. Second, with GenAI becoming part of higher education, researchers should look at how to build it into teaching, including roles such as learning companion or teaching assistant, and develop strategies and tools that strengthen students' cognitive agency and reduce over-reliance.
The study also leaves some questions open:
- Would longer courses show the same split between practice gains and test results?
- Do prompts or guidance that push students to question AI output change the behavior patterns the study linked to lower performance?
- How would results differ when the comparison group has no internet help at all?
The bottom line: In this small study of 55 undergraduates, using ChatGPT for self-study went with better practice programs and higher confidence on two measures, but overall test scores without help were not significantly different, and logic and completeness were lower in the ChatGPT group. Students who copied AI code tended to do worse than those who questioned it and thought for themselves. The evidence is limited by the small, short, single-country design, so teachers should treat it as a caution: pair AI use with tasks that make students do the thinking.
Comments 0
No comments yet. Be the first to share a thought.
Get new research summaries by email
Every new summary each morning, a weekly digest, or a monthly report. You choose, and you can unsubscribe in one click.