Font Size: a A A

Refactoring Method And Tool Base On Design Patterns

Posted on:2005-08-12Degree:MasterType:Thesis
Country:ChinaCandidate:J YinFull Text:PDF
GTID:2168360125450338Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Through the software life cycle, most of the developed software sy-stems need to be modified for accommodating requirements changes, or their program modules must be appropriately adapted so as to be reusedin other application contexts. Very often, this kind of maintenance activities requires a very high cost effort, in the sense that the program modules expensively certified through robust verification and testing activities must be certified again against the changes to the software system, and such activities continue to occur until its retirement. To cope with such problems related to software maintenance, we need a systematic and safe approach to modifying the software system, which may be either of a running one or legacy one.Refactoring is a safe program restructuring technique that can guarantee the restructured program to preserve the behavior of the original program. Various refactoring techniques have been proposed to modify the software structure which can be represented in the class diagram of UML, and also to transform the program in an automated way based on some quantitative metric or static analysis on the source code. In common, a refactoring technique provides a set of primitive refactoring operations, and allows such primitive operations to be sequentially and combinatorially composed into a high-level refactoring rule, which may involveseveral software quality issues such as higher modularity,performance improvement, lower code redundancy, and so on.Design patterns are a collection of recurring patterns of relationships among classes, objects, methods, etc. Each design pattern describes its own application area, structure/ behavior pattern, and rationale. Thus, the rationale and application area can be used as a good goal for high-level refactoring. The design patterns are widely used because they provide design-level reusability, understandability, and flexibility. Especially, the flexibility affords to be focused on in the sense that the program can be formed more openended and less sensitive to the requirements change.The restructurings we develop in this thesis will be those that automate the introduction of design patterns to an existing object-oriented program.The scenario we consider is as follows: An existing program is being extended with a new requirement. After studying the code and the new requirement,the designer concludes that the existing program structure makes the desired extension di.cult to achieve, and that the application of some particular design pattern would introduce the necessary .exibility to the program. It is at this point that we aim to provide automated tool support. The designer selects the design pattern to be applied and the program components that are to take part in the restructuring, and our tool applies that design pattern to the given program components in such a way that program behaviour is maintained.our aim is to remove the burden of tedious and error-prone code reorganisation from the designer.In this thesis we will present and validate a methodology for the development of automated design pattern transformations.Our work is base the programe invariant of Opdyke and compositerefactoring of Robert in which we compose refactorings,and present a technique for computing the pre- and postconditions of a composite refactoring. The importance of these techniques lies in the fact that they allow us to implement a design pattern refactoring as a composition of refactorings and then to check the legality of the composition and calculate its overall precondition. Design pattern transformations have astrong degree of commonality and this paper describes five design pattern refactorings.These refactoring have been implemented and demonstrated to be widely applicable in design evolvement development.This thesis design and implementation a design pattern refactoring prototype tools,and implementation five design pattern refactoring that hava been discussed in this thesis.Template method pattern refactoring and strategy pattern provide two kind reus...
Keywords/Search Tags:Refactoring
PDF Full Text Request
Related items