User Tools

Site Tools


ast-patterns:start

This is an old revision of the document!


AST patterns

We propose using abstract-syntax-tree (AST) patterns as features for learning rules to distinguish between correct and incorrect programs. These rules can be used for debugging student programs: rules for incorrect programs contain patterns indicating mistakes, whereas rules for correct programs cover subsets of submissions sharing the same solution strategy.

Papers

Syntax-based analysis of programming concepts in Python (2018)

Writing programs is essential to learning programming. Most programming courses encourage students to practice with lab and homework assignments. By analyzing solutions to these exercises teachers can discover mistakes and concepts students are struggling with, and use that knowledge to improve the course. Students however tend to submit many different programs even for simple exercises, making such analysis difficult.

We propose using tree regular expressions to encode common patterns in programs. Based on these patterns we induce rules describing common approaches and mistakes for a given assignment. In this paper we present a case study of rule-based analysis for an introductory Python exercise. We show that our rules are easy to interpret, and can be learned from a relatively small set of programs.

Identifying typical approaches and errors in Prolog programming with argument-based machine learning (2018)

In programming courses with high student-teacher ratios, it is nearly impossible to provide feedback to all homeworks submitted by students. The alternative would be to generate automatic feedback, however this would require teachers to specify all possible errors made by students. Instead we propose a data-driven algorithm for identification of typical approaches and errors. We present the problem as supervised rule learning, where each learned rule can be used as a hint to a student. To learn rules, we use programs submitted by students as learning instances that are classified either as correct or incorrect solutions. The attributes for machine learning correspond to patterns from an abstract syntax tree. As the space of patterns is immense and we wish to use only meaningful patterns, we used the argument-based machine learning (ABML) process, where an expert and ABML interactively exchange arguments until the model is good enough. We provide a step-by-step demonstration of the ABML process, describe some of the induced rules and explain how are they used to automatically generate hints to students. Finally, we evaluate classification accuracy of learned rules on 42 Prolog exercises from the Programming Languages Course at University of Ljubljana.

Automatic extraction of AST patterns for debugging student programs (2017)

When implementing a programming tutor, it is often difficult to manually consider all possible errors encountered by students. An alternative is to automatically learn a bug library of erroneous patterns from students’ programs.

We propose using abstract-syntax-tree (AST) patterns as features for learning rules to distinguish between correct and incorrect programs. These rules can be used for debugging student programs: rules for incorrect programs (buggy rules) contain patterns indicating mistakes, whereas rules for correct programs cover subsets of submissions sharing the same solution strategy.

To generate hints, we first check all buggy rules and point out incorrect patterns. If no buggy rule matches, rules for correct programs are used to recognize the student’s intent and suggest patterns that still need to be implemented.

We evaluated our approach on past student programming data for a number of Prolog problems. For 31 out of 44 problems, the induced rules correctly classified over 85% of programs based only on their structural features. For approximately 73% of incorrect submissions, we were able to generate hints that were implemented by the student in some subsequent submission.

Paper presented at the 18th conference on AI in Education.

ast-patterns/start.1529344841.txt.gz · Last modified: 2018/06/18 20:00 by timotej