BARBOSA, Fernando Sérgio; AGUIAR, Ademar (2013) - Removing code duplication with roles. In International conference on Intelligent Software Methodologies, Tools and Techniques, 12, Budapeste, 22-24 de setembro. [S.l.]: IEEE. p. 1-6
Title
Removing code duplication with roles
Subject
Roles Code duplication Refactoring
Date
2013-12-02T11:29:47Z 2013-12-02T11:29:47Z 2013-09
Description
The existence of replicated code in a system makes that system harder to maintain and evolve. To remove replicated code the usual way is to use refactorings. However there are always clones that cannot be removed by refactorings alone. Some are due to lack of composition mechanisms in the underlying programming language. We propose the use of roles to remove such clones since roles provide a finer degree of composition. We sketch four role refactorings to remove code clones and apply them in a case study using the JHotDraw framework. Results show that roles have a positive impact in clone reduction as they were able to remove almost all clones traditional refactorings could not.