Do Metrics Help to Identify Refactoring? Jean-Guy Schneider Rajesh Vasa

Slides:



Advertisements
Similar presentations
Software Engineering Key construction decisions Design challenges.
Advertisements

©2014 IDBS, Confidential Statistical Process Control Workshop An Introduction to the Principles behind SPC Ilca Croufer.
Chapter 4 Quality Assurance in Context
“Bad Smells” in TTCN-3 Test Suites Martin Bisanz, Jens Grabowski, Helmut Neukirchen, Benjamin Zeiss Software Engineering for Distributed Systems Group.
Reverse Engineering © SERG Code Cloning: Detection, Classification, and Refactoring.
What causes bugs? Joshua Sunshine. Bug taxonomy Bug components: – Fault/Defect – Error – Failure Bug categories – Post/pre release – Process stage – Hazard.
July 11 th, 2005 Software Engineering with Reusable Components RiSE’s Seminars Sametinger’s book :: Chapters 16, 17 and 18 Fred Durão.
Architecture Eclipse Framework with Plugin Concept JTransformer Plugin Analysis + Transformation interface: logical Program.language keeps representation.
1 Improving Hash Join Performance through Prefetching _________________________________________________By SHIMIN CHEN Intel Research Pittsburgh ANASTASSIA.
Automatically Extracting and Verifying Design Patterns in Java Code James Norris Ruchika Agrawal Computer Science Department Stanford University {jcn,
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Investigating the Evolution of Bad Smells in Object-Oriented Code Alexander Chatzigeorgiou Anastasios Manakos University of Macedonia Thessaloniki, Greece.
Kari R. Schougaard, PhD Stud. Værktøjer og Teknikker, 2006 UNIVERSITY OF AARHUS Department of Computer Science Unified Modeling Language Visual language.
How to write an abstract. What is an abstract? A complete but concise description of your work –Brief overview of: introduction, methods & results, discussion,
Text Mining: Finding Nuggets in Mountains of Textual Data Jochen Dijrre, Peter Gerstl, Roland Seiffert Presented by Huimin Ye.
Text Mining: Finding Nuggets in Mountains of Textual Data Jochen Dijrre, Peter Gerstl, Roland Seiffert Presented by Drew DeHaas.
The application of ISO 9001 to agile software development
Code smells, slice-based metrics and plenty of deodorant Code smells, slice-based metrics and plenty of deodorant Steve Counsell Brunel University Alessandro.
A Survey of Software Refactoring Tom Mens, Tom Tourwé
Dr. Ken Hoganson, © August 2014 Programming in R STAT8030 Programming in R COURSE NOTES 1: Hoganson Programming Languages.
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
Tennessee Technological University1 The Scientific Importance of Big Data Xia Li Tennessee Technological University.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What Kinds of.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
1 TRex Paul Baker 1, Dominic Evans 1, Jens Grabowski 2, Helmut Neukirchen 2, Benjamin Zeiss 2 The Refactoring and Metrics Tool for TTCN-3 Test Specifications.
Presenter: 王秉森 Progression towards Agility: A comprehensive survey.
Software Refactoring Part I: Introduction Bartosz Walter Advanced Object-Oriented Design Lecture 5.
Integrating Usability Engineering and Agile Software Development: A Literature Review 陳振炎教授 楊哲豪
LECTURE 38: REFACTORING CSC 395 – Software Engineering.
Composition of UML Described Refactoring Rules Presented by Chin-Yi Tsai.
Summarizing the Content of Large Traces to Facilitate the Understanding of the Behaviour of a Software System Abdelwahab Hamou-Lhadj Timothy Lethbridge.
CS527 Topics in Software Engineering (Software Testing and Analysis) Darko Marinov September 16, 2010.
4/1/05F-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Packages and Components in Java and UML.
How to Improve the Safety of Signalling Systems with a Shortened Construction Period in Engineering Construction Projects Gao Guoliang Safety Assurance.
Version 5. ¿What is PAF? PAF is a tool to easily and quickly implement… …distributed analysis over ROOT trees. …by hiding as much as possible the inherent.
Presented by: Ashgan Fararooy Referenced Papers and Related Work on:
Alattin: Mining Alternative Patterns for Detecting Neglected Conditions Suresh Thummalapenta and Tao Xie Department of Computer Science North Carolina.
Grid programming with components: an advanced COMPonent platform for an effective invisible grid © 2006 GridCOMP Grids Programming with components. An.
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
RE’05 The 13 th International conference on Requirements Engineering Reverse Engineering Goal Models from Legacy Code Yijun Yu 1 Yiqiao Wang 1 John Mylopoulos.
1 Scientific Method. 2 Observation Employing your five senses to perceive objects or events.
SCIENCE THE STUDY OF LIVING THINGS!. GROWTH VS DEVELOPMENT Growth is the process by which an organism becomes larger. Development is the process of change.
Scenario-Based Analysis of Software Architecture Rick Kazman, Gregory Abowd, Len Bass, and Paul Clements Presented by Cuauhtémoc Muñoz.
Automatically detecting and describing high level actions within methods Presented by: Gayani Samaraweera.
Generating Software Documentation in Use Case Maps from Filtered Execution Traces Edna Braun, Daniel Amyot, Timothy Lethbridge University of Ottawa, Canada.
1 Software Quality Engineering. 2 Quality Management Models –Tools for helping to monitor and manage the quality of software when it is under development.
Aspect Oriented Security Tim Hollebeek, Ph.D.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
1 Project Quality Management QA and QC Tools & Techniques Lec#10 Ghazala Amin.
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
Recommending Adaptive Changes for Framework Evolution Barthélémy Dagenais and Martin P. Robillard ICSE08 Dec 4 th, 2008 Presented by EJ Park.
A proposal to support the extreme programming development methodology from the quality assurance point of view Authors: Calin Jebelean –
Identifying “Best Bet” Web Search Results by Mining Past User Behavior Author: Eugene Agichtein, Zijian Zheng (Microsoft Research) Source: KDD2006 Reporter:
It’s Agile …. like! A Corkman’s introduction to Agile software delivery.
Automated Formal Verification of PLC (Programmable Logic Controller) Programs
Refactoring. DCS – SWC 2 Refactoring ”A change made to the internal structure of software to make it easier to understand and cheaper to modify without.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
Challenges in Agile Unclear project scope, multiple iterations, minimal documentation, early and frequent testing needs and active stakeholder involvement.
DevCOP: A Software Certificate Management System for Eclipse Mark Sherriff and Laurie Williams North Carolina State University ISSRE ’06 November 10, 2006.
Software Design and Development Development Methodoligies Computing Science.
Fundamentals of Fault-Tolerant Distributed Computing In Asynchronous Environments Paper by Felix C. Gartner Graeme Coakley COEN 317 November 23, 2003.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Introduction to Machine Learning, its potential usage in network area,
Computer aided teaching of statistics: advantages and disadvantages
Estimate Testing Size and Effort Using Test Case Point Analysis
Do Developers Focus on Severe Code Smells?
Reverse Engineering Goal Models from Legacy Code
Gerald Dyer, Jr., MPH October 20, 2016
Dr. Debaleena Chattopadhyay Department of Computer Science
Presentation transcript:

Do Metrics Help to Identify Refactoring? Jean-Guy Schneider Rajesh Vasa Leonhard Hoon

A Personal Note

Overview Background, Motivation What is Refactoring?  Detecting Refactoring Change Patterns Our Approach Pilot Study Summary, Concluding Remarks

Cost of Change Development Stage AnalysisDesign Coding “traditional” agile Source: Steve Hayes (Personal Communication)

Cost of Change (cont.) 5 The flat cost curve of agile development methodologies can only be achieved by introducing appropriate engineering techniques.  Refactoring is the most prominent of these technique.  Hypothesis: refactoring is applied frequently in projects with an iterative development process.

What is Refactoring? 6 “Refactoring is the the redistribution and/or rearrangement of methods, variables and classes across an object-oriented application without changing its observable semantics.”  Definition of catalogues of knows refactorings (cf., for example, catalogue by Martin Fowler

But what about…? 7 Class ValidatorPlugIn (Struts 1.2.1): new Boolean (this.stopOnFirstError) Class ValidatorPlugIn (Struts 1.2.4): this.stopOnFirstError ? Boolean.True : Boolean.False

Detecting Refactorings 8 1. Manual code inspection (possibly in combination with “diff” tools) 2. Change detection using abstract system models (e.g., abstract syntax trees) 3. Mining source code control logs/release notes 4. Metrics extraction combined with heuristics 5. Usage logs of IDEs with built-in refactoring support (e.g., Eclipse)

Challenges and Limitations Comprehensive analysis often hindered by  system size(s),  considerable time difference between releases. Existing approaches focus on detecting (a few) selected known refactorings.  Catalogue of Martin Fowler contains 93 refactorings Combinations of refactoring and functional change cannot always be adequately identified. Not always possible to (semi-automatically) decide whether changes preserve observable semantics. 9

Code resists change (Vasa Ph.D.) A longitudinal study comprising 50 systems (over 1000 distinct releases):  70% of classes do not change between consecutive releases.  Only a small proportion of classes change multiple times over the entire lifetime (< 10%)  Magnitude of change is small (few lines of code)  The popularity of a class is the best determinant of change (rather than complexity or size)  Lehman’s laws are at work at the micro level too 10

Example: Struts 11

Our Approach Instead of attempting to explicitly detect known refactorings, use change metrics to identifty non-refactorings. Idea: use targetted refactoring detection for changes that are not identified as non-refactorings. Change detection per class using:  fully-qualified class name (incl. visibility, package)  set of 54 different metrics covering size, complexity and dependencies. Changes classified as (non-)refactoring manually in pilot study. 12

Pilot Study: Struts 13

Distribution Scatter (1.1 vs ) 14

Distribution Scatter (1.1 vs ) 15

Findings 16 Small changes (wrt both measures) are more likely to be refactorings Large changes are most likely not pure refactorings  But what is “small” and what is “large”?  No conclusive picture can be drawn

Conclusions and Future Work Change metrics alone not enough to reliably detect type of change  Small changes are more likely refactoring  Big changes are most likely not pure refactorings  Extend pilot study to get a clearer picture Better support needed to determine semantic preserving changes Definition of refactoring too broad  Many identified refactorings not part of a catalogue  Refactoring vs. Restructuring 17

Thank you for your attention… 18 Questions?