A Scripting Environmentfor Refactoring Process Execution        Lee Wei Mar (馬立偉), Kuo Chen Wu (吳國禎)             and Hewij...
Outline• Introduction• Refactoring Commando• Usage Scenario• Conclusion                                   2
Introduction• Refactoring: program transformation that alters software internal   structure without breaking its external ...
Introduction (cont.)• Refactoring process properties    – Varies in terms of detection criteria, execution style, and expe...
Refactoring Commando: Screenshot                                   5
Refactoring Commando: Structural Design                                          6
Refactoring Commando: API        Category                 API Method                              Description             ...
Usage Scenario• Context   – A developer would like to locate and remove Feature Envy in ProjectA   – He has prior experien...
Usage Scenario(1) Find Possible Feature Envy Methods Import and execute script file            Procedure for Feature Envy ...
Usage Scenario   (2) Inspect Methods Using MAVISInspect method code with MAVIS               Building.landArea() is envied...
Usage Scenario                 (3) Construct Move Method Refactoring PlanMove Method Building.landArea() to Land          ...
Usage Scenario                           (4) Preview Refactoring Effectsplan.maChange()Preview refactoring metric change  ...
Usage Scenario                           (5) Preview Refactored Codeplan.maChange()plan.codeChange()Preview refactoring co...
Usage Scenario                    (6) Execute the Refactoring Planplan.maChange()plan.codeChange()                    chan...
Conclusion• Refactoring Commando has been proposed as a scripting environment  for refactoring process execution• A set of...
Thank YouLee Wei Mar (馬立偉)lwmar@nature.ee.ncku.edu.twDatabase & Software Engineering Lab, NCKU國立成功大學資料庫暨軟體工程實驗室
Upcoming SlideShare
Loading in …5
×

A Scripting Environment for Refactoring Process Execution

398 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
398
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

A Scripting Environment for Refactoring Process Execution

  1. 1. A Scripting Environmentfor Refactoring Process Execution Lee Wei Mar (馬立偉), Kuo Chen Wu (吳國禎) and Hewijin Christine Jiau (焦惠津)Institute of Computer and Communication Engineering, NCKU 國立成功大學 電腦與通信工程研究所 Speaker: Lee Wei Mar (馬立偉) Date: 07/08/2011
  2. 2. Outline• Introduction• Refactoring Commando• Usage Scenario• Conclusion 2
  3. 3. Introduction• Refactoring: program transformation that alters software internal structure without breaking its external behavior• General refactoring process Detection Proposal Transformation Identify software structural deficiencies Propose refactoring plan to alter structural deficiencies Execute the refactoring plan• Different tools are developed for different stages of the refactoring process 3
  4. 4. Introduction (cont.)• Refactoring process properties – Varies in terms of detection criteria, execution style, and expected effect, etc. – Requires to cascade different tools (session switches during execution) – Contains repetitive works inside single refactoring process instances – Shares similar work flow among different process instances• This work proposes Refactoring Commando, a scripting environment for assisting refactoring process execution – Unified command line interface for refactoring tools cascading – Programmable environment for batching repetitive works – Preserving developed procedure for future re-use 4
  5. 5. Refactoring Commando: Screenshot 5
  6. 6. Refactoring Commando: Structural Design 6
  7. 7. Refactoring Commando: API Category API Method Description aProject.getType(name) Get all types defined in aProject as a list Program Model Query aClass.methods() Get all methods defined in aClass as a list aClass.getSuperTypes() Get super-types of aClass aClass.atfd() Get an ATFD metrics abstraction of aClass Metric-based atfdMA.callees(m) Get a list of foreign fields called by method m Bad Smell Detection aMA.value() Get the metric value of metric abstraction aMA Bad Smell Inspection MavisAdapter.viz(method) Open MAVIS visualization of the given methodRefactoring Plan Proposal Refactory.createMM() Create Move Method refactoring plan plan.maChange () Preview overall metric abstraction changes of plan Refactoring Preview and Execution plan.execute() Execute the refactoring plan 7
  8. 8. Usage Scenario• Context – A developer would like to locate and remove Feature Envy in ProjectA – He has prior experience on using Refactoring Commando to detect Feature Envy• Scenario 1. Find Possible Feature Envy Methods (using pre-developed procedure) 2. Inspect Methods Using MAVIS 3. Construct Move Method Refactoring Plan 4. Preview Refactoring Effects 5. Preview Refactored Code 6. Execute the Refactoring Plan 8
  9. 9. Usage Scenario(1) Find Possible Feature Envy Methods Import and execute script file Procedure for Feature Envy Detection 9
  10. 10. Usage Scenario (2) Inspect Methods Using MAVISInspect method code with MAVIS Building.landArea() is envied to Land 10
  11. 11. Usage Scenario (3) Construct Move Method Refactoring PlanMove Method Building.landArea() to Land 11
  12. 12. Usage Scenario (4) Preview Refactoring Effectsplan.maChange()Preview refactoring metric change 12
  13. 13. Usage Scenario (5) Preview Refactored Codeplan.maChange()plan.codeChange()Preview refactoring code change 13
  14. 14. Usage Scenario (6) Execute the Refactoring Planplan.maChange()plan.codeChange() change appliedplan.execute() 14
  15. 15. Conclusion• Refactoring Commando has been proposed as a scripting environment for refactoring process execution• A set of APIs is provided in Refactoring Commando to support all stages of a refactoring process• An usage scenario is presented to demonstrate the usefulness of Refactoring Commando – Collaboration with other plugins for ensuring refactoring process integrity – Batching repetitive refactoring works with programmable procedure – Preservation of procedures for future re-use in similar refactoring tasks 15
  16. 16. Thank YouLee Wei Mar (馬立偉)lwmar@nature.ee.ncku.edu.twDatabase & Software Engineering Lab, NCKU國立成功大學資料庫暨軟體工程實驗室

×