Pointers on abstract syntax tree differencing algorithms and tools

by Martin Monperrus
(tagged as )

This post presents papers and tools on semantic source code differencing. It is a special kind of tree differencing.

Semantic source code diff

Unix diff and successors (CVS, GIT diff) are line-based. On the contrary, semantic source code diff work on the abstract syntax tree (AST).

Papers:

I don't know any comparative evaluation of those algorithms (do you?).

Tools:

I've used ChangeDistiller to diff Java code and it works great. The demos of Ydiff look nice.

XML diff

If one transforms an AST to XML (for instance using srcML, one could use XML diff tools:

Tools:

Seminal papers on tree differencing

See also A survey on tree edit distance and related problems (Bille, 2005)

All papers on this subject tend to use one of the following terms: