Abstract
Dynamic languages play an increasingly prominent role in modern software development. They are used in domains as diverse as web programming and scientific computing, for developing simple scripts as well as large applications. Tool-supported refactoring for these languages can bring important benefits to programmers. First, manual refactoring tends to be error-prone in dynamic languages since they impose very little static structure; hence, erroneous refactorings often cannot be detected until runtime. A tool can use static program analysis to check the soundness of a proposed refactoring, thus mitigating this problem. Second, dynamic languages tend to lack constructs for modularisation and encapsulation, which can be an obstacle to writing maintainable software. In many cases, such constructs can be emulated using other language features, but refactoring a program to make use of such patterns is often non-trivial and could benefit from tool support. Third, refactoring tools can be useful for adapting programs to use high-level features, thus supporting script to program evolution. However, specifying and implementing refactorings for dynamic languages is a challenging endeavour. We highlight some of the major issues in this area, and discuss recent progress towards solving them. © 2012 ACM.