Na Meng – Locating and Applying Systematic Edits by Learning from Examples

The motivation for this idea is that as a developer, you often have to perform similar, but not identical changes. For instance when updating an API or when preventing SQL injection attacks.

In previous work, the authors created Sydit, that produces code transformation from, however, Sydit requires developers to supply target edit locations. This is where LACE comes in, a user can train LACE by showing how to transform a program and LACE can find locations and suggest the transformations to be applied there.

Capture

They performed an empirical study with two oracle test suites. One test suite consists of multiple systematic edits that fix the same bug in multiple commits, drawn from two open-source programs, Eclipse JDT and Eclipse SWT. The other one contains 37 systematic edits from five Java open-source programs (jEdit, Eclipse jdt.core, Eclipse compare, Eclipse core.runtime, and Eclipse debug).

In this study, LASE finds edit locations with 99% precision, 88% recall and 89% accuracy. Quite impressive!

Further reading:

Preprint
Paper on Sydit