BUSCA POR OPORTUNIDADES DE REFATORAÇÃO PARA APLICAÇÃO DE PADRÕES DE PROJETO
PAULI, Guinther de Bitencourt. SEARCHING FOR REFACTORING OPPORTUNITIES TO APPLY DESIGN PATTERNS. 2014. 98 f. Dissertação (Mestrado em Ciência da Computação) - Universidade Federal de Santa Maria, Santa Maria, 2014.
Pauli, Guinther de Bitencourt
It is difficult to maintain and to adapt poorly written code presenting shortcomings in its structure. Refactoring techniques are used to improve the source code and the structure of applications, making them better and easier to modify. Design patterns are reusable solutions used in similar problems in object-oriented systems, so there is no need to recreate the solutions. Applying design patterns in the context of refactoring in a corrective way becomes a desired activity in the life cycle of a specific software system. However, for medium and large-scale projects, the manual examination of artifacts to find problems and opportunities to apply a design pattern is a hard task. In this context, we present a set of metric-based heuristic functions to detect where a design pattern can be applied in a given project, more specifically, the Strategy, Factory Method, Template Method, Creation Method and Chain Constructors patterns. To evaluate the heuristic functions and its results we have also built a tool to show the results. This tool can examine source code traversing ASTs (Abstract Syntax Trees), searching for opportunities to apply the patterns, indicating the exact location in the source code where the pattern is suggested, also showing some evidences used in the detection.