Ian VanBuren Refactoring.

Slides:



Advertisements
Similar presentations
Introduction to Python. Python is a high-level programming language Open source and community driven “Batteries Included” – a standard distribution includes.
Advertisements

Lists Introduction to Computing Science and Programming I.
1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard.
Week 9 Building blocks.
Test-Driven Development With Visual Studio 2005 Erno de Weerd Info Support.
Introduction to Python John Reiser May 5 th, 2010.
Lesson 1 – Exponent Laws 30 Learning Goal I can use the exponent laws to simplify exponential expressions Unit 6: Exponential Functions.
Python Programming Chapter 6: Iteration Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Refactoring Improving the structure of existing code Refactoring1.
Improving the Quality of Existing Code Svetlin Nakov Telerik Corporation
Modern Software Development Using C#.NET Chapter 5: More Advanced Class Construction.
Best Practices. Contents Bad Practices Good Practices.
CS 614: Theory and Construction of Compilers Lecture 18 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Refactoring1 Improving the structure of existing code.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Refactoring 2. Admin Blackboard Quiz Acknowledgements Material in this presentation was drawn from Martin Fowler, Refactoring: Improving the Design of.
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
Cases and Classes and Case Classes And Other Miscellany 16-Dec-15.
Software Construction and Evolution - CSSE 375 Making Method Calls Simpler Shawn and Steve Below – “Be the character!” The late acting teacher Lee Strasberg.
ASP.NET User Controls. User Controls In addition to using Web server controls in your ASP.NET Web pages, you can create your own custom, reusable controls.
Refactoring1 Improving the structure of existing code.
Refactoring. 2 Process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal.
Lab - 11 Keerthi Nelaturu. Ordered Structure Using Doubly linked list All elements in the list are arranged in an order Implement the Ordered Structure.
Module 9. Dealing with Generalization Course: Refactoring.
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
Code word practice. altogether 3 addition add & subtract code words in the same problem equals… 3.
Dealing with Technical Debt LUG 2016 Developer Day Ben Evans.
Review for Test2. Scope 8 problems, 60 points. 1 Bonus problem (5 points) Coverage: – Test 1 coverage – Exception Handling, Switch Statement – Array of.
Java Best Practices Java Fundamentals & Object-Oriented Programming MELJUN CORTES, MBA,MPA,BSCS.
Refactoring Presentation Yash Pant. Overview 3 Refactoring Types: 1. Replace Error Code with Exception 2. Split Temporary Variable 3. Remove Middle Man.
Flood fill algorithm Also called seed fill, is an algorithm that determines the area connected to a given node in a multi-dimensional array, When applied.
IF-less programming in C#
CSC 243 – Java Programming, Spring 2014
© 2016, Mike Murach & Associates, Inc.
Debugging Techniques.
Inheritance "Question: What is the object oriented way of getting rich? Answer: Inheritance.“ “Inheritance is new code that reuses old code. Polymorphism.
World-level Methods with Parameters
Array List Pepper.
CSC 480 Software Engineering
Graph Paper Programming
Overview of Eclipse Lectures
Lecture Set 6 The String and DateTime Data Types
//code refactoring Rename Method Introduce Assertion
Testing and debugging A short interlude 2-Dec-18.
CSE 1030: Data Structure Mark Shtern.
Improving the structure of existing code
Debugging CSCE 121 J. Michael Moore.
Variables Title slide variables.
2 Understanding Variables and Solving Equations.
Cases and Classes and Case Classes
Overview Part 3 – Additional Gates and Circuits
619 Final Review Last updated Spring 2010 © : Paul Ammann.
619 Final Review Fall 2017 Professor Ammann.
16 Strings.
Overview Part 3 – Additional Gates and Circuits 2-8 Other Gate Types
Fall 2018 CISC124 2/22/2019 CISC124 Quiz 1 This Week. Topics and format of quiz in last Tuesday’s notes. The prof. (me!) will start grading the quiz.
Scientific Notation.
Connectives The different kinds.
Strip me.
CSC 220 – Processing Spring, 2017
Testing and debugging A short interlude 17-Apr-19.
Multiply by a ONE IN DISGUISE!
4/25/2019 4:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Bill to ID - Manage by Number: Delete from Cisco
Scratch Programming Lesson 7 Debugging.
Expand Brackets Low C C B
Cellular Respiration Chapter 9 in your book.
Test Driven Lasse Koskela Chapter 3: Refactoring in Small Steps
_______ Book Title #1 Here Book Title #1 Book Title #3 Book Title #5 Book Title #2 Book Title #4 This is an example of what the QR Code will look.
What about −(−6) ? What quantity is in the box?.
Presentation transcript:

Ian VanBuren Refactoring

Overview Change Reference to Value Replace Exception with Test Remove Parameter

Change Reference to Value Replace a mutable reference with an immutable value Add a hashcode and equals function

Code Example

Replace Exception with Test While exceptions may help with debugging, they should not be used in case of tests Use conditional tests instead of exceptions unless you have a truly “exceptional” issue

Code Example

Remove Parameter Parameters that are no longer used should be removed Can lead to problems with polymorphic methods especially

Example

Questions?