TL;DR
This paper introduces a novel approach to automatically generate personalized and verified feedback for student programming submissions. By clustering solutions based on strategy and using instructor-validated examples for verification, the system can identify and suggest fixes for a high percentage of common programming errors, significantly reducing the manual effort required from instructors.
What Problem Does This Paper Address?
Online programming platforms are booming, but students often struggle due to a lack of personalized feedback when they make mistakes. Manually reviewing the sheer volume of student submissions is impractical for instructors. Existing automated feedback systems often rely on simple test cases or generic feedback propagation, which can lead to incorrect or unhelpful suggestions. This paper tackles the challenge of providing high-quality, accurate, and scalable feedback that addresses the diverse ways students approach programming problems.
Methods
The core of the proposed solution is a two-phase approach:
- Semi-Supervised Clustering: Submissions are first clustered based on their underlying solution strategy, not just superficial syntactic similarity. This is achieved by extracting features like DP array types, loop structures, and update patterns. This clustering groups similar approaches together, reducing the variation within each group.
- Verified Feedback Generation: For each cluster, an instructor identifies or provides a single "correct" submission. The system then uses this validated submission as a reference to verify every other submission in the same cluster. A novel "counter-example guided feedback generation" algorithm is employed. This algorithm uses formal verification techniques (specifically, SMT solvers) to pinpoint exact discrepancies between a student's code and the reference solution. If a fault is found, the algorithm generates specific, actionable feedback suggesting corrections. This verification process ensures that the generated feedback is correct.
Datasets
The system was evaluated on 2226 student submissions to 4 dynamic programming (DP) problems from CodeChef: SUMTRIAN, MGCRNK, MARCHA1, and PPTEST. These submissions were from 1860 students across 250 institutions, representing a diverse range of coding styles and approaches.
Key Insights and Ideas
- Strategy-based Clustering is Key: Grouping submissions by their fundamental algorithmic strategy, rather than just code similarity, is crucial for effective feedback generation. This allows for more meaningful comparisons and reduces the complexity of verification.
- Instructor as a "Seed": Leveraging the instructor to provide just one correct example per cluster significantly reduces manual effort while enabling powerful automated verification. This "semi-supervised" approach balances scalability with accuracy.
- Formal Verification for Guaranteed Correctness: Using SMT solvers to generate counter-examples and refine equivalence queries ensures that the feedback provided is not just a guess, but a verified correction. This is a significant advantage over heuristic-based feedback.
- Feedback Personalization is Essential: The study found that even within a cluster, submissions often require different feedback. The proposed method generates personalized feedback for each faulty submission, unlike simpler propagation methods.
- Beyond Test Cases: The system can identify logical faults that black-box testing (like CodeChef's) might miss, such as incorrect initialization or off-by-one errors in loop bounds, even for submissions that pass all tests.
Key Results
- The system successfully generated verified feedback for 1911 out of 2226 submissions (85%).
- Feedback generation took an average of 1.6 seconds per submission.
- The clustering approach significantly reduced instructor burden: only one submission needed manual validation or addition for every 16 submissions.
- The system verified 1122 submissions (50%) as correct.
- For the remaining 789 submissions (35%), faults were identified and corrections were suggested.
- The system identified faults in 265 submissions that CodeChef had marked as correct, highlighting the limitations of test-based evaluation for logical errors.
Limitations and Future Work
- SMT Solver Timeouts: The system could not generate feedback for 15% of submissions, often due to SMT solver timeouts or limitations in the verification algorithm/implementation.
- Specific Fault Types: The system does not provide feedback for errors in custom input/output functions, output formatting, or typecasting.
- Stylistic Conformance: Feedback might sometimes enforce stylistic choices (e.g., 0-based vs. 1-based indexing) from the instructor's reference solution, which may not always be the primary learning goal.
- Limited Language Support: The current implementation primarily supports C constructs.
- Future Work: The authors suggest exploring more sophisticated algorithms for clustering and verification, extending support to more programming languages and problem domains, and investigating ways to handle loop-carried dependencies over scalar variables and auxiliary arrays. They also aim to improve the handling of stylistic differences and explore more efficient SMT solving strategies.
Summary updated