In software development, change is the only constant. Software systems some- times evolve in a substantial way, for example, by migrating the system to a new architecture, or by updating the APIs on which the system d...
详细信息
In software development, change is the only constant. Software systems some- times evolve in a substantial way, for example, by migrating the system to a new architecture, or by updating the APIs on which the system depends. During this process, sequences of codetransformations (e. g., create a class, implement a given interface, then override a method) are systematically performed in the system (e. g., to some classes in the same hierarchy or package). Due to the repetitive nature of these transformations, some automated support is needed to ensure that these sequences of transformations are consistently applied to the entire system. One solution to deal with systematic codetransformation is to allow devel- opers to compose their own sequences of codetransformations. These sequences may be defined manually, e. g., by using a language to specify each transformation, or they may be identified from one or more concrete examples of transformations provided by the developer. We argue that existing approaches lack the definition of sequences that are: (i) specific to the system to which they were applied; (ii) eventually complex, i. e., not fully supported by existing refactoring tools; (iii) not localized, i. e., several code entities can be affected at each occurrence of the se- quence; and (iv) self-aware of potential violations that might be introduced as consequence of these transformations. In this thesis we propose to improve source code transformations to better sup- port developers performing more complex and systematic codetransformations. We cover two aspects: • The automated support to compose and apply sequences of code transfor- mations. We undergo an investigation on the existence of these sequences in real-world software systems. We propose a tool to automatically apply these sequences in the systems we analyzed. • The detection of design violations during a transformation effort. We un- dergo an investigation on cases of systematic application of ref
Refactorings are behavior-preserving codetransformations. They are a recommended software development practice and are now a standard feature in modern IDEs. There are however many situations where developers need to...
详细信息
Refactorings are behavior-preserving codetransformations. They are a recommended software development practice and are now a standard feature in modern IDEs. There are however many situations where developers need to perform mere transformations (non-behavior-preserving) or to mix refactorings and transformations. Little work exists on the analysis of transformations implementation, how refactorings could be composed of smaller, reusable, parts (simple transformations or other refactorings), and, conversely, how transformations could be reused in isolation or to compose new refactorings. In a previous article, we started to analyze the seminal implementation of refactorings as proposed in the Ph.D. of D. Roberts, and whose evolution is available in the Pharo IDE. We identified a dichotomy between the class hierarchy of refactorings (56 classes) and that of transformations (70 classes). We also noted that there are different kinds of preconditions for different purposes (applicability preconditions or behavior-preserving preconditions). In this article, we go further by proposing a new architecture that: (i) supports two important scenarios (interactive use or scripting, i.e., batch use);(ii) defines a clear API unifying refactorings and transformations;(iii) expresses refactorings as decorators over transformations, and;(iv) formalizes the uses of the different kinds of preconditions, thus supporting better user feedback. We are in the process of migrating the existing Pharo refactorings to this new architecture. Current results show that elementary transformations such as the ADD METHOD transformation is reused in 24 refactorings and 11 other transformations;and the REMOvE METHOD transformation is reused in 11 refactorings and 7 other transformations.
Practical Java Debuggers can evaluate expressions at specified break points. Such evaluations may cause extra side effects and make an execution at debugging different from the original one. As a result, Java develope...
详细信息
Practical Java Debuggers can evaluate expressions at specified break points. Such evaluations may cause extra side effects and make an execution at debugging different from the original one. As a result, Java developers often have to edit the original sourcecode in order to safely examine runtime values of expressions. In order to cope with this problem, we aim at developing a new feature for a debugger to detect evaluations of an expression by a Java virtual machine. This debugging feature doesn't introduce any extra side effects, and will enable Java programmers to examine runtime values of an expression by simply specifying it. The implementation of the above feature requires a debugger to make correspondence between bytecode instructions executed by a Java Virtual Machine and expressions in Java source texts. As the first step toward our goal, we have developed a sourcecode translation method to make this correspondence using LineNumberTable attributes in class files generated by a standard Java compiler. There are still several cases that this method fails to automatically determine appropriate correspondence between bytecode instructions and expressions, but its solution has been left as future work. In this paper, we introduce a formalization to this method as a basis of our rigid analysis of failure cases. We evaluate our analysis method by conducting an experimental task to find failure patterns whose template is defined by our formalization.
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 ...
详细信息
ISBN:
(纸本)9781595933751
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-sourcetransformations, however, is quite complex: even the most sophisticated development environments contain significant bugs in their refactoring *** 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 *** motivate the design of JunGL via a number of non-trivial refactorings, and describe its implementation on *** platform.
暂无评论