Local Independence Transformation and Its Application to Removing Nonduplicate Statements in Code Clones
نویسندگان
چکیده
This paper proposes a new program transformation technique and describes its application to removing nonduplicate statements in code clones while preserving the semantics of the program. Allowing nonduplicate statements in code clones helps in finding larger code clones. However, the nonduplicate statements in code clones may induce unexpected difficulty and complexity when we analyze the software systems. In this paper, we propose a new technique of program transformation, called local independence transformation. The transformation analyzes the definitions of variables, and replaces the uses of the variables with their definitions in terms of constants and nonlocal variables, when possible. With the proposed transformation, some of the nonduplicate statements in code clones may be transformed into locally independent statements and hence may be moved out of the code clones while preserving the semantics of the program. Based on the new technique, we develop a threestep framework for moving the nonduplicate statements out of code clones. In the experiments on the wget source code, our approach successfully moves more than 77.9% of the nonduplicate statements out of the code clones.
منابع مشابه
The Concept of Sub-independence and Its Application in Statistics and Probabilities
Many Limit Theorems, Convergence Theorems and Characterization Theorems in Probability and Statistics, in particular those related to normal distribution , are based on the assumption of independence of two or more random variables. However, the full power of independence is not used in the proofs of these Theorems, since it is the distribution of summation of the random variables whic...
متن کاملبررسی حساسیت تودههای پیاز ایرانی به بیماری ریشهسرخی
Pink root-rot disease caused by Pyrenochaeta terrestris is one of the serious diseases of onion fields in Iran and the world. The use of resistant cultivars might be a good alternative as suggested on the basis of the screening at the near end of growing season. The susceptibility assessment of 43 Iranian onion clones in glass-house condition in Isfahan for the last two successive years i.e. 20...
متن کاملبررسی حساسیت تودههای پیاز ایرانی به بیماری ریشهسرخی
Pink root-rot disease caused by Pyrenochaeta terrestris is one of the serious diseases of onion fields in Iran and the world. The use of resistant cultivars might be a good alternative as suggested on the basis of the screening at the near end of growing season. The susceptibility assessment of 43 Iranian onion clones in glass-house condition in Isfahan for the last two successive years i.e. 20...
متن کاملSystematic Removal of Nondeterminism for Code Generation in I O Automata
The Input Output I O automaton model developed by Lynch and Tuttle models components in asynchronous concurrent systems as labeled transition systems IOA is a precise language for de scribing I O automata and for stating their properties A toolset is being developed for IOA to support distributed software design and implemen tation One of the tools consists of a user assisted code generator fro...
متن کاملAn Algorithm for Detecting and Removing Clones in Java Code
This paper proposes a new algorithm for automatically detecting and removing duplicated code in existing Java programs. Its purpose is to improve the structure of small code snippets (as in refactoring), rather than reducing the overall redundancy in huge legacy programs. As such, approaches that favor code clarity over efficiency are introduced. The skeleton of our algorithm is presented and i...
متن کامل