1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard.

Slides:



Advertisements
Similar presentations
LOADING RECORDS INTO THE SIRSI CATALOG TRAINING AND REFRESHER TRAINING.
Advertisements

Comp1004: Object Oriented Design II Designing Applications Based on BlueJ Chapter 13.
Collections Chapter Java Collection Frameworks The Java collection framework is a set of utility classes and interfaces. Designed for working with.
GRASP The other four What are the first five? What is the goal/purpose of using patterns?
Threading Wrapup CS221 – 4/29/09. Concurrent Collections Java supplies a set of concurrent collections you can use manage sets of data in a multi- threaded.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 4.0.
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
Architecture Eclipse Framework with Plugin Concept JTransformer Plugin Analysis + Transformation interface: logical Program.language keeps representation.
Designing Classes How to write classes in a way that they are easily understandable, maintainable and reusable.
Design: Coupling and Cohesion How to write classes in a way that they are easily understandable, maintainable and reusable.
Software Reengineering 2003 년 12 월 2 일 최창익, 고광 원.
Code as Communication Programming Studio Spring 2015.
(c) University of Washington04-1 CSC 143 Java Inheritance Example (Review)
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Eclipse – making OOP Easy
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Multiplication and Division. Steps 1) Multiply 2) Count place values 3) Move the decimal left that number of spaces.
The Evils of Copy and Paste Presented by Daniel Daugherty
JAVA COLLECTIONS LIBRARY School of Engineering and Computer Science, Victoria University of Wellington COMP T2, Lecture 2 Marcus Frean.
Sadegh Aliakbary Sharif University of Technology Spring 2012.
Mining and Analysis of Control Structure Variant Clones Guo Qiao.
LECTURE 38: REFACTORING CSC 395 – Software Engineering.
Software Engineering 1 Object-oriented Analysis and Design Chap 21 Test-Driven Development and Refactoring.
Refactoring Improving the structure of existing code Refactoring1.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Applying Clone.
Designing Classes 2 How to write classes in a way that they are easily understandable, maintainable and reusable.
Refactoring1 Improving the structure of existing code.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Advanced Programming in Java
Design Patterns Gang Qian Department of Computer Science University of Central Oklahoma.
Javadoc Comments.  Java API has a documentation tool called javadoc  The javadoc tool is used on the source code embedded with javadoc-style comments.
Chapter 4 Grouping Objects. Flexible Sized Collections  When writing a program, we often need to be able to group objects into collections  It is typical.
Chapter 21 Test-Driven Development 1CS6359 Fall 2011 John Cole.
Refactoring 101 William C. Wake
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
CJ-DVD Robert Drake Jonothan Fuega David Skeels Corey Vebber With a special thanks to Vu Hoang.
1 COS 260 DAY 14 Tony Gauvin. 2 Agenda Questions? 6 th Mini quiz graded  Oct 29 –Chapter 6 Assignment 4 will be posted later Today –First two problems.
Refactoring. Mathematics: Factor ● fac·tor – One of two or more quantities that divides a given quantity without a remainder, e.g., 2 and 3 are factors.
Computer Science 209 Software Development Refactoring.
Refactoring1 Improving the structure of existing code.
Objects First With Java A Practical Introduction Using BlueJ Designing classes How to write classes in a way that they are easily understandable, maintainable.
1 COS 260 DAY 12 Tony Gauvin. 2 Agenda Questions? 5 th Mini quiz –Chapter 5 40 min Assignment 3 Due Assignment 4 will be posted later (next week) –If.
1 Java's Collection Framework Map and Sets. 2 Collection Framework  A collections framework is a unified architecture for representing and manipulating.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
CS223: Software Engineering Lecture 34: Software Maintenance.
EVEN NUMBERS EVEN NUMBERS 1 = prime 2 = prime1 3 = prime 4 = 2 x 22 5 = prime 6 = 2 x 33 7 = prime 8 = 2 x 2 x 24 9 = 3 x 3 10 = 2 x 55.
The Object-Oriented Thought Process Chapter 03
Low Budget Productions, LLC
Software Design and Architecture
Improving Scilab’s Xcos User Interface
Steve Chenoweth, RHIT Ch 12 in Fowler
Java's for Statement.
4.OA#5 Sets Missing Elements next Patterns © 2005 Richard A. Medeiros.
Week 4 Object-Oriented Programming (1): Inheritance
Copyright ©2012 by Pearson Education, Inc. All rights reserved
MSIS 670 Object-Oriented Software Engineering
Dr. Awad Khalil Computer Science Department AUC
Interfaces.
Improving the structure of existing code
Advanced Programming Behnam Hatami Fall 2017.
4: Object-oriented Analysis & Design
Times.
Foibles of Journal Data
Counting to 100 Counting by ones
Ian VanBuren Refactoring.
Refactoring.
Python List.
Presentation transcript:

1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard for constructors already there?  Do comment lines tend to surround poorly written code?  What savings can be made through refactoring? Kerievsky’s Catalog of Refactoring to Patterns  ‘Replace Multiple Constructors with Creation Methods’ Eliminates code duplication inside constructors Makes the class more maintainable because the methods are named more appropriately

2 What did we do? Manually collected all classes with three or more constructors from 10 systems (five Java and five C++ of different application domains)  140 identified from the five Java systems  For each class, simulated the removal of constructors and lines of code saved as a result  Counted the number of comment lines removed as a result Results:

3 ~ 400 lines of duplicated code removed across three of the Java systems ~ 1250 lines of comments removed from the same three systems (incidentally, were the worst written systems) Two of the Java systems showed little or no opportunity for refactoring (the best written systems) Improved comprehensibility of the classes involved(?) C++ systems virtually no opportunity for the same refactoring (friends? No interfaces?)

4 Thanks for listening!