SlideShare a Scribd company logo
1 of 16
A Scripting Environment
for 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
Outline

• Introduction
• Refactoring Commando
• Usage Scenario
• Conclusion




                                   2
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
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
Refactoring Commando: Screenshot




                                   5
Refactoring Commando: Structural Design




                                          6
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 method

Refactoring 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
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
Usage Scenario
(1) Find Possible Feature Envy Methods

 Import and execute script file




            Procedure for Feature Envy Detection
                                                   9
Usage Scenario
   (2) Inspect Methods Using MAVIS



Inspect method code with MAVIS




               Building.landArea() is envied to Land




                                                   10
Usage Scenario
                 (3) Construct Move Method Refactoring Plan




Move Method Building.landArea() to Land




                                                              11
Usage Scenario
                           (4) Preview Refactoring Effects




plan.maChange()

Preview refactoring metric change




                                                             12
Usage Scenario
                           (5) Preview Refactored Code




plan.maChange()



plan.codeChange()

Preview refactoring code change




                                                         13
Usage Scenario
                    (6) Execute the Refactoring Plan




plan.maChange()



plan.codeChange()

                    change
                    applied
plan.execute()




                                                       14
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
Thank You
Lee Wei Mar (馬立偉)
lwmar@nature.ee.ncku.edu.tw
Database & Software Engineering Lab, NCKU
國立成功大學
資料庫暨軟體工程實驗室

More Related Content

Viewers also liked (9)

PraveenKH_Resume
PraveenKH_ResumePraveenKH_Resume
PraveenKH_Resume
 
Resume
ResumeResume
Resume
 
127 hours
127 hours127 hours
127 hours
 
The Democracy that Mexico Needs by Napoleon Gomez
The Democracy that Mexico Needs by Napoleon GomezThe Democracy that Mexico Needs by Napoleon Gomez
The Democracy that Mexico Needs by Napoleon Gomez
 
320f15 week2
 320f15 week2 320f15 week2
320f15 week2
 
Camunda Community Day_Wiener BPM Offensive
Camunda Community Day_Wiener BPM OffensiveCamunda Community Day_Wiener BPM Offensive
Camunda Community Day_Wiener BPM Offensive
 
Process Monitoring mit Camunda
Process Monitoring mit Camunda Process Monitoring mit Camunda
Process Monitoring mit Camunda
 
sixt_case_study
sixt_case_studysixt_case_study
sixt_case_study
 
Data profiling-best-practices
Data profiling-best-practicesData profiling-best-practices
Data profiling-best-practices
 

Similar to A Scripting Environment for Refactoring Process Execution

Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of PatternsChris Eargle
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Raffi Khatchadourian
 
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfKAI CHU CHUNG
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App EngineInphina Technologies
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Rossen Stoyanchev
 
Queuing model based load testing of large enterprise applications
Queuing model based load testing of large enterprise applicationsQueuing model based load testing of large enterprise applications
Queuing model based load testing of large enterprise applicationsLeonid Grinshpan, Ph.D.
 
QTP Interview Questions and answers
QTP Interview Questions and answersQTP Interview Questions and answers
QTP Interview Questions and answersRita Singh
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationAndreas Kurtz
 
Serenity Project: Security in Software Enginering
Serenity Project: Security in Software EngineringSerenity Project: Security in Software Enginering
Serenity Project: Security in Software EngineringFrancisco Sanchez Cid
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design PatternRothana Choun
 
walkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventionswalkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventionswalkmod
 
ACTRESS: Domain-Specific Modeling of Self-Adaptive Software Architectures
ACTRESS: Domain-Specific Modeling of Self-Adaptive Software ArchitecturesACTRESS: Domain-Specific Modeling of Self-Adaptive Software Architectures
ACTRESS: Domain-Specific Modeling of Self-Adaptive Software ArchitecturesFilip Krikava
 
Application cloudification with liberty and urban code deploy - UCD
Application cloudification with liberty and urban code deploy - UCDApplication cloudification with liberty and urban code deploy - UCD
Application cloudification with liberty and urban code deploy - UCDDavide Veronese
 
SOFTWARE VERIFICATION & VALIDATION
SOFTWARE VERIFICATION & VALIDATIONSOFTWARE VERIFICATION & VALIDATION
SOFTWARE VERIFICATION & VALIDATIONAmin Bandeali
 

Similar to A Scripting Environment for Refactoring Process Execution (20)

Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
 
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
 
Devops
DevopsDevops
Devops
 
defense_PPT
defense_PPTdefense_PPT
defense_PPT
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App Engine
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2
 
Queuing model based load testing of large enterprise applications
Queuing model based load testing of large enterprise applicationsQueuing model based load testing of large enterprise applications
Queuing model based load testing of large enterprise applications
 
QTP Interview Questions and answers
QTP Interview Questions and answersQTP Interview Questions and answers
QTP Interview Questions and answers
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
 
Serenity Project: Security in Software Enginering
Serenity Project: Security in Software EngineringSerenity Project: Security in Software Enginering
Serenity Project: Security in Software Enginering
 
Devops course content
Devops course contentDevops course content
Devops course content
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
walkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventionswalkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventions
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
ACTRESS: Domain-Specific Modeling of Self-Adaptive Software Architectures
ACTRESS: Domain-Specific Modeling of Self-Adaptive Software ArchitecturesACTRESS: Domain-Specific Modeling of Self-Adaptive Software Architectures
ACTRESS: Domain-Specific Modeling of Self-Adaptive Software Architectures
 
Application cloudification with liberty and urban code deploy - UCD
Application cloudification with liberty and urban code deploy - UCDApplication cloudification with liberty and urban code deploy - UCD
Application cloudification with liberty and urban code deploy - UCD
 
SOFTWARE VERIFICATION & VALIDATION
SOFTWARE VERIFICATION & VALIDATIONSOFTWARE VERIFICATION & VALIDATION
SOFTWARE VERIFICATION & VALIDATION
 

Recently uploaded

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

A Scripting Environment for Refactoring Process Execution

  • 1. A Scripting Environment for 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. Outline • Introduction • Refactoring Commando • Usage Scenario • Conclusion 2
  • 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. 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
  • 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 method Refactoring 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. 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. Usage Scenario (1) Find Possible Feature Envy Methods Import and execute script file Procedure for Feature Envy Detection 9
  • 10. Usage Scenario (2) Inspect Methods Using MAVIS Inspect method code with MAVIS Building.landArea() is envied to Land 10
  • 11. Usage Scenario (3) Construct Move Method Refactoring Plan Move Method Building.landArea() to Land 11
  • 12. Usage Scenario (4) Preview Refactoring Effects plan.maChange() Preview refactoring metric change 12
  • 13. Usage Scenario (5) Preview Refactored Code plan.maChange() plan.codeChange() Preview refactoring code change 13
  • 14. Usage Scenario (6) Execute the Refactoring Plan plan.maChange() plan.codeChange() change applied plan.execute() 14
  • 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. Thank You Lee Wei Mar (馬立偉) lwmar@nature.ee.ncku.edu.tw Database & Software Engineering Lab, NCKU 國立成功大學 資料庫暨軟體工程實驗室