In order to apply the TCS Alignment Toolbox, one has to transfer the student solutions into a sequential format. Fortunately, this is quite intuitive for Java programs: We consider the Abstract Syntax Tree of the program, as returned by the Oracle Java Compiler API. For this demo, we have already extracted the syntax trees and put them in a simple text format into the fog directory.
To transform these trees into a sequence we use the prefix order of the nodes in the tree. This relates to the order of statements in the program:
int a = f(b, c);
is transformed to:
We record several features of every node in the syntax tree:
On the right hand side we show the sequence representations for each of the student solutions in our dataset.