Objective

Learning to program is hard. It asks students to think in steps, solve problems and test their work. Many students now turn to ChatGPT, which can write code and explain it. The risk is that students copy an answer without understanding it. Instructors at the authors' university told them this was already happening. In a short set of interviews with seven faculty members, 91% said many students used ChatGPT to complete programming assignments, and all agreed that a structured approach was needed.

The authors set out to build and test such an approach. They created the R5E pattern, six teaching steps named Recognition, Exploration, Engagement, Execution, Evaluation and Editing. The idea is that students use ChatGPT to look up concepts, find information and check errors, while the thinking, discussion and decisions stay with students, peers and the teacher.

The study asked two questions:

  • How can the R5E pattern be used to bring ChatGPT into programming lessons?
  • How do R5E and unstructured ChatGPT use compare in building programming skills among university students?

Methods

The authors ran a quasi-experiment, a study that compares groups given different teaching but cannot control every other difference. This kind of study can suggest that one approach works better, but it cannot rule out all other explanations.

The participants were 70 male students aged 19 to 21 in the second level of an Information Technology program at a college in Saudi Arabia. They were chosen at random from a larger group of 102 learners and then randomly split into two groups of 35. All had finished a first-level programming course. The paper does not name the university, and the study was limited to men because the college teaches men and women separately.

The course was Programming and Applications in C++, a programming language. It ran 12 weeks: one week of ChatGPT training for both groups, ten weeks of teaching and one week of testing. Each week had two hours of lectures, taught to both groups together by the same instructor, and two hours of lab practice. In the lab, both groups received the same tasks, but at different times, with an instructor trained for each group.

  • The R5E group followed the six steps. For example, they discussed flowcharts with peers, wrote code, ran it, searched for errors with ChatGPT, and fixed them under teacher supervision.
  • The comparison group had unrestricted ChatGPT use with no guidance.

Two tools measured skills before and after. The Programming Skills Cognitive Test was a 20-question multiple-choice test. The Performance Observation Card scored 60 points for how well students did practical tasks, based on screen recordings reviewed by the instructor. Test-retest reliability was 0.89 for the test, and observers agreed on 91.7% of the card ratings on average. Scores were compared using t-tests and a repeated-measures ANOVA, and the researchers also noted behaviors they saw during the lessons. Students took part voluntarily.

Key Findings

Both groups improved a great deal over the course, but the R5E group improved further on both measures.

Starting point

  • Before the course, the groups did not differ significantly on either measure. On the knowledge test, the R5E group averaged 1.71 and the comparison group 1.74 (out of 20). On the practical card, they averaged 7.53 and 7.39 (out of 60).

After the course

  • Knowledge test: the R5E group averaged 18.06, and the comparison group averaged 9.23.
  • Practical card: the R5E group averaged 54.68, and the comparison group averaged 27.47.
  • The differences between groups after the course were statistically significant on both measures. The authors also report that the size of improvement differed between the groups, with the R5E group improving further.
  • Within each group, the before-and-after gains were also significant, so unstructured ChatGPT use was linked to progress too.
  • In plain terms, the R5E group finished close to the top of both scales, with about 18 of 20 on the test and about 55 of 60 on the practical card. The comparison group ended around the middle, with about 9 of 20 and about 27 of 60.
  • Statistical tests that compared the change over time for the two groups together showed a significant interaction, meaning the amount of improvement depended on which group a student was in.

Knowledge and practice went together

  • Scores on the knowledge test and the practical card were strongly related (correlation of 0.962). Students who knew more also performed better in practice.

What the authors saw in class

  • R5E students discussed ideas with peers when planning flowcharts, asked more complex questions about the programs, and looked for several ways to write the code.
  • Comparison students asked ChatGPT directly for flowcharts and exact code, finished writing code faster, and relied only on ChatGPT to check programs. The authors report that their programs showed greater errors when run.
  • R5E students asked the instructor after peer talk and before turning to ChatGPT.

The paper gives no exact counts for how often each behavior happened. These classroom observations were descriptions by the researchers, with no counts given.

Implications

The authors argue that how ChatGPT is used in class matters, and that a structure which keeps teachers and peers involved is better than leaving students alone with the tool. They call R5E a model other teachers could copy, and they recommend that universities plan how to bring AI into teaching and support it with professional development for instructors.

For programming teachers

The six steps give a concrete outline: check what students already know, have them explore the problem and plan a flowchart, share and discuss the plan, write and run the code, look for errors, then fix them. In this design, ChatGPT helped with how to build a program, rather than handing over a finished one.

Our reading (not the authors' recommendation):

  • Teachers could try the pattern on one topic first and compare student work with a similar group before changing a whole course.
  • The extra peer talk and teacher check-ins may be part of why the R5E group did better, so a teacher could keep those even without the exact six steps.
  • The gap between groups is large, and the comparison group scored well below the maximum, so a school might worry less about banning the tool and more about how students are guided.

The authors say the findings may apply to other subjects, but the study tested only C++ programming, so that is a hope rather than a result.

Limitations

The authors name several limits. The post-test came right after the course, so students may have been recalling what they just learned, and there was no delayed test to see what lasted. The sample was small, with 35 students per group, and all were men from one college, so the findings may not apply to women or other universities. The authors say a longer study and a larger, more varied sample are needed.

The paper does not mention, but these points also matter. A different instructor, trained for each approach, led each lab group, so the teaching style of that person could be mixed into the difference. The card scores were based on an instructor reviewing recordings, and the paper does not say whether the reviewer knew which group a student was in. The comparison group was told to use ChatGPT freely with no guidance, so the study does not compare R5E with teaching that has no ChatGPT, or with other ways of guiding AI use. The jump from very low pre-test scores to very high post-test scores in the R5E group is large, and the paper does not discuss whether the tests were matched in difficulty. Finally, the paper presents the pattern as proven and replicable in its conclusion, which is stronger than one small study can show.

Future Directions

The authors recommend several next steps:

  • Repeat the study with a larger and more varied sample, including female students.
  • Run longer studies, with a delayed test to see how much students remember and keep later.
  • Test R5E in other subjects and settings to see whether it works beyond C++ programming.
  • Use mixed-methods designs to study long-term effects on learning, knowledge retention and the ability to use skills in new situations.
  • Look at how individual learner characteristics interact with AI-driven teaching, to refine adaptive learning approaches.

The authors also call for a plan to expand AI use in university teaching in ways that keep the human role in learning. Questions the study leaves open include which of the six steps does the most work, and whether structured use of ChatGPT beats lessons that do not use it at all.

The bottom line: In this 12-week study of 70 male programming students, those guided through the six-step R5E pattern scored higher on a knowledge test and a hands-on task than those using ChatGPT without guidance, and both groups improved. The result is encouraging, but the sample was small and all male, the test came right after the course, and different instructors led each group. Teachers can take from it the idea that structure, discussion and checking work matter when students use AI, while keeping in mind that the pattern has been tested only once, in one course.