|
ABSTRACT
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 so-called `path queries' to express dataflow properties.We motivate the design of JunGL via a number of non-trivial refactorings, and describe its implementation on the.NET platform.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
|
 |
3
|
Ittai Balaban , Frank Tip , Robert Fuhrer, Refactoring support for class library migration, Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, October 16-20, 2005, San Diego, CA, USA
|
| |
4
|
|
 |
5
|
Alan Donovan , Adam Kiežun , Matthew S. Tschantz , Michael D. Ernst, Converting java programs to use generic libraries, Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 24-28, 2004, Vancouver, BC, Canada
|
 |
6
|
Stephen Drape , Oege de Moor , Ganesh Sittampalam, Transforming the .NET intermediate language using path logic programming, Proceedings of the 4th ACM SIGPLAN international conference on Principles and practice of declarative programming, p.133-144, October 06-08, 2002, Pittsburgh, PA, USA
[doi> 10.1145/571157.571171]
|
| |
7
|
Torbjörn Ekman and Görel Hedin. Rewritable reference attributed grammars. In Martin Odersky, editor, European Conference on Object-Oriented Programming, pages 144--169, 2004.
|
| |
8
|
|
 |
9
|
|
| |
10
|
Ran Ettinger and Mathieu Verbaere. Refactoring bugs in Eclipse, IntelliJ IDEA and Visual Studio. http://progtools.comlab.ox.ac.uk/projects/refactoring/bugreports, 2005.
|
| |
11
|
|
| |
12
|
Martin Fowler. Refactoring home page. http://www.refactoring.com, 2005.
|
 |
13
|
|
| |
14
|
Elnar Hajiyev, Mathieu Verbaere, Oege de Moor, and Kris de Volder. Codequest with datalog. In OOPSLA Companion, 2005.
|
 |
15
|
|
| |
16
|
Neil D. Jones and Alan Mycroft. Stepwise development of operational and denotational semantics for prolog. In Symposium on Logic Programming, pages 281--288, 1984.
|
| |
17
|
|
| |
18
|
|
 |
19
|
David Lacey , Neil D. Jones , Eric Van Wyk , Carl Christian Frederiksen, Proving correctness of compiler optimizations by temporal logic, Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.283-294, January 16-18, 2002, Portland, Oregon
|
| |
20
|
|
 |
21
|
|
 |
22
|
Sorin Lerner , Todd Millstein , Erika Rice , Craig Chambers, Automated soundness proofs for dataflow analyses and transformations via local rules, Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.364-377, January 12-14, 2005, Long Beach, California, USA
|
 |
23
|
|
| |
24
|
Yanhong Annie Liu and Scott D. Stoller. Querying complex graphs. In P. Van Hentenryck, editor, Proceedings of the 8th International Symposium on Practical Aspects of Declarative Languages, pages 16--30, 2006.
|
 |
25
|
Michael Martin , Benjamin Livshits , Monica S. Lam, Finding application errors and security flaws using PQL: a program query language, Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, October 16-20, 2005, San Diego, CA, USA
|
| |
26
|
|
| |
27
|
Tom Mens, Gabriele Taentzer, and Olga Runge. Detecting structural refactoring conflicts using critical pair analysis. Electronic Notes in Theoretical Computer Science, 127(3):113--128, 2005.
|
| |
28
|
|
| |
29
|
Karina Olmos and Eelco Visser. Strategies for source-to-source constant propagation. In B. Gramlich and S. Lucas, editors, Workshop on Reduction Strategies in Rewriting and Programming, volume 70 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, May 2002.
|
| |
30
|
|
| |
31
|
|
| |
32
|
J. Alan Robinson and Ernest E. Sibert. LOGLISP: Motivation, design and implementation. In K. L. Clark and S. A. Tänlund, editors, Logic Programming, pages 299--313. Academic Press, 1982.
|
| |
33
|
|
 |
34
|
|
| |
35
|
Don Syme. F# home page. http://research.microsoft.com/projects/ilx/fsharp.aspx, 2005.
|
 |
36
|
Frank Tip , Adam Kiezun , Dirk Bäumer, Refactoring for generalization using type constraints, Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, October 26-30, 2003, Anaheim, California, USA
|
| |
37
|
|
 |
38
|
Daniel von Dincklage , Amer Diwan, Converting Java classes to use generics, Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 24-28, 2004, Vancouver, BC, Canada
|
| |
39
|
Mark Weiser. Program slicing. IEEE Transactions on Software Engineering, 10:352--357, 1984.
|
 |
40
|
|
CITED BY 14
|
|
Henrik Stuart , René Rydhof Hansen , Julia L. Lawall , Jesper Andersen , Yoann Padioleau , Gilles Muller, Towards easing the diagnosis of bugs in OS code, Proceedings of the 4th workshop on Programming languages and operating systems, October 18-18, 2007, Stevenson, Washington
|
|
|
|
|
|
|
|
|
Yoann Padioleau , René Rydhof Hansen , Julia L. Lawall , Gilles Muller, Semantic patches for documenting and automating collateral evolutions in Linux device drivers, Proceedings of the 3rd workshop on Programming languages and operating systems: linguistic support for modern operating systems, p.10-es, October 22-22, 2006, San Jose, California
|
|
|
Mathieu Verbaere , Arnaud Payement , Oege de Moor, Scripting refactorings with JunGL, Companion to the 21st ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, October 22-26, 2006, Portland, Oregon, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|