Skip to main content
QUICK REVIEW

[Paper Review] InvAASTCluster: On Applying Invariant-Based Program Clustering to Introductory Programming Assignments

Pedro Orvalho, Mikoláš Janota|arXiv (Cornell University)|Jun 28, 2022
Online Learning and AnalyticsComputer Science5 citations
TL;DR

This paper proposes InvAASTCluster, a novel program clustering approach for introductory programming assignments (IPAs) that combines anonymized abstract syntax trees (AASTs) with dynamically generated program invariants to improve semantic similarity detection. By leveraging invariants to capture program semantics and AASTs for structural representation, the method outperforms syntax-based clustering in identifying semantically equivalent programs, enabling faster and more accurate repair in clustering-based program repair tools like Clara.

ABSTRACT

Due to the vast number of students enrolled in programming courses, there has been an increasing number of automated program repair techniques focused on introductory programming assignments (IPAs). Typically, such techniques use program clustering to take advantage of previous correct student implementations to repair a new incorrect submission. These repair techniques use clustering methods since analyzing all available correct submissions to repair a program is not feasible. However, conventional clustering methods rely on program representations based on features such as abstract syntax trees (ASTs), syntax, control flow, and data flow. This paper proposes InvAASTCluster, a novel approach for program clustering that uses dynamically generated program invariants to cluster semantically equivalent IPAs. InvAASTCluster's program representation uses a combination of the program's semantics, through its invariants, and its structure through its anonymized abstract syntax tree (AASTs). Invariants denote conditions that must remain true during program execution, while AASTs are ASTs devoid of variable and function names, retaining only their types. Our experiments show that the proposed program representation outperforms syntax-based representations when clustering a set of correct IPAs. Furthermore, we integrate InvAASTCluster into a state-of-the-art clustering-based program repair tool. Our results show that InvAASTCluster advances the current state-of-the-art when used by clustering-based repair tools by repairing around 13% more students' programs, in a shorter amount of time.

Motivation & Objective

  • Address the challenge of efficiently identifying semantically equivalent correct student implementations in introductory programming assignments (IPAs) for automated repair.
  • Overcome the limitations of syntax-based and control-flow-based program representations, which can be brittle and fail to capture semantic equivalence.
  • Develop a robust program representation that integrates structural (AAST) and semantic (invariant) features to improve clustering accuracy.
  • Evaluate the proposed method in a real-world program repair pipeline to demonstrate its superiority over existing state-of-the-art clustering techniques.
  • Enable more effective and efficient automated feedback in MOOCs by reducing the number of clusters while increasing repair success rates.

Proposed method

  • Construct anonymized abstract syntax trees (AASTs) to represent program structure while preserving syntactic differences due to variable naming.
  • Dynamically generate program invariants using Daikon over multiple test executions to capture semantic properties such as loop invariants and variable relationships.
  • Combine AASTs and invariant sets into a unified vector representation for each program to enable similarity-based clustering.
  • Use cosine similarity on the combined vector representation to compute program similarity and form clusters of semantically equivalent programs.
  • Integrate InvAASTCluster into the Clara program repair framework to evaluate its impact on repair performance and scalability.
  • Apply clustering-based repair: for each incorrect student submission, identify the closest correct program in the cluster and apply minimal repairs.

Experimental results

Research questions

  • RQ1Can a program representation combining AASTs and dynamically generated invariants improve clustering accuracy for semantically equivalent IPAs compared to syntax-only representations?
  • RQ2Does the use of invariants enhance the ability to detect semantic equivalence in small imperative programs commonly found in introductory programming assignments?
  • RQ3How does InvAASTCluster perform in practice when integrated into a state-of-the-art clustering-based program repair tool like Clara?
  • RQ4Can InvAASTCluster reduce the number of clusters needed to cover all correct student submissions while maintaining or improving repair success rates?
  • RQ5Does the proposed method lead to faster repair times and higher repair coverage compared to existing clustering techniques?

Key findings

  • The InvAASTCluster representation, combining AASTs and invariants, significantly outperforms syntax-based representations in clustering correctness for IPAs.
  • When integrated into the Clara repair framework, InvAASTCluster repaired a higher number of incorrect student submissions compared to the original Clara clustering method.
  • The use of InvAASTCluster reduced the number of required clusters while maintaining or improving repair accuracy, leading to better scalability.
  • The repair process using InvAASTCluster was faster due to more accurate and semantically meaningful cluster representatives.
  • The method demonstrated robustness across diverse programming exercises, showing consistent improvements in both precision and recall of cluster formation.
  • The integration of invariants into program representation enabled better detection of semantically equivalent programs that differ syntactically, such as those using different variable names or control flow order.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.