Refactoring.

Slides:



Advertisements
Similar presentations
Extreme Programming Copyright, 1999 © Jerzy R. Nawrocki Personal Software Process Lecture.
Advertisements

Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
12-Dec-14 Refactoring IV. Previously discussed bad smells Duplicated code — and other forms of redundancy Long method — use short methods that delegate.
NAUG NAUG Knowledge Evening – th February 2007.
Software Construction and Evolution - CSSE 375 Bad Smells in Code Shawn Bohner & Steve Chenoweth.
XP – eXtreme Programming A gentle introduction. Cleviton Vinícius Jobson Ronan Thiago Rodrigues.
Extreme Programming: Practices and Strategies Extreme Programming Practices and Strategies Mohammad Alshayeb Information and Computer.
Extreme Programming Collaboration in Software Development Process.
Extreme Programming Team Members Gowri Devi Yalamanchi Sandhya Ravi.
EXtreme Programming By: Aaron Flocke, Leena Paulose, Geetha Krishna (Team 6)
Introduction to Refactoring Excerpted from ‘What is Refactoring?’ by William C. Wake and Refactoring: Improving the Design of Existing Code by Martin Fowler.
George Blank University Lecturer. REFACTORING Improving the Design of Existing Code Supplement to Ian Sommerville, Software Engineering, Chapter 20 Prepared.
EXtreme Programming Quick Introduction Daniel Arraes Pereira Eduardo Lourenço Apolinário Ricardo de Oliveira Cavalcanti.
Extreme Programming Theory & XPeriences
Extreme Programming Mark Steverson. What Is Extreme Programming? ● Extreme Programming (XP) is a lightweight, agile methodology developed by Kent Beck.
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
COMP4710 Senior Design Software Development Process.
XP and Refactoring David Talby. Development Methodologies The Software Crisis – 84% of software projects are not on time – 31% of software projects never.
REFACTORING Improving the Design of Existing Code Atakan Şimşek e
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
Introduction to Agile Methodologies and Concepts Roy Osherove Principal, Team Agile Blog : ISerializable.com.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
Sofia Bulgaria Summer School IST eXPERT: Best Practice on e-Project Development 30 June - 2 July 2003 eXtreme programming.
EXtreme Programming: An Introduction Presentation by: Jon Banta.
1 e X treme P rogramming D. Dranidis September 2000 CITY College.
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
Refactoring - A disciplined approach to rework for better design.
What is S.E? Describe S.E in terms of its mistakes Standish Group ( US - $250 Billion on IT projects. 31% projects are cancelled 52.7%
XP Overview Short Life cycle Risky / Dynamic Requirements Increase developer productivity.
CS3100 Software Project Management Agile Approaches.
Software Engineering CS3003 Lecture 4 Code bad smells and refactoring.
Refactoring: Code Smells. Admin Notes REGISTER FOR BLACKBOARD Watch blackboard site for updates on class as hurricane season approaches.
AP-1 4. Agile Processes. AP-2 Agile Processes Focus on creating a working system Different attitude on measuring progress XP Scrum.
Refactoring II Dealing with Polymorphism. Switch in Rental Switches on Movie! class Rental … public double getCharge() { double result = 0; switch (getMovie().getPriceCode()){
Module 3. Smells Between Classes Course: Refactoring.
Extreme Programming Based on and
Lecture 4 – XP and Agile 17/9/15. Plan-driven and agile development Plan-driven development A plan-driven approach to software engineering is based around.
1 Software Maintenance and Evolution CSSE 575: Session 2, Part 1 Refactoring Principles Steve Chenoweth Office Phone: (812) Cell: (937)
Agile Methods Presentation By: Jason Abbett. Definition A process to rapidly develop software Many kinds of agile methods but few are practiced.
Extreme Programming. Extreme Programming (XP) Formulated in 1999 by Kent Beck, Ward Cunningham and Ron Jeffries Agile software development methodology.
CSC 480 Software Engineering Extreme Programming.
Pertemuan 12 Refactoring Mata kuliah: T0144 – Advanced Topics in Software Engineering Tahun: 2010.
CS223: Software Engineering Lecture 18: The XP. Recap Introduction to Agile Methodology Customer centric approach Issues of Agile methodology Where to.
Introduction to Software Engineering Muhammad Nasir Agile Software Development(2)
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
Toward Maturity Model for eXtreme Programming Copyright, 2001 © J. Nawrocki, B. Walter, A.. Wojciechowski
Software Development Life Cycle. The Software Life Cycle  Encompasses all activities from initial analysis until end of work  Formal process for software.
Project Management Software development models & methodologies
Chapter 3 Agile software development 1 Chapter 3 – Agile Software Development.
A (Very) Simple Example Consolidate duplicate conditional fragments if (isSpecialDeal()) { total = price * 0.95; send (); } else { total = price * 0.98;
Principles and examples
CS223: Software Engineering
CompSci 280 S Introduction to Software Development
Appendix B Agile Methodologies
Steve Chenoweth Office Phone: (812) Cell: (937)
Planning User stories are written.
Alexander Kanavin Lappeenranta University of Technology
What do you need to know about XP?
بازآرایی برنامه Code Refactoring
Refactoring and Code Smells
Chapter 3 – Agile Software Development
CMPUT eXtreme programming
Coming up: What is Agile?
Extreme Programming.
Agile software development
Refactoring.
Refactoring and Code Smells
Presentation transcript:

Refactoring

Extreme Programming A deliberate and disciplined approach to software development Many success stories in the last six years Stresses customer satisfaction Emphasizes team work Lightweight approach (few rules) One of many agile methods 24-Feb-19 COSC6431

Agile method principles Adaptive rather than predictive Embrace change as part of the process People-oriented rather than process-oriented Reject the assumption that people are replaceable A balance between no process and too much process 24-Feb-19 COSC6431

XP principles Software engineered to be simple and elegant is as valuable as software that is complex and hard to understand Automatic tests from day one (tests are written before/during/after the code) Embrace changing requirements (customer feedback early) 24-Feb-19 COSC6431

When to use XP Systems with changing requirements High risk systems Small groups of programmers Typically 2-12 Testable systems Managers and customer are also available 24-Feb-19 COSC6431

XP rules and practices Central idea of agile methods is “few rules and practices” XP has a handful of rules for four different stages of software development Planning Designing Coding Testing 24-Feb-19 COSC6431

Planning User stories are written Release planning creates the schedule Make frequent small releases The Project Velocity is measured The project is divided into iterations Iteration planning starts each iteration Move people around A stand-up meeting starts each day Fix XP when it breaks 24-Feb-19 COSC6431

Designing Simplicity Choose a system metaphor Use CRC cards for design sessions Create spike solutions to reduce risk No functionality is added early Refactor whenever and wherever possible 24-Feb-19 COSC6431

Coding The customer is always available Code must be written to agreed standards Code the unit test first All production code is pair programmed Only one pair integrates code at a time Integrate often Use collective code ownership Leave optimization till last No overtime 24-Feb-19 COSC6431

Testing All code must have unit tests All code must pass all unit tests before it can be released When a bug is found tests are created Acceptance tests are run often and the score is published 24-Feb-19 COSC6431

Collective Code Ownership 24-Feb-19 COSC6431

Refactoring Noun: “A change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behaviour” Verb: “To restructure software by applying a series of refactorings without changing its observable behaviour 24-Feb-19 COSC6431

When to refactor All the time! Indications that it’s time to refactor are known as code smells… 24-Feb-19 COSC6431

Code smells Duplicated code Long method Large class Long parameter list Divergent change Shotgun surgery Feature envy Data clumps Primitive obsession Switch statements Parallel Inheritance Hierarchies Lazy class Speculative generality Temporary field Message chains 24-Feb-19 COSC6431

More code smells Middle man Inappropriate intimacy Alternative classes with different interfaces Incomplete library class Data class Refused bequest Comments 24-Feb-19 COSC6431

Refactoring catalog Many different refactorings possible Martin Fowler lists about 80 of them in his book on Refactoring Other refactorings have been identified as well We’ll take a look at a few examples… 24-Feb-19 COSC6431

The first step: Testing In order to refactor, you need a solid suite of tests Tests must be automatic and self-checking Run tests often, after every small change The Junit framework can help with the automation part (for Java code) www.junit.org 24-Feb-19 COSC6431