Code evolves as technology and market demands evolve. Over time, existing code may need to be changed to allow more room to grow, to improve performance, to accommodate changing needs, or simply to clean up the code base. Refactoring is the term used to describe the process of redesigning existing code without changing its behavior from the user's point of view.
Refactoring may be small or extensive, but even small changes can introduce bugs. Refactoring must be done correctly and completely to be effective. One change can have permutations throughout the entire code base. Refactoring handles the entire set of permutations responsibly and durably, with safe operation, so that no behavior is changed beyond improvements in performance or maintainability.
Refactoring support is now expected in typed language IDEs but is not readily available in dynamic language IDEs. It is difficult to perform automated refactorings for dynamic languages since type information is not statically available. 3rdRail provides refactorings by performing advanced type inference (statically analyzing a program to determine types) and semantic type inference (statically analyzing a program in the context of the specific frameworks semantics).
For a demonstration of refactoring, see the video Refactor a Rails Action.
To perform a refactoring:
Tip: |
If the item selected is not a controller, view or action, the Rename Rails Item is displayed but disabled. |
Warning: |
Dynamic language refactoring can not be guaranteed to be 100% accurate. Testing after refactoring is encouraged. |
Tip: |
Where changes are not made in the , Undo Refactoring from the workbench:
|