Objective

Many universities now let computer science students use AI coding assistants, yet little is known about how working with an AI partner compares with working with a classmate or working alone. Programming courses often struggle with low motivation and high anxiety, and pair programming (two people sharing one task, one writing code and the other reviewing) is a common way to help.

This study tested AI-assisted pair programming, where a student treats a large language model chatbot as the second person in the pair. The researchers compared it with human pair programming and with individual programming.

They asked four main questions:

  • Does the approach change students' intrinsic motivation (doing something because it is interesting), programming anxiety and programming performance?
  • Does it change how students see collaboration and social presence (the feeling of working with another person)?
  • Can an AI partner make up for social benefits that human partners give?
  • Do two different AI models, GPT-3.5 Turbo and Claude 3 Opus, lead to different results?

Methods

This was a quasi-experiment (a study that compares groups without assigning individual students at random) at Taiyuan University of Science and Technology in China. It ran across two academic years, 2023 and 2024, in a Java web application development course.

Who took part

The sample came from six intact class sections, three each year, chosen by convenience and by instructors' willingness. Whole classes were randomly assigned to one of three conditions using a random number generator. Of 250 students at the start, 16 were removed from the analysis because they had more than 12 months of Java experience or had finished advanced programming courses, leaving 234. The groups did not differ at the start in age, gender, Java experience or baseline motivation and anxiety.

The three conditions

  • Group A: AI-assisted pair programming, with GPT-3.5 Turbo in 2023 and Claude 3 Opus in 2024. These students got extra training on working with the AI.
  • Group B: human pair programming.
  • Group C: individual programming, the control group.

Sessions took place in supervised computer labs, with an honor code and reviews of activity logs to limit outside tool use.

What was measured

Surveys were given at the start, middle and end of the semester: the Intrinsic Motivation Inventory, a Programming Anxiety Scale, collaborative learning and social presence scales, and an AI-adapted Technology Acceptance Model survey (perceived usefulness and ease of use). Performance came from assignment grades, code quality ratings by two raters, and error rates from automated checks. Data were analyzed with repeated-measures ANOVA (a test of change over time across groups) and mediation analysis. An ethics board approved the study and students gave consent.

Key Findings

Both AI-assisted groups ended the semester with higher motivation, lower anxiety and higher scores than the individual group, while human pairs reported the strongest collaboration.

Motivation, anxiety and performance

  • Motivation: by the end, the combined AI-assisted groups averaged 5.532 on a 7-point scale, against 5.423 for human pairs and 5.237 for individuals. Both AI groups rose significantly more than the individual group (the paper reports a small effect, d = 0.35).
  • Anxiety: the AI-assisted groups averaged 2.355 at the end, against 2.643 for human pairs and 2.756 for individuals. Both AI groups dropped significantly more than the individual group.
  • Performance: end-of-semester scores out of 100 averaged 83.901 for AI-assisted students, 80.123 for human pairs and 75.789 for individuals. Both AI groups and the human pairs significantly beat the individual group.

On performance against human pairs, the paper is not consistent. The abstract says AI groups outperformed human pairs, and a later comparison reports a small but significant edge for AI (p = 0.015). Another passage says the difference was slight and not statistically significant.

Motivation, anxiety and scores went together

  • At the end of the semester, higher motivation went along with higher performance (r = 0.523), and higher anxiety went along with lower performance (r = -0.487). These are links, not proof that one caused the other.

Collaboration and perceived usefulness

  • On the collaborative learning scale, human pairs scored significantly higher than both AI groups, which in turn scored significantly higher than the individual group.
  • On the social presence scale, human pairs scored higher than every other group, and both AI groups scored higher than the individual group.
  • Human pairing produced the highest perceptions of collaboration and social presence. AI-assisted students rated collaboration higher than individual students but below human pairs.
  • Mediation analysis found that how useful students thought the AI assistant was helped explain the link between the pairing approach and outcomes.

Comparing the two AI models

  • No significant differences were found between GPT-3.5 Turbo and Claude 3 Opus on motivation, anxiety, collaboration or performance. The largest gap was in anxiety, with Claude 3 Opus users reporting slightly lower anxiety, but it was not significant (p = 0.149).

Implications

The authors suggest that AI-assisted pair programming can complement ordinary teaching, especially for students who struggle with anxiety or motivation, and should not replace human interaction.

For instructors

  • The authors recommend introducing AI assistants gradually, discussing the role and limits of AI in programming, and asking students about their experience from time to time.
  • Because students who found the AI useful did better, the authors say teachers should help build positive but realistic views of the tool.
  • They advise keeping human collaboration in the mix so students keep developing teamwork skills.

For institutions and policymakers

  • The authors suggest planning training for instructors and support staff, clear rules for AI use, fair access to tools, and attention to academic integrity and data privacy.

For students

  • The authors say AI tools can offer immediate feedback without social judgment, which may help some learners try things and make mistakes. The study suggests that an AI partner may feel less stressful than working alone, but students still need to practice working with real teammates.

Our reading (not the authors' recommendation):

  • Because both AI models gave similar results, schools may not need to wait for the newest model to try this approach.
  • Instructors could track students' motivation and anxiety during the term, using short surveys like those in this study, to see whether an AI partner helps their own class.
  • Because the study lasted one semester in one course, advice about replacing human pairs would be premature.

Limitations

The authors note that the quasi-experimental design may leave unmeasured factors that affect results, that the sample comes from one university so it may not apply to other levels or cultures, and that self-reported measures can be biased. Their programming measures may also miss parts of programming skill. The AI models used were later replaced by newer systems.

The authors also say students may have used unapproved tools outside class, despite supervised labs and an honor code.

The paper does not mention, but whole classes rather than individual students were assigned to conditions, and only six classes were involved, so differences between classes could affect results.

The paper does not mention, but the Group A students received extra training on using the AI, so the effect of the training cannot be separated from the effect of the AI itself.

The paper does not mention, but the abstract and the results text disagree on whether AI-assisted students significantly outperformed human pairs, so that comparison should be read with caution.

Future Directions

The authors suggest several next steps.

  • Randomized controlled trials, to give stronger evidence about cause and effect.
  • Studies with other kinds of students and in other settings and cultures.
  • More varied ways of judging programming skill, including qualitative reviews of student code and measures of how much students remember over time.
  • Tests of newer AI systems as they appear.
  • Research on how students' perceptions of AI assistants shape their outcomes.
  • Teaching approaches that keep the benefits of AI while protecting deeper thinking and problem-solving, since over-reliance could weaken those skills.

Another open question the study raises is whether the gains last once the AI is no longer available, and whether students who rely on quick AI answers still build the habit of working through hard problems on their own.

The bottom line: In this study of 234 Chinese undergraduates, working with an AI chatbot as a coding partner went along with higher motivation, lower anxiety and higher scores than coding alone, and similar results across two AI models. Students working with a human partner still felt more collaborative. The evidence is moderate because classes, not students, were assigned to conditions, and the study covered one course at one university. Educators can reasonably try AI partners alongside human collaboration, and should keep a close eye on over-reliance.