Removing Code Clones from Industrial Systems Using Compiler Directives
Citations Over TimeTop 10% of 2017 papers
Abstract
Refactoring of code clones is an effective method for improving software maintainability. Existing studies have proposed automated techniques and tools for refactoring. However, it is difficult to apply refactoring to our industrial systems in practice because of three main reasons. First, we have many industrial systems written in COBOL which requires a particular refactoring method compared with current techniques because Type-2 clones in COBOL are generated by renaming parts of identifiers. Second, nested clones must be refactored, in which an instance of a clone set is contained within an instance of another clone set. They also make it difficult to estimate the reduction size by refactoring. Third, refactoring requires testing which is time-consuming and laborious. To overcome these problems, we developed an approach for refactoring of Type-2 clones in COBOL programs. Our approach identifies actual refactorable clone sets and includes a string comparison technique to parameterize partial differences in identifier names. The clone sets are extracted as shared code fragments and transformed into the refactored code using compiler directives. It is easy to confirm that refactoring using compiler directives preserves program behavior, because they do not change program structure. We also provide a method that makes it possible to refactor nested clones by ordering their refactoring. This method enables to estimate how many lines can be reduced by refactoring. We applied the approach to four industrial systems to assess how many lines can be reduced. The results show that the lines could be reduced by 10 to 15% and one system was reduced by 27%. We also discuss the parameter number required for our refactoring approach.
Related Papers
- → A quantitative evaluation of maintainability enhancement by refactoring(2003)175 cited
- → Empirical study on refactoring large-scale industrial systems and its effects on maintainability(2016)41 cited
- → A field study of the relationship of information flow and maintainability of COBOL programs(1995)9 cited
- → Assessing the impact of refactoring activities on the JHotDraw project(2010)3 cited
- Transforming COBOL Legacy Software to a Generic Imperative Model(2012)