mavis: a visualization tool for cohesion-based bad smell inspection
TRANSCRIPT
MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection
Lee Wei Mar (馬立偉), Ming Lun Lee (李明倫) and Hewijin Christine Jiau (焦惠津)
Speaker: Lee Wei Mar (馬立偉)
Date: 07/08/2011
Institute of Computer and Communication Engineering, NCKU 國立成功大學 電腦與通信工程研究所
Outline
• Introduction
• Empirical Investigation
• MAVIS Visualization Tool
• Evaluation
• Conclusion
2
Introduction
• Cohesion-based Bad Smells are structural deficiencies that violet “high cohesion and low coupling principle”
– Feature Envy
– God Class
– Long Method
• Cohesion-based bad smells are common refactoring targets during software evolution
• Many bad smell detection (BSD) tools have been developed for suggesting cohesion-based bad smell candidates – The judgment of candidates still relies on developers’ expertise
3
Empirical Investigation
• Utilizing two BSD tool, InCode and JDeodorant, for bad smell removal
• Conduction steps
1. Use BSD tool in finding Feature Envy candidates on a in Lab project: CARE
2. For each feature envy candidates, a developer inspect source code to answer
a. Is it an Feature Envy?
b. If it is a Feature Envy, can it be resolved by Move Method (MM)?
• The data from two studies are analyzed
4
Empirical Investigation (cont.)
• The data from two studies are analyzed
• Observations
5
Empirical Investigation (cont.)
• The data from two studies are analyzed
• Observations
– A large number of bad smell candidates are detected by BSD tools
6
Empirical Investigation (cont.)
• The data from two studies are analyzed
• Observations
– A large number of bad smell candidates are detected by BSD tools
– The developer rejects about 60% of the detected candidates
7
Empirical Investigation (cont.)
• The data from two studies are analyzed
• Observations
– A large number of bad smell candidates are detected by BSD tools
– The developer rejects about 60% of the detected candidates
– Small portion of candidates can be directly removed as suggested by BSD tools
8
Empirical Investigation (cont.)
• The data from two studies are analyzed
• Observations
– A large number of bad smell candidates are detected by BSD tools
– The developer rejects about 60% of the detected candidates
– Small portion of candidates can be directly removed as suggested by BSD tools
9
Tool support is required during bad smell inspection
MAVIS Visualization Tool
• MAVIS (Metric Abstraction VISualization) aims to – provide visualization for inspecting cohesion-based bad smell
candidates returned by BSD tools
– visualize metric abstractions, the linkage between software code structure and software metrics, for exposing the bad smell symptoms
– link visualization to corresponding code for locating symptomatic code during code inspection
10
MAVIS Visualization Tool
11
MAVIS Visualization Tool
12
• Data accessing metric abstractions • ATLD: Access to local data • ATFD: Access to foreign data
• Message passing metric abstractions
• LMP: Local message passing • MPC: Message passing coupling
MAVIS Visualization Tool
13
Source Code Navigation in MAVIS
14
Evaluation (cont.)
15
• Inspecting candidates with MAVIS – Subjects
• HSQLDB / 199 KLOC
• JEdit / 133 KLOC
– Utilized BSD tool
• JDeodorant
Evaluation (cont.)
• Half of the candidates are false positives
16
Evaluation (cont.)
• Half of the candidates are false positives
• 1/3 of the candidates can be directly judged using MAVIS visualization
• The code inspection effort for these candidates are eliminated
17
Conclusion
• Cohesion-based bad smell removal is a human intensive activity that requires supports for decision making
• MAVIS is proposed for assisting cohesion-based bad smell inspection
– visualizing metric sensitive structural information
– navigating code through metric abstractions
• Two case studies are performed to confirm the effectiveness of MAVIS
– 1/3 of the source code inspection effort are reduced by using MAVIS
18
Thank You
Lee Wei Mar (馬立偉)
Database & Software Engineering Lab, NCKU
國立成功大學
資料庫暨軟體工程實驗室