Objective

Learning to program means learning to write code, but also learning to trace it. Code tracing means stepping through a program one line at a time, keeping track of how each variable changes, to predict what the program will output or to find bugs. Many beginners find this hard. The authors saw this in their own first-year programming class, where all students in the cognitive science department take Python, including many who are not computer science majors. Very little technology exists to help students practice tracing.

The researchers built a prototype called the CT-Tutor (Code Tracing Tutor). It is not yet an intelligent tutor, because it does not model each student or personalize help beyond telling them if an answer is right. It offers two kinds of help: interface scaffolding (a guided table that tells students which variables to track and checks each entry) and worked examples (a fully solved trace of a similar program). The team varied both to see which level of help works best.

They asked these questions:

  • Does a highly guided interface lead to more learning than a less guided one? They expected yes.
  • Does it matter whether students see an example before or after they try the problem? They had no firm prediction.
  • How do the two kinds of help affect behavior in the tutor, such as problems finished, attempts and time?

Methods

This was a between-subjects experiment: each student used only one version of the tutor, and the groups were compared. Participants were assigned in a round-robin way (taking turns), not by random draw, so it is a controlled comparison rather than a fully randomized trial.

Who took part: 97 undergraduates (67 female) in a first-year cognitive science class at a medium-sized Canadian university. Anyone who had taken a university computer science course was excluded. They received 2% bonus course credit. The university ethics board approved the study.

The four conditions crossed two factors:

  • Interface scaffolding: high (a locked table where each row had to be correct before moving on, feedback on every entry, and a prompt to explain the code in plain English) or reduced (only an open-ended text box and feedback on the final answer).
  • Instructional order: example first, or problem first (example shown after the problem).

This gave three levels of overall help: low (reduced scaffolding, problem first), intermediate (reduced scaffolding with example first, or high scaffolding with problem first) and high (high scaffolding with example first).

Procedure: each session lasted no more than 2 hr. Students answered an online survey (10 min), studied an 11-slide Python lesson with two short videos (20 min), took a paper pre-test (15 min), worked 40 min in the tutor on four short Python while-loop problems and four matching examples, then took a post-test. The pre-test came after the lesson, and the post-test had the same questions with changed variable names and values. The test had a code-tracing part scored out of 10 and an explanation part scored out of 4.

Analysis: learning was the gain from pre-test to post-test. Behavior in the tutor came from log files. The team ran two-way ANOVAs (a standard test comparing groups on two factors), repeated them for the 74 students who gained, and then used k-means clustering (a method that groups students by similar behavior) on log data.

Key Findings

Overall, students learned from the tutor, but more help did not simply mean more learning. The results differed depending on whether all students or only those who gained were analyzed.

All 97 students

  • Students improved significantly from pre-test to post-test overall.
  • Contrary to the team's prediction, the high-scaffolding version was linked to marginally less learning than the reduced version (a difference that was close to, but not quite, statistically significant).
  • Instructional order made no clear difference to learning.
  • Explanation scores also rose overall, with no significant effect of scaffolding or order. Gains in tracing and in explanation were only weakly related.

Behavior in the tutor

  • The high-scaffolding group needed significantly fewer attempts per entry. It also finished somewhat more problems, but that difference was not significant.
  • High scaffolding did not save time. That group spent longer on correct and incorrect entries.
  • The example-first group spent much more time on each example and less time on each problem, and needed fewer attempts. It finished more problems, but not significantly more.
  • The reduced-scaffolding group spent more time on examples, which may hint at more self-explanation, though the paper has no direct evidence of that.
  • In the open-ended box, reduced-scaffolding students sketched their own traces, while high-scaffolding students mostly wrote explanations. Quality varied a lot in both groups.

Students who gained (74) versus those who did not (23)

  • There were twice as many non-gainers in the high-scaffolding conditions (15) as in the reduced ones (8).
  • Among the 74 gainers, scaffolding and order interacted. With reduced scaffolding, learning was higher with example first. With high scaffolding, learning was higher with problem first. Learning was therefore highest with one type of help and lower with both or neither.
  • The reduced-scaffolding example-first group studied examples longest and had the highest gains.

Four behavior clusters (89 students)

  • Struggling unproductively: finished the fewest problems, spent long on entries and examples, and had the lowest gains. Members came evenly from all conditions.
  • Productive: finished the most problems, were fastest and had the highest pre-test scores (about 50%).
  • Productively struggling: needed about twice as many attempts but had the highest gains. This cluster held five times as many low-assistance students as each other condition.
  • Dedicated problem solvers: spent more time per entry, had gains close to the productive group, and did poorly on explanations.

The average post-test score was about 55%, so many students still found tracing hard.

Implications

What the authors conclude: novices seem to need a middle level of help when learning to code trace, neither too much nor too little. The authors also argue that the gap between the all-student result and the gainer result points toward personalized assistance, since some students do fine with little help and others do not.

Instructors

  • If you give worked examples, consider not stacking every other kind of help on top. In this study, the strictly guided table plus an example first was not the best mix for students who gained.
  • Students may need encouragement to study examples closely. Average reading time was under two minutes, and the authors suggest prompting self-explanation.
  • Open-ended tracing space can work for some students, but quality varied, so feedback on it would likely help (the authors' idea, not tested here).

Tutor designers

  • The authors suggest ideas to try: self-explanation prompts, fading guidance over time, adaptive sequencing of problems and examples, and automatic feedback on typed traces. None of these were tested in this study.
  • Watch for shallow behavior such as guessing and checking when feedback is immediate. The authors speculate that guidance may have invited this among students who did not gain.

Students

  • Struggling is not always a bad sign. The productively struggling cluster made many attempts but had the highest gains. This is a sensible reading of the data, not a tested recommendation.

Given the modest sample and one short session, these are early design hints rather than firm rules for classrooms.

Limitations

The authors say the sample was relatively modest, so replication is needed. They also say the tutor does not personalize help, and the lesson was a short slide deck rather than a full course. In a real class, ongoing contact with instructors and teaching assistants might change how the tutor works.

Other weaknesses to keep in mind:

  • The paper notes that the logger missed the time students spent writing explanations in the high-scaffolding conditions, so timing results for those groups need caution.
  • The high-scaffolding version had more entry boxes, so attempts and times are not perfectly comparable, even after adjusting for this.
  • The main learning result was only marginally significant, and the interaction appeared only after removing students who did not gain. Splitting a sample after the fact can produce patterns that may not hold up again.
  • The reasons given for the results, such as too much help reducing active thinking, are the authors' explanations. The paper has no direct evidence, for example, of self-explanation.
  • Clustering was done after the fact, with missing data filled in using averages and 6 students removed as outliers. The cluster labels are descriptive guesses.
  • The paper does not mention, but all students came from one course at one university, and the pre-test was taken after the lesson, so it is not a measure of what they knew at the start.
  • The paper does not mention, but only short-term learning was measured. There was no delayed test to show whether gains lasted.

Future Directions

The authors describe this as the first phase of a longer project. They plan to add intelligent, personalized support and to use the tutor in their own programming class. Open questions they raise include:

  • Can self-explanation prompts, during problems or while studying examples, make students more active learners? The authors are planning a talk-aloud study to see what such prompts should look like.
  • Does fading the scaffolding, starting with high guidance and reducing it, work better than a fixed level?
  • Can natural language processing give feedback on the open-ended traces and plain-English explanations students type?
  • Would examples with errors that students must find and fix get students to engage more?
  • Would adapting the order of problems and examples to each student beat a fixed order? The authors say that if a student has seen an example, a highly guided problem may not be a good next step.
  • How does the tutor perform in a real classroom with instructors present?

The authors say it is an open question how much these additions will help, and describe themselves as cautiously optimistic.

The bottom line: In one short session with 97 first-year students, a code-tracing tutor was linked to learning gains, but the most guided version was not the best. Among students who gained, learning was highest when the tutor offered one kind of help, not both and not neither. Students who did not gain were more common with the high-guidance version. The evidence is early, from a modest sample at one university, and the explanations are partly speculative. If you design or choose practice tools for beginners, consider balancing help with room for students to think, and expect that different students need different amounts.