1 Predicting Classes in Need of Refactoring – An Application of Static Metrics Liming Zhao Jane Hayes 23 September 2006.

Slides:



Advertisements
Similar presentations
Ranking Refactoring Suggestions based on Historical Volatility Nikolaos Tsantalis Alexander Chatzigeorgiou University of Macedonia Thessaloniki, Greece.
Advertisements

Elif Kongar*, Mahesh Baral and Tarek Sobh *Departments of Technology Management and Mechanical Engineering University of Bridgeport, Bridgeport, CT, U.S.A.
Using UML, Patterns, and Java Object-Oriented Software Engineering Royce’s Methodology Chapter 16, Royce’ Methodology.
Automated Software Maintainability through Machine Learning by Eric Mudge.
T. E. Potok - University of Tennessee CS 594 Software Engineering Lecture 2 Dr. Thomas E. Potok
Prediction of fault-proneness at early phase in object-oriented development Toshihiro Kamiya †, Shinji Kusumoto † and Katsuro Inoue †‡ † Osaka University.
What causes bugs? Joshua Sunshine. Bug taxonomy Bug components: – Fault/Defect – Error – Failure Bug categories – Post/pre release – Process stage – Hazard.
Software Quality Metrics
© S. Demeyer, S. Ducasse, O. Nierstrasz Duplication.1 7. Problem Detection Metrics  Software quality  Analyzing trends Duplicated Code  Detection techniques.
Soft. Eng. II, Spr. 02Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 6 Title : The Software Quality Reading: I. Sommerville, Chap: 24.
Requirements Analysis 5. 1 CASE b505.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis CASE Computer.
CSE 300: Software Reliability Engineering Topics covered: Software metrics and software reliability.
1 Info 1409 Systems Analysis & Design Module Lecture 8 – Modelling tools and techniques HND Year /9 De Montfort University.
Chapter 1 Assuming the Role of the Systems Analyst
SE is not like other projects. l The project is intangible. l There is no standardized solution process. l New projects may have little or no relationship.
Object Oriented Metrics XP project group – Saskia Schmitz.
Advanced Topics in Software Engineering ATSE 2009 Topics, participants and results Gordana Rakic, Zoran Budimac.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 27 Slide 1 Quality Management 1.
Software Metrics *** state of the art, weak points and possible improvements Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics, Faculty.
How good are your testers? An assessment of testing ability Liang Huang, Chris Thomson and Mike Holcombe Department of Computer Science, University of.
A Survey of Software Refactoring Tom Mens, Tom Tourwé
Modeling Practices in Open Source Software OSS 2013 Koper-Capodistria, Slovenia Omar Badreddin Post Doctoral Fellow, University of Ottawa
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
Japan Advanced Institute of Science and Technology
Estimate of Swimming Energy Expenditure Utilizing an Omnidirectional Accelerometer and Swim Performance Measures Jeanne D. Johnston and Joel M. Stager,
Chapter 3: Software Maintenance Process Omar Meqdadi SE 3860 Lecture 3 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
SWEN 5430 Software Metrics Slide 1 Quality Management u Managing the quality of the software process and products using Software Metrics.
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
PAPER PRESENTATION: EMPIRICAL ASSESSMENT OF MDE IN INDUSTRY Erik Wang CAS 703.
Mining and Analysis of Control Structure Variant Clones Guo Qiao.
Software Measurement & Metrics
This chapter is extracted from Sommerville’s slides. Text book chapter
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 15b: Product Metrics for Software Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Samad Paydar Web Technology Lab. Ferdowsi University of Mashhad 10 th August 2011.
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet,
Predicting Accurate and Actionable Static Analysis Warnings: An Experimental Approach J. Ruthruff et al., University of Nebraska-Lincoln, NE U.S.A, Google.
Object Oriented Reverse Engineering JATAN PATEL. What is Reverse Engineering? It is the process of analyzing a subject system to identify the system’s.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University 1 Towards an Assessment of the Quality of Refactoring.
1 Metrics and lessons learned for OO projects Kan Ch 12 Steve Chenoweth, RHIT Above – New chapter, same Halstead. He also predicted various other project.
Lecture 4. IS Planning & Acquisition To be covered: To be covered: – IS planning and its importance Cost-benefit analysis Cost-benefit analysis Funding.
CSc 461/561 Information Systems Engineering Lecture 5 – Software Metrics.
Software Architecture Evaluation Methodologies Presented By: Anthony Register.
Generating Software Documentation in Use Case Maps from Filtered Execution Traces Edna Braun, Daniel Amyot, Timothy Lethbridge University of Ottawa, Canada.
West Virginia University Sherif Yacoub, Hany H. Ammar, and Ali Mili A UML Model for Analyzing Software Quality Sherif Yacoub, Hany H. Ammar, and Ali Mili.
Survey of Tools to Support Safe Adaptation with Validation Alain Esteva-Ramirez School of Computing and Information Sciences Florida International University.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Presented by Lu Xiao Drexel University Quantifying Architectural Debt.
DevCOP: A Software Certificate Management System for Eclipse Mark Sherriff and Laurie Williams North Carolina State University ISSRE ’06 November 10, 2006.
Chapter 1 Assuming the Role of the Systems Analyst.
1 Week 7 Software Engineering Spring Term 2016 Marymount University School of Business Administration Professor Suydam.
1 IT system and data validation process in Latvian CPI/HICP Prepared by Oskars Alksnis, Central Statistical Bureau of Latvia EU Twinning Project Forwarding.
Experience Report: System Log Analysis for Anomaly Detection
School of Business Administration
A Hierarchical Model for Object-Oriented Design Quality Assessment
Assessment of Geant4 Software Quality
Software Metrics 1.
Object-Oriented Software Engineering Using UML, Patterns, and Java,
MultiRefactor: Automated Refactoring To Improve Software Quality
Object-Oriented Metrics
Design Metrics Software Engineering Fall 2003
Design Metrics Software Engineering Fall 2003
Software Engineering Experimentation
Predict Failures with Developer Networks and Social Network Analysis
A code metric tool for Software Engineering
Quality Measurable characteristic Cyclomatic complexity Cohesion
Chapter 19 Technical Metrics for Software
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
PPT6: Object-oriented design
Recommending Adaptive Changes for Framework Evolution
Presentation transcript:

1 Predicting Classes in Need of Refactoring – An Application of Static Metrics Liming Zhao Jane Hayes 23 September International PROMISE Workshop Predicting Classes in Need of Refactoring – An Application of Static Metrics Liming Zhao Jane Hayes 23 September International PROMISE Workshop

2 Predicting Classes in Need of Refactoring: An Application of Static Metrics Motivation Motivation Related work Related work Design of the tool Design of the tool Study design Study design Study results Study results Conclusions and future work Conclusions and future work

3 Motivation Cost of software maintenance Cost of software maintenance Refactoring Refactoring Importance of refactoring planning Importance of refactoring planning Need for improving multiple classes Need for improving multiple classes Deadlines, human resources, budgets Deadlines, human resources, budgets

4 Refactoring steps Identify code segments Identify code segments Evaluate possible costs and benefits Evaluate possible costs and benefits Develop refactoring plan Develop refactoring plan Apply the refactorings Apply the refactorings

5 Why use a class-based approach? Common programmer(s) Common programmer(s) Cohesive code Cohesive code Learning effect Learning effect Comprehension overhead Comprehension overhead

6 Code Repository Analysis ComplexitySizeCouplingHistory Maintainability Prediction Model Maintainability Measurement & Prediction Component (MMPC) Cost-Benefits Estimation Candidate Classes Refactoring Planning Cost & Benefit Estimation Component (CBEC) Proposed approach Visualizer Prioritized Class List Managers Cost Benefits

7 Design of the tool Size Maintainability Prediction Model Complexity Coupling Refactoring Planning Candidate Classes History Code Repository Analysis

8 Related work: Maintainability assessment OO metrics – Chidamber and Kemerer [1994] OO metrics – Chidamber and Kemerer [1994] MI – Welker [1995] MI – Welker [1995] PM and MP – Hayes et al. [2004] PM and MP – Hayes et al. [2004] Assessment of UML artifacts - Hassan et al. [2005] Assessment of UML artifacts - Hassan et al. [2005] RDC ratio – Hayes and Zhao [2005] RDC ratio – Hayes and Zhao [2005]

9 Related work: Refactoring Preconditions – Opdyke [1992] Preconditions – Opdyke [1992] Bad smells – Fowler et al. [1999] Bad smells – Fowler et al. [1999] Detecting bad smells – Mens et al. [2003] Detecting bad smells – Mens et al. [2003] Member similarity – Simon et al. [2001] Member similarity – Simon et al. [2001]

10 Metrics examined Halstead metrics Halstead metrics Cyclomatic complexity Cyclomatic complexity Weighted method per class Weighted method per class Maintainability index Maintainability index

11 Class-based rank Cost concern Cost concern Priority class list Priority class list Individual rank Individual rank Comprehensive rank Comprehensive rank

12 Code repository analysis and metrics collection Code repository analyzer Code repository analyzer Java front end Java front end Abstract syntax tree Abstract syntax tree Metrics Metrics Complexity Complexity Size Size Other Other Weighted maintainability rank (WMR) Weighted maintainability rank (WMR)

13 Initial validation on student projects Objective of the study Objective of the study Measures examined Measures examined Tool ’ s performance Tool ’ s performance Programmers ’ decisions Programmers ’ decisions Tool vs. programmer Tool vs. programmer Time spent Time spent

14 Study design Participants: Graduate students in computer science Participants: Graduate students in computer science Subjects: Java source code (20 classes) from software engineering class project Subjects: Java source code (20 classes) from software engineering class project Pre-reading: Questionnaire about background, smell-list, etc. Pre-reading: Questionnaire about background, smell-list, etc.

15 Study design: procedure Procedure instructed: Procedure instructed: Fill in the questionnaire and read about the smell list Fill in the questionnaire and read about the smell list Read the code and look for “ bad smells ” ; select a smell from a provided list or fill in a problem observed that was not in the list Read the code and look for “ bad smells ” ; select a smell from a provided list or fill in a problem observed that was not in the list Find the class with the most serious problems that should be refactored first Find the class with the most serious problems that should be refactored first Record the time spent reviewing/reading each class Record the time spent reviewing/reading each class

16 Study Result: Compare reviewers ’ selection with tool ’ s selection Priorityrv1rv2rv3rv4rv5rv6Tool #1I1AGAAGA #2FWTPEHLO #3WLOASGH #4GVLWHP #5PSMLOF #6PL Legend of class name abbreviations: A - AnimationScreen, F-FileOutPut, L- LoginScreen, P- PitchAnalyzer, S- SessionReport, E- ErrorWindow, G- Graphic, LO - LoudnessAnalyzer, R- RegistrationScreen, T - TestScreen, F- FileInputHandler, H - HistoryReport, M - MenuScreen, W- Welcome, I1 – ImagePanel1, I2 – ImagePanel2, L – LoginScreen Legend of class name abbreviations: A - AnimationScreen, F-FileOutPut, L- LoginScreen, P- PitchAnalyzer, S- SessionReport, E- ErrorWindow, G- Graphic, LO - LoudnessAnalyzer, R- RegistrationScreen, T - TestScreen, F- FileInputHandler, H - HistoryReport, M - MenuScreen, W- Welcome, I1 – ImagePanel1, I2 – ImagePanel2, L – LoginScreen

17 Class Animation Noted by 67% of the reviewers and the tool (ranked 1 st by 50% of the reviewers and the tool) Noted by 67% of the reviewers and the tool (ranked 1 st by 50% of the reviewers and the tool) Largest halstead_effort and smallest MI Largest halstead_effort and smallest MI Long method per class (LMC) and Complex method per class (CMC) above average (Slide 43) Long method per class (LMC) and Complex method per class (CMC) above average (Slide 43)

18 Metrics of class animation Halstead-LHalstead-vHalstead-EMILMCCMC Animation (max) Average

19 Study results Tool and half of reviewers noted class Animation as worst Tool and half of reviewers noted class Animation as worst Reviewers spent a significant amount of time (1-3 hours) Reviewers spent a significant amount of time (1-3 hours) More “ easy ” problems found (90%) More “ easy ” problems found (90%) Reviewers looked for different smells (28% not in list) Reviewers looked for different smells (28% not in list)

20 Conclusions Complexity and size are among the major factors making comprehension hard Complexity and size are among the major factors making comprehension hard Reviewers are looking for different problems Reviewers are looking for different problems Code reviewing is time-consuming Code reviewing is time-consuming Automation can help consistency, efficiency, and effectiveness Automation can help consistency, efficiency, and effectiveness

21 Future work Predict the possible cost of the refactoring and its impact on code maintainability Predict the possible cost of the refactoring and its impact on code maintainability Use metrics from evolution history Use metrics from evolution history Use metrics reflecting inter-class relationships Use metrics reflecting inter-class relationships

22 Acknowledgements Thanks to Edison Design Group for providing JFE Thanks to Edison Design Group for providing JFE Thanks to the graduate student volunteers for participating in the study Thanks to the graduate student volunteers for participating in the study

23 Questions?