Mining patterns in syntax trees to automate code reviews of student solutions for programming exercises
Charlotte Van Petegem, Kasper Demeyere, Rien Maertens, Niko Strijbol, Bram De Wever, Bart Mesuere, Peter Dawyndt
TL;DR
This work tackles the labor-intensity and inconsistency of manual feedback in programming education by introducing ECHO, an AST-based pattern mining approach to reuse feedback annotations from prior code reviews. ECHO builds a language-agnostic pipeline using tree-sitter to create AST contexts, TreeminerD to discover frequent subtree patterns, and a weighted scoring mechanism with $weight(pattern) = \frac{len(pattern)}{#occurrences(pattern)}$ and $score(annotation) = \frac{\sum_{pattern \in patterns} weight(pattern) [pattern\ matches]}{\lvert patterns\rvert}$ to rank potential feedback for new submissions. Empirical results show strong top-5 accuracy for both automated Pylint annotations and human reviewer annotations, with training and per-annotation prediction times generally in the sub-second to sub-millisecond range, enabling real-time assistance during live reviews. The findings suggest that integrating ECHO into learning platforms can reduce manual feedback effort while improving consistency, and point to future directions including confidence-scored suggestions, broader context, speed optimizations, and potential hybrid feedback with LLM-based systems.
Abstract
In programming education, providing manual feedback is essential but labour-intensive, posing challenges in consistency and timeliness. We introduce ECHO, a machine learning method to automate the reuse of feedback in educational code reviews by analysing patterns in abstract syntax trees. This study investigates two primary questions: whether ECHO can predict feedback annotations to specific lines of student code based on previously added annotations by human reviewers (RQ1), and whether its training and prediction speeds are suitable for using ECHO for real-time feedback during live code reviews by human reviewers (RQ2). Our results, based on annotations from both automated linting tools and human reviewers, show that ECHO can accurately and quickly predict appropriate feedback annotations. Its efficiency in processing and its flexibility in adapting to feedback patterns can significantly reduce the time and effort required for manual feedback provisioning in educational settings.
