Automated Generalization and Refinement of Code Templates with Ekeko/X

Code templates are an intuitive means to specify source code snippets of interest, such as all instances of a bug, groups of snippets that need to be refactored or transformed, or instances of design patterns. While intuitive, it is not always straightforward to write a template that produces only the desired matches. A template could produce either more snippets than desired, or too few. To assist the users of EKEKO/X, our template-based search and transformation tool for Java, we have extended it with two components: The first is a suite of mutation operators that simplifies the process of modifying templates. The second is a system that can automatically suggest a sequence of mutations to a given template, such that it matches only with a set of desired snippets. In this tool paper, we highlight the key design decisions in implementing these two components of EKEKO/X, and demonstrate their use by walking through an example sequence of mutations suggested by the system.

[1]  Yuanyuan Zhang,et al.  Search-based software engineering: Trends, techniques and applications , 2012, CSUR.

[2]  Benjamin Livshits,et al.  Finding application errors and security flaws using PQL: a program query language , 2005, OOPSLA '05.

[3]  Claire Le Goues,et al.  GenProg: A Generic Method for Automatic Software Repair , 2012, IEEE Transactions on Software Engineering.

[4]  Andy Kellens,et al.  The SOUL tool suite for querying programs in symbiosis with Eclipse , 2011, PPPJ.

[5]  Katsuro Inoue,et al.  The Ekeko/X Program Transformation Tool , 2014, 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation.

[6]  Miryung Kim,et al.  Lase: Locating and applying systematic edits by learning from examples , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[7]  James R. Cordy,et al.  The TXL source transformation language , 2006, Sci. Comput. Program..

[8]  Romain Robbes,et al.  Example-Based Program Transformation , 2008, MoDELS.

[9]  Coen De Roover,et al.  Building development tools interactively using the EKEKO meta-programming library , 2014, 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE).

[10]  Günter Kniesel,et al.  A comparison of logic-based infrastructures for concern detection and extraction , 2007, LATE@AOSD.

[11]  W. Eric Wong,et al.  Using Mutation to Automatically Suggest Fixes for Faulty Programs , 2010, 2010 Third International Conference on Software Testing, Verification and Validation.

[12]  Bradley Alexander,et al.  Evolving patches for software repair , 2011, GECCO '11.

[13]  Itay Maman,et al.  Guarded Program Transformations Using JTL , 2008, TOOLS.

[14]  Elnar Hajiyev,et al.  codeQuest: Scalable Source Code Queries with Datalog , 2006, ECOOP.