Lase: Locating and applying systematic edits by learning from examples
Authors:
- 1 May 2013
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- No. 02705257,p. 502-511
Abstract
Adding features and fixing bugs often require systematic edits that make similar, but not identical, changes to many code locations. Finding all the relevant locations and making the correct edits is a tedious and error-prone process for developers. This paper addresses both problems using edit scripts learned from multiple examples. We design and implement a tool called LASE that (1) creates a context-aware edit script from two or more examples, and uses the script to (2) automatically identify edit locations and to (3) transform the code. We evaluate LASE on an oracle test suite of systematic edits from Eclipse JDT and SWT. LASE finds edit locations with 99% precision and 89% recall, and transforms them with 91% accuracy. We also evaluate LASE on 37 example systematic edits from other open source programs and find LASE is accurate and effective. Furthermore, we confirmed with developers that LASE found edit locations which they missed. Our novel algorithm that learns from multiple examples is critical to achieving high precision and recall; edit scripts created from only one example produce too many false positives, false negatives, or both. Our results indicate that LASE should help developers in automating systematic editing. Whereas most prior work either suggests edit locations or performs simple edits, LASE is the first to do both for nontrivial program edits.Keywords
This publication has 20 references indexed in Scilit:
- Automatic patch generation learned from human-written patches2013
- A case study of cross-system porting in forked projects2012
- Systematic editing2011
- A graph-based approach to API usage adaptation2010
- Matching dependence-related queries in the system dependence graph2010
- Automated fixing of programs with contracts2010
- Recurring bug fixes in object-oriented programs2010
- Automatically patching errors in deployed software2009
- Discovering and representing systematic code changes2009
- PR-MinerACM SIGSOFT Software Engineering Notes, 2005