SlideShare a Scribd company logo
1 of 15
Download to read offline
C a m p u s P a r t y 2 0 1 4
REFACTORING WORKSHOP
Carla Suárez @carlast22
María Gómez @mariascandella
!
REFACTORING
!
▫︎Method to change the code.
▫︎The internal structure of a module get
changed while the external one keeps
unaltered.
▫︎Used for cleaner and better structured
code.
2
SKILLS NEEDED FOR DEVELOPMENT
▫︎Use of good practices
(SOLID principle)
▫︎Work on a incremental
fashion
▫︎TDD (test driven
development)
▫︎Well designed test cases
▫︎Pair programming
3
SOLID
▫︎Single Responsibility Principle
▫︎Open/Closed Principle
▫︎Liskov Substitution Principle
▫︎Interface Segregation Principle
▫︎Dependency Inversion Principle
4
SOLID
▫︎Single Responsibility Principle
5
“A class or module should have one one reason to change”
SOLID
▫︎Open/Closed Principle
6
“Software entities should be open for extension, but close for
modification”
SOLID
▫︎Liskov Substitution Principle
7
“Objects in a program should be replaceable with instances of
their subtypes without altering the correctness of that
program”
SOLID
▫︎Interface Segregation Principle
8
“No client should be force to depend on method it does not
use”
SOLID
▫︎Dependency Inversion Principle
9
“Modules should depend upon abstractions, no upon
concretions.”
WORKING INCREMENTALLY
10
Initial
Planning
Planning
Requirements Analysis  &  Design
Implementation
Deployment
Testing
Evaluation
http://en.wikipedia.org/wiki/Iterative_and_incremental_development
UNIT TESTS
▫︎A way to test the
correctness of a piece of
code.
▫︎They ensure that a
module works correctly
in an independent way.
11
UNIT TEST EXAMPLE
12
TDD (TEST DRIVEN DEVELOPMENT)
13
RED
GREENREFACTOR
PAIR PROGRAMMING
▫︎Two developer working on the same code in the same
computer.
▫︎Benefits:
▫︎Higher quality.
▫︎More productivity
▫︎Less prone to errors
▫︎Ping-pong model
14
LET’S CODE!
▫︎http://tinyurl.com/cpq4TW
15

More Related Content

Viewers also liked

Responsive Environments - MoodMixer Presentation
Responsive Environments - MoodMixer PresentationResponsive Environments - MoodMixer Presentation
Responsive Environments - MoodMixer PresentationMaria Gomez
 
Splitting the Monolith
Splitting the MonolithSplitting the Monolith
Splitting the MonolithMaria Gomez
 
Bringing iot data to life, IoT Israel 2014
Bringing iot data to life, IoT Israel 2014Bringing iot data to life, IoT Israel 2014
Bringing iot data to life, IoT Israel 2014iotisrael
 

Viewers also liked (6)

Responsive Environments - MoodMixer Presentation
Responsive Environments - MoodMixer PresentationResponsive Environments - MoodMixer Presentation
Responsive Environments - MoodMixer Presentation
 
Splitting the Monolith
Splitting the MonolithSplitting the Monolith
Splitting the Monolith
 
Scio
ScioScio
Scio
 
Bringing iot data to life, IoT Israel 2014
Bringing iot data to life, IoT Israel 2014Bringing iot data to life, IoT Israel 2014
Bringing iot data to life, IoT Israel 2014
 
Scio
ScioScio
Scio
 
Molecular Sensor from SCIO
Molecular Sensor from SCIOMolecular Sensor from SCIO
Molecular Sensor from SCIO
 

Similar to Refactoring workshop (Campus Party Quito 2014)

Becoming a better developer by using the SOLID design principles
Becoming a better developer by using the SOLID design principlesBecoming a better developer by using the SOLID design principles
Becoming a better developer by using the SOLID design principlesKaterina Trajchevska
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Maksym Husar
 
From Good to SOLID: How to become a better PHP developer
From Good to SOLID: How to become a better PHP developerFrom Good to SOLID: How to become a better PHP developer
From Good to SOLID: How to become a better PHP developerKaterina Trajchevska
 
SOLID Software Principles with C#
SOLID Software Principles with C#SOLID Software Principles with C#
SOLID Software Principles with C#Ken Burkhardt
 
Evgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shapeEvgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shapeAnna Shymchenko
 
OO design principle
OO design principleOO design principle
OO design principleLi-Wei Cheng
 
Use Design Principle to Improve code quality
Use Design Principle to Improve code qualityUse Design Principle to Improve code quality
Use Design Principle to Improve code qualityHebin Wei
 
The Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary VersionThe Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary VersionPhilip Schwarz
 
Design for Testability
Design for Testability Design for Testability
Design for Testability Pawel Kalbrun
 
From good to solid: How to become a better developer
From good to solid: How to become a better developerFrom good to solid: How to become a better developer
From good to solid: How to become a better developerKaterina Trajchevska
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)ASIMYILDIZ
 
The Solid Principles
The Solid PrinciplesThe Solid Principles
The Solid PrinciplesLuke Smith
 
Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...Anuradha Bandara
 

Similar to Refactoring workshop (Campus Party Quito 2014) (20)

Becoming a better developer by using the SOLID design principles
Becoming a better developer by using the SOLID design principlesBecoming a better developer by using the SOLID design principles
Becoming a better developer by using the SOLID design principles
 
Clean code: SOLID
Clean code: SOLIDClean code: SOLID
Clean code: SOLID
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)
 
From Good to SOLID: How to become a better PHP developer
From Good to SOLID: How to become a better PHP developerFrom Good to SOLID: How to become a better PHP developer
From Good to SOLID: How to become a better PHP developer
 
Design patterns 101
Design patterns 101Design patterns 101
Design patterns 101
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Soild principles
Soild principlesSoild principles
Soild principles
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Oop principles
Oop principlesOop principles
Oop principles
 
SOLID Software Principles with C#
SOLID Software Principles with C#SOLID Software Principles with C#
SOLID Software Principles with C#
 
Evgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shapeEvgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shape
 
OO design principle
OO design principleOO design principle
OO design principle
 
Use Design Principle to Improve code quality
Use Design Principle to Improve code qualityUse Design Principle to Improve code quality
Use Design Principle to Improve code quality
 
The Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary VersionThe Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary Version
 
Design for Testability
Design for Testability Design for Testability
Design for Testability
 
From good to solid: How to become a better developer
From good to solid: How to become a better developerFrom good to solid: How to become a better developer
From good to solid: How to become a better developer
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)
 
The Solid Principles
The Solid PrinciplesThe Solid Principles
The Solid Principles
 
Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...
 
Mvc
MvcMvc
Mvc
 

More from Maria Gomez

From Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDDFrom Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDDMaria Gomez
 
CQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspectiveCQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspectiveMaria Gomez
 
Splitting the monolith using Domain Driven Design
Splitting the monolith using Domain Driven Design Splitting the monolith using Domain Driven Design
Splitting the monolith using Domain Driven Design Maria Gomez
 
Observable Microservices (O'Reilly SACon London 2018)
Observable Microservices (O'Reilly SACon London 2018)Observable Microservices (O'Reilly SACon London 2018)
Observable Microservices (O'Reilly SACon London 2018)Maria Gomez
 
Effective team onboarding
Effective team onboardingEffective team onboarding
Effective team onboardingMaria Gomez
 
Observable microservices (O'Reilly SACon NY 2018)
Observable microservices (O'Reilly SACon NY 2018)Observable microservices (O'Reilly SACon NY 2018)
Observable microservices (O'Reilly SACon NY 2018)Maria Gomez
 
Security in agile teams
Security in agile teamsSecurity in agile teams
Security in agile teamsMaria Gomez
 
Security in agile teams
Security in agile teamsSecurity in agile teams
Security in agile teamsMaria Gomez
 
Project Management - Report
Project Management - ReportProject Management - Report
Project Management - ReportMaria Gomez
 
Principles of New Media - Essay
Principles of New Media - EssayPrinciples of New Media - Essay
Principles of New Media - EssayMaria Gomez
 
Project Management - Risk management
Project Management - Risk managementProject Management - Risk management
Project Management - Risk managementMaria Gomez
 
Responsive Environments - Critical report
Responsive Environments - Critical reportResponsive Environments - Critical report
Responsive Environments - Critical reportMaria Gomez
 
New Media Management - Project plan
New Media Management - Project planNew Media Management - Project plan
New Media Management - Project planMaria Gomez
 
New Media Management - Report
New Media Management - ReportNew Media Management - Report
New Media Management - ReportMaria Gomez
 

More from Maria Gomez (14)

From Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDDFrom Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDD
 
CQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspectiveCQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspective
 
Splitting the monolith using Domain Driven Design
Splitting the monolith using Domain Driven Design Splitting the monolith using Domain Driven Design
Splitting the monolith using Domain Driven Design
 
Observable Microservices (O'Reilly SACon London 2018)
Observable Microservices (O'Reilly SACon London 2018)Observable Microservices (O'Reilly SACon London 2018)
Observable Microservices (O'Reilly SACon London 2018)
 
Effective team onboarding
Effective team onboardingEffective team onboarding
Effective team onboarding
 
Observable microservices (O'Reilly SACon NY 2018)
Observable microservices (O'Reilly SACon NY 2018)Observable microservices (O'Reilly SACon NY 2018)
Observable microservices (O'Reilly SACon NY 2018)
 
Security in agile teams
Security in agile teamsSecurity in agile teams
Security in agile teams
 
Security in agile teams
Security in agile teamsSecurity in agile teams
Security in agile teams
 
Project Management - Report
Project Management - ReportProject Management - Report
Project Management - Report
 
Principles of New Media - Essay
Principles of New Media - EssayPrinciples of New Media - Essay
Principles of New Media - Essay
 
Project Management - Risk management
Project Management - Risk managementProject Management - Risk management
Project Management - Risk management
 
Responsive Environments - Critical report
Responsive Environments - Critical reportResponsive Environments - Critical report
Responsive Environments - Critical report
 
New Media Management - Project plan
New Media Management - Project planNew Media Management - Project plan
New Media Management - Project plan
 
New Media Management - Report
New Media Management - ReportNew Media Management - Report
New Media Management - Report
 

Recently uploaded

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Refactoring workshop (Campus Party Quito 2014)