Uma Estratégia para implementar refatorações seguras no eclipse - Santos, Igor Nascimento (2017)
The process of software development is complex and requires well-defined processes about each phase of work. In the phase of implementation of the modules some care is taken so that the software obtains positive indexes in quality attributes. Poorly implemented software can decline in attributes such as maintainability and reusability. Software that is not maintainable has great chances of having a short period in the market. In order to improve problem points in the software, it is possible to use refactoring techniques. Software refactoring consists of improvements in the internal structure of a program, through transformations, maintaining the original behavior of the program. The Fowler catalog is one of the leading references in terms of refactoring. In it, refactorings are described informally, through determined steps, instructions for verifying the immutability of behavior and demonstrative examples. However, the use of such an approach to refactoring can cause errors and be very laborious, due to the manual way of doing it. Aiming to save developers from having to manually refactor their code, development tools such as Eclipse, Netbeans and Intellij Idea automate refactorings similar to those in the Fowler catalog. However, for various reasons, some refactorings available in these tools do not guarantee the preservation of program behavior. Studies show that it is possible to formalize refactorings so that program behavior can be guaranteed under certain conditions. One of these works is based on algebraic programming laws combined with laws for object-oriented programming. Using these laws, you can formalize any transformations between programs implemented in some object-oriented language, such as Java or C ++, and prove that the behavior is preserved. Observing the need for development tools to offer reliable refactorings, this work proposes a strategy for implementing correct refactorings in the Eclipse environment. This approach is based on the formalization of refactoring, implementation of refactorings following the formulated conditions and handling eventual cases of aliasing with techniques of data flow analysis. As a case study, we will deploy a secure version of Inline Temp refactoring for Java, performing patches and incrementing the version available in Eclipse. The static conditions that refactoring requires are implemented and verified normally. However, for the dynamic conditions, which involve verification of aliasing, an approach is proposed that generates evidentiary obligations described as assertive. It is a known fact that a good part of the developers have little contact with formalisms and formal refactorings. In this way, the instrumentation of the code with assertions can be little pragmatic. Aiming to reduce the test obligations generated by dynamic analysis, this work performs a study on data flow analysis, techniques and tools that implement pointer analysis. Thus, it will be possible not to implement a certain piece of code with assertions, when it does not show signs of aliasing.