Automatic Diagnosis of Student Programs in Programming Learning Environments

Songwen Xu, Yam San CheeIJCAI 1999

In computer science education, providing timely and accurate feedback on student code is a significant challenge. While human tutors can identify logic errors or variable misuse, automating this process at scale is difficult due to the infinite variety of ways to write a correct program. In their research, Songwen Xu and Yam San Chee introduce SIPLeS-II, a system designed to bridge this gap by moving beyond simple text matching to semantic graph analysis.

The Challenge of Program Variation

The primary obstacle in automated grading is variation. Students often use different variable names, reorder independent statements, or choose different control structures (like while vs. for loops) to achieve the same result. Traditional autograders typically rely on test cases—matching inputs to outputs—which can confirm that a program is incorrect but fail to explain why.

Figure 2: A student program (SEntry) compared to a model program, highlighting six types of superficial differences that complicate automated diagnosis.

To provide meaningful pedagogical feedback, a system must perform program diagnosis. This requires identifying the exact location and nature of an error despite these variations. Xu and Chee’s framework aims to be "safe" (never labeling an incorrect program as correct) and "rigorous" (pinpointing specific logical flaws).

Methodology: The SIPLeS-II Pipeline

The SIPLeS-II system employs a multi-stage pipeline to abstract code into its logical essence, stripping away superficial differences.

Figure 3: The multi-stage process for standardizing and comparing student programs (SP) and model programs (MP).

The process begins by converting both the student program and a "model" program (the gold standard) into Abstract Syntax Trees (ASTs). Basic transformations are applied to eliminate "noise," such as standardizing algebraic expressions. The core of the system is the conversion of these programs into Augmented Object-oriented Program Dependence Graphs (AOPDGs). Unlike raw code, AOPDGs represent the actual flow of data and control. If two pieces of code perform the same logic in a different order, their AOPDGs will often be identical.

Advanced transformations, including dead code removal and forward substitution, further simplify the student's logic. Finally, a partitioning algorithm compares the student’s graph against the model’s graph. If a statement in the student's code cannot be mapped to the model, the system identifies the most similar model statement to generate a diagnostic report.

Evaluation and Key Insights

The system was evaluated using approximately 330 student programs written in Smalltalk, covering tasks such as calculating taxi fares (TaxiFee), identifying perfect numbers, and defining object-oriented classes.

The authors identified 12 types of "semantics-preserving variations" (SPVs). SIPLeS-II is designed to neutralize 11 of these through its graph-based representation. The only variation it cannot automatically handle is a fundamentally different algorithm (e.g., recursion vs. iteration). However, the system is designed to "learn": once a teacher adds a model for a new algorithm, the system can handle all future students using that approach.

Results and Performance

The results of the SIPLeS-II evaluation were highly promising:

  • 100% Accuracy: Once the system was provided with a few model programs (typically 3 to 5) for each task, the rate of correct program and statement diagnosis reached 100%.
  • Efficiency of Scale: Data indicated that after processing just 25 student programs for a specific task, the probability of the system failing to diagnose a new student due to a missing model algorithm dropped below 10%.
  • Granular Feedback: Instead of a simple pass/fail, the system produced detailed reports identifying specific incorrect expressions and suggesting correct logic.

Conclusion and Future Directions

SIPLeS-II demonstrates that semantic graph analysis can effectively automate the diagnosis of student programs. While the current implementation is focused on Smalltalk, the underlying AOPDG approach is theoretically applicable to other languages like C++ or Java. Future work may involve refining the graph model for more complex language features and applying these techniques to broader fields such as automated software maintenance and program understanding. By providing rigorous, automated feedback, such systems can significantly enhance the efficiency of programming learning environments.

Summary updated

BibTeX
@inproceedings{xu1999automatic,
  author = {Songwen Xu and Yam San Chee},
  title = {{Automatic Diagnosis of Student Programs in Programming Learning Environments}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1999},
}
Figure