Eliminating code clones is good for improving the quality and maintainability of software. Structure semantics similar code clones are more difficult to be refactored than other types of clones. This paper presents an...
详细信息
ISBN:
(纸本)9788132216957;9788132216940
Eliminating code clones is good for improving the quality and maintainability of software. Structure semantics similar code clones are more difficult to be refactored than other types of clones. This paper presents an algorithm for refactoring structure semantics similar clones. Structure semantics similar clones are the clones that have similar program dependence graph (PDGs) after semantic equivalent standardization transformation. The graph-based standardization method can identify the semantically similar code clones effectively with a high computation complexity. The metrics-based method has a lower computation complexity but also has a lower accuracy of identification. To solve this problem, this paper first uses the metrics-based method to filter out most candidate clones not suitable for refactoring and then further confirms the structure semantics similar clones that are suitable for refactoring by code standardization, PDGs matching, and similarity comparison. Structure semantics we propose a new approach for refactoring structure semantics similar clones combining standardization with metrics. The experiments results in open source codes show that this method behaves well in refactoring structure semantics similar clones.
Modern Java IDE aim at assisting object-oriented software development workflows with continuously interleaved co-evolution steps of program editing and program refactoring. program editing usually comprises manually p...
详细信息
ISBN:
(纸本)9781450337120
Modern Java IDE aim at assisting object-oriented software development workflows with continuously interleaved co-evolution steps of program editing and program refactoring. program editing usually comprises manually performed program changes applied by a programmer at source code level. In contrast, refactorings consist of behavior-preserving program restructuring rules with complex preconditions, usually formulated over an appropriate program abstraction. To integrate both steps into a comprehensive program evolution framework, we present a graph-based approach for incremental co-evolution of Java programs. Our approach is based on a concise graph-based representation of Java programs by means of a reduced abstract syntax tree, augmented with additional cross-tree edges denoting crucial semantic information. On this basis, a precise formal specification of object-oriented program refactorings can be defined in terms of endogenous graph-transformation rules. In addition, we use Triple Graph Grammars (TGG) to define exogenous bidirectional graph transformation rules for automated incremental synchronization between a program graph and the corresponding source code. Our implementation relies on the graph-transformation engine eMoflon and currently supports the Java refactorings Pull Up Method and Create Superclass.
暂无评论