Generation of refactoring algorithms by grammatical evolution
Generation of refactoring algorithms by grammatical evolution
复制标题
DOI:
10.1007/s10664-022-10151-4
复制
发表时间:
2022-05
影响因子:
4.1
通讯作者:
Thainá Mariani;Marouane Kessentini;S. Vergilio
中科院分区:
文献类型:
--
作者:
Thainá Mariani;Marouane Kessentini;S. Vergilio
Recent machine learning studies present accurate results generating prediction models to identify refactoring operations for a program. However, such works are limited to prediction, i.e., they learn refactoring operations strictly as applied by developers, but there are possibilities that they might not think. On the other hand, theSearch-Based Software Refactoring (SBR)field applies search algorithms to find refactoring operations in a vast space of possibilities to improve diverse quality attributes. Nevertheless, existing SBR approaches do not generate a model as machine learning studies, and then, they need to be reapplied individually for each program needing refactoring. To mitigate this limitation, this work introduces a novel SBR learning approach that generates refactoring algorithms capable of providing refactoring operations to several programs. These algorithms are composed of procedures that use rules to determine the refactoring operations. To create the algorithms, a learning process first extracts refactoring patterns from programs by grouping their elements that were refactored in similar ways. After that, aGrammatical Evolution (GE)is applied to generate the algorithms based on a grammar encompassing details of the extracted patterns. GE works to generate an algorithm that provides refactoring operations similar to those applied in practice while improving quality attributes, such as modularity. The approach is evaluated using refactoring data from 40 Java programs of GitHub repositories. The algorithms are tested against different programs, obtaining an overall average of 60% of modularity improvement and 50% of similarity with actual refactoring operations.