mavis: a visualization tool for cohesion-based bad smell inspection

19
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 國立成功大學 電腦與通信工程研究所

Upload: -

Post on 09-Jul-2015

351 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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 國立成功大學 電腦與通信工程研究所

Page 2: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Outline

• Introduction

• Empirical Investigation

• MAVIS Visualization Tool

• Evaluation

• Conclusion

2

Page 3: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 4: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 5: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Empirical Investigation (cont.)

• The data from two studies are analyzed

• Observations

5

Page 6: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Empirical Investigation (cont.)

• The data from two studies are analyzed

• Observations

– A large number of bad smell candidates are detected by BSD tools

6

Page 7: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 8: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 9: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 10: MAVIS: A Visualization Tool for Cohesion-based 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

Page 11: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

MAVIS Visualization Tool

11

Page 12: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 13: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

MAVIS Visualization Tool

13

Page 14: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Source Code Navigation in MAVIS

14

Page 15: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Evaluation (cont.)

15

• Inspecting candidates with MAVIS – Subjects

• HSQLDB / 199 KLOC

• JEdit / 133 KLOC

– Utilized BSD tool

• JDeodorant

Page 16: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Evaluation (cont.)

• Half of the candidates are false positives

16

Page 17: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 18: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

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

Page 19: MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection

Thank You

Lee Wei Mar (馬立偉)

[email protected]

Database & Software Engineering Lab, NCKU

國立成功大學

資料庫暨軟體工程實驗室