A Study on Enhancing Quality of Code Clones by Code Motion Transformation

碩士 === 國立東華大學 === 資訊工程學系 === 100 === This thesis investigates in the effect of code motion transformation on the quality of code clones. In large scale computer programs, a considerable fraction of the source code is duplicate code, call as clones. When the clones are extracted into procedure calls,...

Full description

Bibliographic Details
Main Authors: Qin-Xin Tu, 涂勤昕
Other Authors: Chung Yung
Format: Others
Language:zh-TW
Published: 2011
Online Access:http://ndltd.ncl.edu.tw/handle/34279558660545825538
id ndltd-TW-100NDHU5392002
record_format oai_dc
spelling ndltd-TW-100NDHU53920022016-09-25T04:04:15Z http://ndltd.ncl.edu.tw/handle/34279558660545825538 A Study on Enhancing Quality of Code Clones by Code Motion Transformation 以程式碼移動技術改善程式重複片段品質之研究 Qin-Xin Tu 涂勤昕 碩士 國立東華大學 資訊工程學系 100 This thesis investigates in the effect of code motion transformation on the quality of code clones. In large scale computer programs, a considerable fraction of the source code is duplicate code, call as clones. When the clones are extracted into procedure calls, the non-duplicate statements in the code clones induce a considerable overhead. If we can reduce the overhead when the code clone is extracted into procedure calls, the quality of code clone can be enhanced. The semantics-preserving procedure extraction technique and the PDG-based clone detection allow difference in the detected clones. Komondoor and Hor-witz proposed the semantics-preserving procedure extraction technique, this technique not only can detect discontinuous clones but also can enhance the quality of code clones. The PDG-based clone detection also can detect dis-continuous clones, but PDG-based clone detection cannot detect contiguous clones. Higo and Kusumoto proposed their methods to enhance the PDG-based clone detection in 2009. In this thesis, we use the local independence transformation, the statement distribution of control structures, and code motion to enhance the quality of code clones. Yung and Lai developed “lo-cal independence transformation” to enhance the quality of code clones if the non-duplicate statement can be transformation into a new statement which can be moved out of the clone. However, there is a problem, when the non-duplicate statement is in loop, moving the statement out of the clone by local independence transformation may change the semantics of program. For this reason, Yung and I develop “statement distribution of control structures” to enhance the quality of code clones if the non-duplicate statement is in control structure(control structure means if , for , or while structure). Furthermore, we combine “local independence transformation” and “statement distribution of control structures” for enhancing more quality of code clones. We take some experiments to observe the effects: the effect of local independence transfor-mation, the effect of statement distribution of control structures, and the effect of combining local independence transformation and statement distribution of control structures. We compare these effects with K.H.(Komondoor and Hor-witz). Chung Yung 雍忠 2011 學位論文 ; thesis 50 zh-TW
collection NDLTD
language zh-TW
format Others
sources NDLTD
description 碩士 === 國立東華大學 === 資訊工程學系 === 100 === This thesis investigates in the effect of code motion transformation on the quality of code clones. In large scale computer programs, a considerable fraction of the source code is duplicate code, call as clones. When the clones are extracted into procedure calls, the non-duplicate statements in the code clones induce a considerable overhead. If we can reduce the overhead when the code clone is extracted into procedure calls, the quality of code clone can be enhanced. The semantics-preserving procedure extraction technique and the PDG-based clone detection allow difference in the detected clones. Komondoor and Hor-witz proposed the semantics-preserving procedure extraction technique, this technique not only can detect discontinuous clones but also can enhance the quality of code clones. The PDG-based clone detection also can detect dis-continuous clones, but PDG-based clone detection cannot detect contiguous clones. Higo and Kusumoto proposed their methods to enhance the PDG-based clone detection in 2009. In this thesis, we use the local independence transformation, the statement distribution of control structures, and code motion to enhance the quality of code clones. Yung and Lai developed “lo-cal independence transformation” to enhance the quality of code clones if the non-duplicate statement can be transformation into a new statement which can be moved out of the clone. However, there is a problem, when the non-duplicate statement is in loop, moving the statement out of the clone by local independence transformation may change the semantics of program. For this reason, Yung and I develop “statement distribution of control structures” to enhance the quality of code clones if the non-duplicate statement is in control structure(control structure means if , for , or while structure). Furthermore, we combine “local independence transformation” and “statement distribution of control structures” for enhancing more quality of code clones. We take some experiments to observe the effects: the effect of local independence transfor-mation, the effect of statement distribution of control structures, and the effect of combining local independence transformation and statement distribution of control structures. We compare these effects with K.H.(Komondoor and Hor-witz).
author2 Chung Yung
author_facet Chung Yung
Qin-Xin Tu
涂勤昕
author Qin-Xin Tu
涂勤昕
spellingShingle Qin-Xin Tu
涂勤昕
A Study on Enhancing Quality of Code Clones by Code Motion Transformation
author_sort Qin-Xin Tu
title A Study on Enhancing Quality of Code Clones by Code Motion Transformation
title_short A Study on Enhancing Quality of Code Clones by Code Motion Transformation
title_full A Study on Enhancing Quality of Code Clones by Code Motion Transformation
title_fullStr A Study on Enhancing Quality of Code Clones by Code Motion Transformation
title_full_unstemmed A Study on Enhancing Quality of Code Clones by Code Motion Transformation
title_sort study on enhancing quality of code clones by code motion transformation
publishDate 2011
url http://ndltd.ncl.edu.tw/handle/34279558660545825538
work_keys_str_mv AT qinxintu astudyonenhancingqualityofcodeclonesbycodemotiontransformation
AT túqínxīn astudyonenhancingqualityofcodeclonesbycodemotiontransformation
AT qinxintu yǐchéngshìmǎyídòngjìshùgǎishànchéngshìzhòngfùpiànduànpǐnzhìzhīyánjiū
AT túqínxīn yǐchéngshìmǎyídòngjìshùgǎishànchéngshìzhòngfùpiànduànpǐnzhìzhīyánjiū
AT qinxintu studyonenhancingqualityofcodeclonesbycodemotiontransformation
AT túqínxīn studyonenhancingqualityofcodeclonesbycodemotiontransformation
_version_ 1718384723439386624