CLuster And RepAir tool for introductory programming assignments
This is an implementation of the clustering and repair tool for introductory programming assignments, described in the following paper: Automated Clustering and Program Repair forIntroductory Programming Assignments (https://dl.acm.org/doi/10.1145/3192366.3192387 and https://arxiv.org/abs/1603.03165).
The package is currently supported/tested on the following operating systems:
- Fedora
- Debian
- Ubuntu
The package is currently supported/tested on the following Python versions:
- 3.6
- 3.7
- 3.8
- 3.9
Any other version might or might not work as expected. If you encounter any error with the above mentioned combination, please do file an issue.
- C compiler
- Cython
$ sudo aptitude install cython
(Debian)# dnf install Cython
(Fedora)
- lpsolve 5.5 (development files and library)
$ sudo aptitude install lp-solve liblpsolve55-dev
(Debian)# dnf install lpsolve-devel
(Fedora)
make
(in this directory) installs a binary file calledclara
- Run
clara help
or see examples below.
- Create a new virtual environment (using
virtualenv
) - Install
Cython
(usingpip install Cython
inside the new virtual enviroment) - Run
python setup.py develop
On Debian system the following is required before running the tool: export LD_LIBRARY_PATH=/usr/lib/lp_solve/
The examples/
directory contains some example programs:
c1.py
andc2.py
are the correct examples from the paperi1.py
andi2.py
are the incorrect example from the paperc3.py
is a constructed example.
To test matching between examples/c1.py
and examples/c2.py
on inputs [4.5]
and [1.0,3.0,5.5]
use:
clara match examples/c1.py examples/c2.py --entryfnc computeDeriv --args "[[[4.5]], [[1.0,3.0,5.5]]]" --ignoreio 1
This should output Match!
.
To test matching between examples/c1.py
and examples/c3.py
on inputs [4.5]
and [1.0,3.0,5.5]
use:
clara match examples/c1.py examples/c3.py --entryfnc computeDeriv --args "[[[4.5]], [[1.0,3.0,5.5]]]" --ignoreio 1
This should output No match!
.
To repair examples/i1.py
using examples/c1.py
on the same inputs as above, use:
clara repair examples/c1.py examples/i1.py --entryfnc computeDeriv --args "[[[4.5]], [[1.0,3.0,5.5]]]" --ingoreio 1
To cluster correct programs on the same inputs as above use:
mkdir clusters
clara cluster examples/c*.py --clusterdir clusters --entryfnc computeDeriv --args "[[[4.5]], [[1.0,3.0,5.5]]]" --ignoreio 1
This should produce two clusters in the directroy clusters/
and two .json
files with additional experssion extracted from the clusters.
To produce feedback from the above clusters for an incorrect program, for example examples/i1.py
, use:
clara feedback clusters/c*.py examples/i1.py --entryfnc computeDeriv --args "[[[4.5]], [[1.0,3.0,5.5]]]" --ignoreio 1 --feedtype python
You can add --verbose 1
to any of the examples to obtain a more verbose output.