# InvAASTCluster: On Applying Invariant-Based Program Clustering to Introductory Programming Assignments

arXiv: https://arxiv.org/abs/2206.14175 · HTML: https://mlsanity.com/paper/2206.14175/

## Key facts

- Cited by 4 papers in the map (data through 14 Oct 2026).
- Builds on 15 of its 72 references that are in the map.
- First posted on arXiv 28 Jun 2022.

## Builds on (most cited first, 15 of 15)

- [CodeBERT: A Pre-Trained Model for Programming and Natural Languages](https://mlsanity.com/paper/2002.08155/) (2020)
- [code2seq: Generating Sequences from Structured Representations of Code](https://mlsanity.com/paper/1808.01400/) (2018)
- [Language-Agnostic Representation Learning of Source Code from Structure and Context](https://mlsanity.com/paper/2103.11318/) (2021)
- [Aroma: Code Recommendation via Structural Code Search](https://mlsanity.com/paper/1812.01158/) (2018)
- [Automated Clustering and Program Repair for Introductory Programming Assignments](https://mlsanity.com/paper/1603.03165/) (2016)
- [Automated Classification of Overfitting Patches with Statically Extracted Code Features](https://mlsanity.com/paper/1910.12057/) (2019)
- [Data-Driven Feedback Generation for Introductory Programming Exercises](https://mlsanity.com/paper/1711.07148/) (2017)
- [Verifix: Verified Repair of Programming Assignments](https://mlsanity.com/paper/2106.16199/) (2021)
- [C-Pack of IPAs: A C90 Program Benchmark of Introductory Programming Assignments](https://mlsanity.com/paper/2206.08768/) (2022)
- [Cross-Language Code Search using Static and Dynamic Analyses](https://mlsanity.com/paper/2106.09173/) (2021)
- [FAPR: Fast and Accurate Program Repair for Introductory Programming Courses](https://mlsanity.com/paper/2107.06550/) (2021)
- [Feedback Generation for Performance Problems in Introductory Programming Assignments](https://mlsanity.com/paper/1403.4064/) (2014)
- [Targeted Example Generation for Compilation Errors](https://mlsanity.com/paper/1909.00769/) (2019)
- [Program Equivalence for Assisted Grading of Functional Programs (Extended Version)](https://mlsanity.com/paper/2010.08051/) (2020)
- [Semi-Supervised Verified Feedback Generation](https://mlsanity.com/paper/1603.04584/) (2016)

## Built on by (most cited first, 4 of 4)

- [Counterexample Guided Program Repair Using Zero-Shot Learning and MaxSAT-based Fault Localization](https://mlsanity.com/paper/2502.07786/) (2024)
- [CFaults: Model-Based Diagnosis for Fault Localization in C Programs with Multiple Test Cases](https://mlsanity.com/paper/2407.09337/) (2024)
- [Graph Neural Networks For Mapping Variables Between Programs -- Extended Version](https://mlsanity.com/paper/2307.13014/) (2023)
- [Model-Based Diagnosis with Multiple Observations: A Unified Approach for C Software and Boolean Circuits](https://mlsanity.com/paper/2512.02898/) (2025)

## Abstract (arXiv)

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.
