Code Smell Research: History and Future Directions Second PLOW Installment - March 5, 20141 Nikolaos Tsantalis Computer Science & Software Engineering.

Slides:



Advertisements
Similar presentations
Homework 3 Solution Lecture Packet 16 © John W. Brackett.
Advertisements

Unification and Refactoring of Clones Giri Panamoottil Krishnan and Nikolaos Tsantalis Department of Computer Science & Software Engineering Clone images.
Ranking Refactoring Suggestions based on Historical Volatility Nikolaos Tsantalis Alexander Chatzigeorgiou University of Macedonia Thessaloniki, Greece.
The System and Software Development Process Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
MIS 2000 Class 20 System Development Process Updated 2014.
Alternate Software Development Methodologies
Preventive Software Maintenance: The Past, the Present, the Future Nikolaos Tsantalis Computer Science & Software Engineering Consortium for Software Engineering.
Introduction To System Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
1 Postdelivery Maintenance Xiaojun Qi. 2 Why Postdelivery Maintenance Is Necessary Corrective maintenance: To correct residual faults –Analysis, design,
R R R CSE870: Advanced Software Engineering (Cheng): Intro to Software Engineering1 Advanced Software Engineering Dr. Cheng Overview of Software Engineering.
March 30, Exploratory Testing Testing Approaches Analytical Information-driven Intuitive Exploratory Design the tests and test concurrently Learn.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Introduction to Refactoring Excerpted from ‘What is Refactoring?’ by William C. Wake and Refactoring: Improving the Design of Existing Code by Martin Fowler.
1 IS371 WEEK 8 Last and Final Assignment Application Development Alternatives to Application Development Instructor Online Evaluations.
Fundamentals of Information Systems, Second Edition
Investigating the Evolution of Bad Smells in Object-Oriented Code Alexander Chatzigeorgiou Anastasios Manakos University of Macedonia Thessaloniki, Greece.
SDLC. Information Systems Development Terms SDLC - the development method used by most organizations today for large, complex systems Systems Analysts.
Introduction to Computer Technology
Chapter 9 – Software Evolution and Maintenance
Introduction To System Analysis and design
“Here’s why you need the new wheels, too…” Shawn and Steve Image from
A Survey of Software Refactoring Tom Mens, Tom Tourwé
12.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Using IBM Rational Unified Process for software maintenance
1 IBM Software Group ® Mastering Object-Oriented Analysis and Design with UML 2.0 Module 1: Best Practices of Software Engineering.
System Analysis and Design
Systems Development Lifecycle Project Identification & Selection Project Initiation & Planning Analysis Logical Design Physical Design Implementation Maintenance.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
Advanced Programing practices
Chapter 3: Software Maintenance Process Omar Meqdadi SE 3860 Lecture 3 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
Identify steps for understanding and solving the
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
Introduction To System Analysis and Design
Partitioning and Layering Fundamentals. The Basic Problem Change is a fact of life RequirementsTechnologies Bug Fixes Software Must Adapt.
LECTURE 38: REFACTORING CSC 395 – Software Engineering.
Refactoring1 Refactoring DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY February 6, 2009.
Chapter 13: Regression Testing Omar Meqdadi SE 3860 Lecture 13 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Recovering Design Technical Debt from Source Code Comments Department of Computer Science and Software Engineering Concordia University Montreal, Canada.
Fundamentals of Information Systems, Second Edition 1 Systems Development.
CSCI 521 Final Exam Review. Why Establish a Standard Process? It is nearly impossible to have a high quality product without a high quality process. Standard.
Frameworks CompSci 230 S Software Construction.
Software Engineering CS3003 Lecture 4 Code bad smells and refactoring.
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
1 Software Maintenance and Evolution CSSE 575: Session 2, Part 1 Refactoring Principles Steve Chenoweth Office Phone: (812) Cell: (937)
Chapter 9 – Software Evolution Chapter 9 Software Evolution1.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Rational Unified Process Fundamentals Best Practices of Software Engineering Rational Unified Process Fundamentals Best Practices of Software Engineering.
Pertemuan 12 Refactoring Mata kuliah: T0144 – Advanced Topics in Software Engineering Tahun: 2010.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Fundamentals of Information Systems, Third Edition2 An Overview of Systems Development: Participants in Systems Development Development team –Responsible.
Presented by Lu Xiao Drexel University Quantifying Architectural Debt.
Week # 4 Quality Assurance Software Quality Engineering 1.
MIS 2000 Class 20 System Development Process Updated 2016.
 System Requirement Specification and System Planning.
Principles and examples
Information Systems Development
Steve Chenoweth Office Phone: (812) Cell: (937)
Chapter 18 Maintaining Information Systems
Maintaining software solutions
Information Systems Development
SDLC Model A framework that describes the activities performed at each stage of a software development project.
: Clone Refactoring Davood Mazinanian Nikolaos Tsantalis Raphael Stein
Refactoring.
Chapter 8 Software Evolution.
Refactoring.
Presentation transcript:

Code Smell Research: History and Future Directions Second PLOW Installment - March 5, Nikolaos Tsantalis Computer Science & Software Engineering

Changes aiming to improve the future maintainability and reliability of the software system. Second PLOW Installment - March 5, 20142

3

Refactoring Object-oriented Frameworks, University of Illinois at Urbana-Champaign – Introduced the concept of refactorings as behavior- preserving program restructuring operations. – Introduced the concept of preconditions as conditions that should be examined to determine whether a refactoring can be applied safely. Second PLOW Installment - March 5, 20144

5

Duplicated Code: “If you see the same code structure in more than one place, … find a way to unify them.” Second PLOW Installment - March 5, 20146

7

8

9

10

Second PLOW Installment - March 5,

Code smell definition for Inappropriate Interface inappropriateInterface(?class,?interface,?subclasses) :- findall(, commonSubclassInterface(?class,?itf,?scs), ?result), removeDuplicates(?result,?nodups), member(,?nodups) Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Treat the improvement of object-oriented design as a search problem in the space of alternative designs The move in the search space is achieved by modeling refactorings ( inheritance-related ) Apply search algorithms using QMOOD as the fitness function ( rank alternative designs ) The outcome is a sequence of refactorings leading to the optimal design Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Many code smell definitions are based on historical change information – Shotgun Surgery: When every time you make a kind of change, you have to make a lot of little changes to a lot of different classes. – Parallel Inheritance Hierarchies: When every time you make a subclass of one class, you also have to make a subclass of another. Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

12 code smells 6 Professional developers were hired to implement change requests 4 medium-sized Java systems with known code smells 4 weeks of development Daily interviews and think-aloud sessions Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5, LIMITATION

Advantages: Feasible and behavior preserving solutions to design problems Ranking and prioritizing solutions based on their expected effect on design quality A holistic approach for preventive maintenance Second PLOW Installment - March 5,

1.Identify places where software should be refactored (known as bad smells). 2.Determine which refactoring(s) should be applied to the identified places. 3.Guarantee that the applied refactoring preserves behavior. 4.Apply the refactoring. 5.Assess the effect of the refactoring on quality characteristics of the software. 6.Maintain the consistency between the refactored code and other software artifacts. Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5, doStateA(); if state == STATE_A else if state == STATE_B doStateB();

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5, Since the beginning of 2011 …

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

“Debt” is the effect of incomplete, immature, or inadequate maintenance activities Delayed tasks may bring a short-term benefit ( higher productivity, shorter release time ) Might have to be paid back in the future with “Interest” ( increased effort ) “Principal” is the effort to pay off the debt Second PLOW Installment - March 5,

Tracking clones as project evolves Verifying the consistent modification of clones Updating clones and groups as project evolves Assessing the harmfulness of clones Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

So far, we used – Static source code analysis – Semantic analysis – Change history analysis Second PLOW Installment - March 5,

Second PLOW Installment - March 5,

Every code smell involves a certain risk for future maintainability Second PLOW Installment - March 5,

Likelihood of occurrence of the risky event Exposure of the system to the event Consequence of the event Second PLOW Installment - March 5,

Risky events  changes driven by code smells – Ex. 1: Fixing the same bug in a clone group – Ex. 2: Making a method more “envy” to another class Intuition: code that changes frequently due to a design flaw imposes a high risk to the maintainability of a system Likelihood  proneness to code smell driven changes ( estimated from the history of changes ) Second PLOW Installment - March 5,

Intuition: the more extensively a module is used, the more extensive the propagation of code smell driven changes to dependent modules Exposure  the number and strength of incoming dependencies ( estimated from static and dynamic analysis ) Second PLOW Installment - March 5,

Consequence  cost of code smell driven changes (effort, time, money). From the opposite perspective: Consequence  effect of removing the code smell. Estimated by computing the impact of the corresponding refactoring on metrics. Second PLOW Installment - March 5,

Given a set of different types of refactoring opportunities in a software system Conflicts Dependencies Second PLOW Installment - March 5,

Second PLOW Installment - March 5,