SABINO, M. M. C. L.; http://lattes.cnpq.br/7535849756393864; SABINO, Melina Mongiovi Cunha Lima.
Resumo:
Refactorings are transformations that improve the internal structure of the program while
preserving its observable behavior. In practice, developers use regression tests and refactoring tools to ensure that the refactoring has preserved the behavior of the program. However, refactoring tools may have bugs. In addition, the test suite may be modified by the transformation applied manually or using a refactoring tool. If the transformation is applied incorrectly, it can change the test suite by disabling it to detect the behavioral change. Finally, the test suite may be inappropriate to test the transformation because the test cases may not exercise the change. This problem can get worse if the test suite is large. This way, it is time consuming executing the entire test suite. We propose an approach for evaluating whether a transformation is behavior preserving based on change impact analysis. This approach performs a change impact analysis and it automatically generates tests only to the methods impacted by the transformation. We implemented a tool called SafeRefactorlmpact to evaluate behavior preservation. It uses Safira, a tool that we implemented to identify the methods impacted by a change in the program. We evaluate SafeRefactorlmpact in a set of 10 transformations applied to a real system and to a technique to test refactoring implementations. Moreover, we compared the SafeRefactorlmpact with SafeRefactor, a tool that also evaluates whether a transformation preserves the program behavior. The difference is that SafeRefactor does not use the impact analysis. The SafeRefactorlmpact managed to identify behavioral changes not identified by SafeRefactor; it reduced in 60% the total time to analyze the refactoring implementations; it showed to be less sensitive to the time limit to generate the tests; and the impact analysis allows the reduction of some limitations of the automatic tests generator faced by the SafeRefactor.