User Tools

Site Tools


ast-patterns:start

Table of Contents

AST patterns

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 abstract-syntax-tree (AST) patterns as features for learning rules to distinguish between correct and incorrect programs. These rules can be used for analyzing student programs: rules for incorrect programs contain patterns indicating mistakes, whereas rules for correct programs cover subsets of submissions sharing the same solution strategy.

Code

Check out the WIP source code with git clone https://ailab.si/code/patterns.git, or browse it online by following the same link.

Automatic hints for Prolog are implemented in the CodeQ programming tutor (use account demo-auto with password demo). Note that the application is not fully translated into English. Source code for CodeQ is also available.

Papers

Syntax-based analysis of programming concepts in Python (2018). 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). As the space of AST 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). We propose using abstract-syntax-tree (AST) patterns as features for learning rules to distinguish between correct and incorrect programs. 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.

Rewrite rules for debugging student programs in programming tutors (2017). Before AST patterns we formalized the notion of a »code edit« to support automatic program rewriting, described in this paper.

ast-patterns/start.txt · Last modified: 2019/02/11 18:51 by timotej