JunGL: A scripting language for refactoring

Mathieu Verbaere, Ran Ettinger, Oege De Moor

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

77 Scopus citations


Refactorings are behaviour-preserving program transformations, typically for improving the structure of existing code. A few of these transformations have been mechanised in interactive development environments. Many more refactorings have been proposed, and it would be desirable for programmers to script their own refactorings. Implementing such source-to-source transformations, however, is quite complex: even the most sophisticated development environments contain significant bugs in their refactoring tools. We present a domain-specific language for refactoring, named JunGL. It manipulates a graph representation of the program: all information about the program, including ASTs for its compilation units, variable binding, control flow and so on is represented in a uniform graph format. The language is a hybrid of a functional language (in the style of ML) and a logic query language (akin to Datalog). JunGL furthermore has a notion of demand-driven evaluation for constructing computed information in the graph, such as control flow edges. Borrowing from earlier work on the specification of compiler optimisations, JunGL uses socalled 'path queries' to express dataflow properties. We motivate the design of JunGL via a number of nontrivial refactorings, and describe its implementation on the .NET platform.

Original languageEnglish
Title of host publicationProceeding of the 28th International Conference on Software Engineering 2006, ICSE '06
Number of pages10
StatePublished - 1 Dec 2006
Externally publishedYes
Event28th International Conference on Software Engineering 2006, ICSE '06 - Shanghai, China
Duration: 20 May 200628 May 2006

Publication series

NameProceedings - International Conference on Software Engineering
ISSN (Print)0270-5257


Conference28th International Conference on Software Engineering 2006, ICSE '06


  • Language workbenches
  • Refactoring
  • Scripting language
  • Source code transformation

ASJC Scopus subject areas

  • Software


Dive into the research topics of 'JunGL: A scripting language for refactoring'. Together they form a unique fingerprint.

Cite this