On Experimenting refactoring tools to remove code smells Xp 2015 workshop.
-
Upload
emery-little -
Category
Documents
-
view
221 -
download
0
description
Transcript of On Experimenting refactoring tools to remove code smells Xp 2015 workshop.
On Experimenting refactoring tools to remove code smellsXp 2015 workshop
Introduction
Refactor = reusability, maintainability and readability
PG reluctant to refactor Does Tools helps?
Experiment
Masters students to Refactor Project in qualitascorpus http://qualitascorpus.com/
4 refactoring tools
Refactoring Tools
Eclipse IntelliJ IDEA
Commercial IDE Jdeodorant
Eclipse plugin only tools for smell detection and give suggestion step
for refactor RefactorIT
Commercial Eclipse plugin Analysis and refactor helper
Code Smell detect tools
iPlasma: free, detect 11 types of smells Jdeodorant: detect 4 types of smells InCode: comercial 10 code smell for C/C++/Java
Décor, CheckStyle, CodeProAnalytics, JBuilder
Code Smells
God Class, Brain Method, Brain Class, Data Clumps, Feature envy(class內聚性低 ), Intensive coupling, Long method, shotgun surgery, type checking
Which tool is more useful?
Eclipse
Can refactor most of smells Very user-friendly Can highly customized (high control on refactoring) Provide preview
IntelliJ IDEA
Many refactor options Less customizable than eclipse(less control on how
to refactoring) Sometimes crashes
RefactorIT
Similar to eclipse Less option than eclipse
JDeodorant
Auto detect & auto refactor But sometimes cause more bug Some crashes occur If auto refactor PG may unfamiliar with new code.
Which smell easier to remove by tool?
Easeist
Feature Envy Method should be moved to where Supported by Jdeodorant
Intensive Coupling Also can be fixed by move
type checking Polymorphism or State/Strategy pattern Support by eclipse/ Jdeodorant
hardest
God Class Brain Class
which tool is more useful for each smells?
Brain/God class/method
Eclipse the best intelliJ
Less refactor option Jdeodorant
have some problem but provide useful guide
Data clumps
Eclipse/intelliJ extract class (group data together)
Feature Envy
Jdeoderant auto detect and refactor
other tools can also do refactor
Intensive coupling
RefactorIT, Eclipse, IntelliJ
Long method
Extract method refactoring Eclipse, IntelliJ, RefactorIT(no preview) Jdeodorant may have some error
Shotgun surgery
Eclipse > intelliJ for execution time, usability, preview
Type Checking
Best is eclipse (usually have no problem) Jdeoderant (less intuitive)
Summary Eclipse the best IntelliJ
Many refactor option and analysis But sometimes crash
Jdeodorant Auto detect and auto refactor But both have some problem
RefactorIT Used like eclipse but less option