SlideShare une entreprise Scribd logo
1  sur  59
Refactoring legacy code driven by tests 
Luca Minudel + Ilias Bartolini 
+ Luigi Bozzo 
I’m the 
Refactoring 
Chicken 
I’m the 
TDD egg
Let’s clarify the scope of this Workshop
Languages supported in this Workshop 
C# 
Java 
JavaScr 
ipt 
Ruby 
Pytho 
n 
Sala 
PHP 
Cpp
Automatic Testing Continuum 
Specification 
(documentation) 
Verification Design
Scope of this workshop 
Specification 
(documentation) 
Verification Design
Types of Automatic Tests 
End-to-end, out-of-process, business facing 
Unit, in-process, technology facing
Scope of this workshop 
End-to-end, out-of-process, business facing 
Unit, in-process, technology facing
Exercise 1: Tire Pressure Monitoring System 
Alarm class: 
controlla la pressione di un pneumatico e lancia un allarme se 
la pressione esce dall’intervallo di valori attesi.
Exercise 1: Tire Pressure Monitoring System 
Alarm class: 
controlla la pressione di un pneumatico e lancia un allarme se 
la pressione esce dall’intervallo di valori attesi. 
Sensor class: 
simula un vero sensore di pressione in un pneumatico, 
generando valori casuali ma realistici di pressione.
Exercise 1: Tire Pressure Monitoring System 
Scrivi gli unit test per la Alarm class. 
Fai il Refactoring del codice sino a rendere la Alarm class 
testabile.
Exercise 1: Tire Pressure Monitoring System 
Scrivi gli unit test per la Alarm class. 
Fai il Refactoring del codice sino a rendere la Alarm class 
testabile. 
Minimizza i cambiamenti alla API pubblica più che puoi.
Exercise 1: Tire Pressure Monitoring System 
Scrivi gli unit test per la Alarm class. 
Fai il Refactoring del codice sino a rendere la Alarm class 
testabile. 
Minimizza i cambiamenti alla API pubblica piu che puoi. 
Extra credits: 
Alarm class viola alcuni dei principi SOLID. Prendi nota della 
linea di codice e il principio violato.
The SOLID acronym 
S single responsibility principle 
O open closed principle 
L Liskov substitution principle 
I interface segregation principle 
D dependency inversion principle
Dependency Inversion Principle (DIP) 
Martin Fowler's definition: 
a) High level modules should not depend upon 
low level modules, both should depend upon 
abstractions. 
b) Abstractions should not depend upon details, 
details should depend upon abstractions.
Dependency Inversion Principle (DIP) 
Both low level classes and high level classes 
should depend on abstractions. 
High level classes should not depend on low 
level classes.
DIP Violation In Example Code 
High Level Class 
Dependency 
Low Level Class
Open Closed Principle (OCP) 
Bertrand Meyer's definition: 
Software entities (classes, modules, functions, 
etc.) should be open for extension, but closed for 
modification.
Open Closed Principle (OCP) 
Classes and methods should be 
open for extensions 
& 
strategically closed for modification. 
So that the behavior can be changed and 
extended adding new code instead of changing 
the class.
OCP Violation In Example Code 
Want to use a new type of sensor? 
Must modify code; cannot extend it
Dependency injection
Reference: WELC 
Parametrize Constructor 
Extract Interface
Exercise 2: Unicode File To Htm Text Converter 
UnicodeFileToHtmTextConverter class: 
trasforma del testo semplice in html per essere visualizzato da 
un browser.
Exercise 2: Unicode File To Htm Text Converter 
Scrivi gli unit test per la UnicodeFileToHtmTextConverter. 
Fai il Refactoring del codice sino a rendere la classe 
testabile.
Exercise 2: Unicode File To Htm Text Converter 
Scrivi gli unit test per la UnicodeFileToHtmTextConverter. 
Fai il Refactoring del codice sino a rendere la classe 
testabile. 
Minimizza i cambiamenti alla API pubblica più che puoi.
Exercise 2: Unicode File To Htm Text Converter 
Scrivi gli unit test per la UnicodeFileToHtmTextConverter. 
Fai il Refactoring del codice sino a rendere la classe 
testabile. 
Minimizza i cambiamenti alla API pubblica più che puoi. 
Extra credits: 
UnicodeFileToHtmTextConverter class viola alcuni dei principi 
SOLID. Prendi nota della linea di codice e il principio violato.
Feathers’ rules of thumb. Extended ! 
A test is not a unit test when: 
 It talks to the database 
 It communicates across the network 
 It touches the file system or reads config info 
 It uses DateTime.now() or Random 
 It depends on non-deterministic behavior 
 It can't run at the same time as any of your other unit 
tests 
 You have to do special things to your environment 
(such as editing config files) to run it.
Refactoring and TDD 
Should we inject this dependency?
Behavior of TextReader 
TextReader documentation from MSDN 
Non-idempotent behavior
Dependency injection and 
idempotent behavior
Reference: WELC 
Parametrize Constructor 
Extract Interface 
Skin and Wrap the API
Exercise 3: Ticket Dispenser 
TicketDispenser class: 
gestisce il sistema delle code agli sportelli di un negozio. 
Ci possono essere più distributori dei biglietti col numero del 
turno senza che questi distribuiscano lo stesso numero a due 
clienti diversi.
Exercise 3: Ticket Dispenser 
TurnTicket class: 
rappresenta il biglietto col numero del turno. 
TurnNumberSequence class: 
genera la sequenza dei numeri del turno.
Exercise 3: Ticket Dispenser 
Scrivi gli unit test per la TicketDispenser class. 
Fai il Refactoring del codice sino a rendere la classe 
TicketDispenser testabile.
Exercise 3: Ticket Dispenser 
Scrivi gli unit test per la TicketDispenser class. 
Fai il Refactoring del codice sino a rendere la classe 
TicketDispenser testabile. 
Minimizza i cambiamenti alla API pubblica più che puoi.
Exercise 3: Ticket Dispenser 
Scrivi gli unit test per la TicketDispenser class. 
Fai il Refactoring del codice sino a rendere la classe 
TicketDispenser testabile. 
Minimizza i cambiamenti alla API pubblica più che puoi. 
Extra credits: 
TicketDispenser class viola alcuni dei principi OO e SOLID. 
Prendi nota della linea di codice e il principio violato.
Encapsulation Violation In Example Code
DIP Violation In Example Code 
High Level Class 
Dependencies 
Low Level Classes
OCP Violation In Example Code 
Want to use a new type of sequence or ticket? 
Must modify code; cannot extend it
Dependency injection
Introduce Instance Delegator
Reference: WELC 
Parametrize Constructor 
Extract Interface 
Skin and Wrap the API 
Introduce Instance Delegator 
…
Exercise 4: Telemetry System 
TelemetryDiagnosticControl class: 
establishes a connection to the telemetry server through the 
TelemetryClient, 
sends a diagnostic request and receives the response with 
diagnostic info. 
TelemetryClient class: 
simulates the communication with the Telemetry Server, sends 
requests and then receives and returns the responses
Exercise 4: Telemetry System 
Write the unit tests for the TelemetryDiagnosticControl class. 
Refactor the code as much as you need to make the class 
testable.
Exercise 4: Telemetry System 
Write the unit tests for the TelemetryDiagnosticControl class. 
Refactor the code as much as you need to make the class 
testable. 
Minimize changes to the public API as much as you can.
Exercise 4: Telemetry System 
Write the unit tests for the TelemetryDiagnosticControl class. 
Refactor the code as much as you need to make the class 
testable. 
Minimize changes to the public API as much as you can. 
Extra credits: 
TelemetryClient class fails to follow one or more of the OO and 
SOLID principles. Write down the line number, the principle & 
the violation.
Single Responsibility Principle (SRP) 
A class should have only one reason to change.
Single Responsibility Principle (SRP) 
There should never be more than one reason for 
a class to change. 
A class should have one and only one 
responsibility.
Interface Segregation Principle (IRP) 
Clients should not be forced to depend upon 
interfaces that they do not use.
Interface Segregation Principle (IRP) 
Clients should not be forced to depend upon 
interface members that they don't use. 
Interfaces that serve only one scope should be 
preferred over fat interfaces.
Reference: SRP 
http://www.objectmentor.com/resources/articles/srp.pdf 
Pag. 151/152
Refactoring and TDD
Synergy between testing and design 
Michael Feathers: 
writing tests is another way to look the code and 
locally understand it and reuse it, 
and that is the same goal of good OO design. 
This is the reason for 
the deep synergy 
between testability and good design.
Other testing strategies for legacy code 
 Start with other tests 
 Use an automatic refactoring tool 
 Strangler pattern 
 DDD anti-corruption layer
Mike Cohn's Test Pyramid. Explained ! 
UI 
tests 
Integration 
tests 
Unit tests
More references
More references
More references
References 
 http://scratch.mit.edu/projects/13134082/ 
 http://vimeo.com/15007792 
 http://martinfowler.com/bliki/TestPyramid.html 
 http://martinfowler.com/bliki/StranglerApplication.html 
 http://www.markhneedham.com/blog/2009/07/07/domain-driven- 
design-anti-corruption-layer/ 
 http://www.objectmentor.com/resources/articles/srp.pdf 
 http://www.objectmentor.com/resources/articles/ocp.pdf 
 http://www.objectmentor.com/resources/articles/lsp.pdf 
 http://www.objectmentor.com/resources/articles/isp.pdf 
 http://www.objectmentor.com/resources/articles/dip.pdf
References / Links / Slides 
On Twitter 
On Twitter : 
@GGBOZZO 
@ILIASBARTOLINI 
@LUKADOTNET

Contenu connexe

En vedette

Add 2009 10
Add 2009 10Add 2009 10
Add 2009 10RUAULT
 
I2 Argentina Unitech
I2 Argentina UnitechI2 Argentina Unitech
I2 Argentina UnitechUNITECH S.A.
 
Environmental Law for Road Builders
Environmental Law for Road Builders Environmental Law for Road Builders
Environmental Law for Road Builders DSaxe
 
Canadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology StandardsCanadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology Standards Intelliware Development Inc.
 
Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?Antoine Vigneron
 
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...Larry Ajuwon
 
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Intelliware Development Inc.
 
Coding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the worldCoding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the worldmcd_boulanger
 
5 mythes de la marche au ralenti
5 mythes de la marche au ralenti5 mythes de la marche au ralenti
5 mythes de la marche au ralentiellipsos inc.
 
U.S. Economic Sanctions Update
U.S. Economic Sanctions UpdateU.S. Economic Sanctions Update
U.S. Economic Sanctions UpdateJon Yormick
 
Power Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing PresentationPower Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing PresentationJoan Shi
 

En vedette (20)

Add 2009 10
Add 2009 10Add 2009 10
Add 2009 10
 
Why Nortel Went Bankrupt
Why Nortel Went BankruptWhy Nortel Went Bankrupt
Why Nortel Went Bankrupt
 
Hong kong
Hong kongHong kong
Hong kong
 
City of deception
City of deceptionCity of deception
City of deception
 
I2 Argentina Unitech
I2 Argentina UnitechI2 Argentina Unitech
I2 Argentina Unitech
 
Environmental Law for Road Builders
Environmental Law for Road Builders Environmental Law for Road Builders
Environmental Law for Road Builders
 
Canadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology StandardsCanadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology Standards
 
Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?
 
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
 
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
 
Coding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the worldCoding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the world
 
Proyecto de Protección Ambiental de Bosawas, NIcaragua
Proyecto de Protección Ambiental de Bosawas, NIcaraguaProyecto de Protección Ambiental de Bosawas, NIcaragua
Proyecto de Protección Ambiental de Bosawas, NIcaragua
 
Xerox Corporation Fraud Case
Xerox Corporation Fraud CaseXerox Corporation Fraud Case
Xerox Corporation Fraud Case
 
5 mythes de la marche au ralenti
5 mythes de la marche au ralenti5 mythes de la marche au ralenti
5 mythes de la marche au ralenti
 
U.S. Economic Sanctions Update
U.S. Economic Sanctions UpdateU.S. Economic Sanctions Update
U.S. Economic Sanctions Update
 
Agile Story Writing
Agile Story WritingAgile Story Writing
Agile Story Writing
 
Agile Release & Iteration Planning
Agile Release & Iteration Planning   Agile Release & Iteration Planning
Agile Release & Iteration Planning
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 
Power Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing PresentationPower Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing Presentation
 
Master of deception (mod)
Master of deception (mod)Master of deception (mod)
Master of deception (mod)
 

Similaire à Refactoring legacy code driven by tests - ITA

Templates and Exception Handling in C++
Templates and Exception Handling in C++Templates and Exception Handling in C++
Templates and Exception Handling in C++Nimrita Koul
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And RefactoringNaresh Jain
 
C++ question and answers
C++ question and answersC++ question and answers
C++ question and answersAdenKheire
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestableRoyKlein
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Featurestechfreak
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Codeerikmsp
 
Assessing Unit Test Quality
Assessing Unit Test QualityAssessing Unit Test Quality
Assessing Unit Test Qualityguest268ee8
 
Technical trainning.pptx
Technical trainning.pptxTechnical trainning.pptx
Technical trainning.pptxSanuSan3
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine LearningStudent
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG Greg.Helton
 
Automation testing
Automation testingAutomation testing
Automation testingTomy Rhymond
 
Code coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveCode coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveEngineering Software Lab
 

Similaire à Refactoring legacy code driven by tests - ITA (20)

Templates and Exception Handling in C++
Templates and Exception Handling in C++Templates and Exception Handling in C++
Templates and Exception Handling in C++
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
C++ question and answers
C++ question and answersC++ question and answers
C++ question and answers
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Features
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Assessing Unit Test Quality
Assessing Unit Test QualityAssessing Unit Test Quality
Assessing Unit Test Quality
 
Technical trainning.pptx
Technical trainning.pptxTechnical trainning.pptx
Technical trainning.pptx
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Intro To AOP
Intro To AOPIntro To AOP
Intro To AOP
 
Code quality
Code qualityCode quality
Code quality
 
Code Quality
Code QualityCode Quality
Code Quality
 
Code coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveCode coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspective
 

Plus de Luca Minudel

It takes two to tango - why tech and business succeed or fail together v4.1 b...
It takes two to tango - why tech and business succeed or fail together v4.1 b...It takes two to tango - why tech and business succeed or fail together v4.1 b...
It takes two to tango - why tech and business succeed or fail together v4.1 b...Luca Minudel
 
Scrum master self-assessment kit v3.2
Scrum master self-assessment kit v3.2Scrum master self-assessment kit v3.2
Scrum master self-assessment kit v3.2Luca Minudel
 
Project management in the age of accelerating change - IT/Tech specific
Project management in the age of accelerating change - IT/Tech specificProject management in the age of accelerating change - IT/Tech specific
Project management in the age of accelerating change - IT/Tech specificLuca Minudel
 
Project management in the age of accelerating change - general non IT specific
Project management in the age of accelerating change - general non IT specificProject management in the age of accelerating change - general non IT specific
Project management in the age of accelerating change - general non IT specificLuca Minudel
 
Scrum master self assessment v2.7
Scrum master self assessment v2.7Scrum master self assessment v2.7
Scrum master self assessment v2.7Luca Minudel
 
Agility - definition and curricula
Agility - definition and curriculaAgility - definition and curricula
Agility - definition and curriculaLuca Minudel
 
Agile Delivery Manager self-assessment radar
Agile Delivery Manager self-assessment radarAgile Delivery Manager self-assessment radar
Agile Delivery Manager self-assessment radarLuca Minudel
 
CTO self-assessment radar
CTO self-assessment radarCTO self-assessment radar
CTO self-assessment radarLuca Minudel
 
Reflections on Kent Beck's 3x Explore, Expand, and Extract
Reflections on Kent Beck's 3x Explore, Expand, and ExtractReflections on Kent Beck's 3x Explore, Expand, and Extract
Reflections on Kent Beck's 3x Explore, Expand, and ExtractLuca Minudel
 
New Lean-Agile Coach Self-Assessment - detailed descriptions v3
New Lean-Agile Coach Self-Assessment - detailed descriptions v3New Lean-Agile Coach Self-Assessment - detailed descriptions v3
New Lean-Agile Coach Self-Assessment - detailed descriptions v3Luca Minudel
 
From Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOpsFrom Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOpsLuca Minudel
 
Draft your next training course with ideas from Training from the Back of the...
Draft your next training course with ideas from Training from the Back of the...Draft your next training course with ideas from Training from the Back of the...
Draft your next training course with ideas from Training from the Back of the...Luca Minudel
 
New Lean-Agile Coach self-assessment - levels description v3.2
New Lean-Agile Coach self-assessment - levels description v3.2New Lean-Agile Coach self-assessment - levels description v3.2
New Lean-Agile Coach self-assessment - levels description v3.2Luca Minudel
 
Pratica avanzata del refactoring (2004)
Pratica avanzata del refactoring (2004)Pratica avanzata del refactoring (2004)
Pratica avanzata del refactoring (2004)Luca Minudel
 
New Lean-Agile Coach self-assessment radars v3.2
New Lean-Agile Coach self-assessment radars v3.2New Lean-Agile Coach self-assessment radars v3.2
New Lean-Agile Coach self-assessment radars v3.2Luca Minudel
 
AgileDay 2006 - Essere agili nel diventare agili
AgileDay 2006 - Essere agili nel diventare agiliAgileDay 2006 - Essere agili nel diventare agili
AgileDay 2006 - Essere agili nel diventare agiliLuca Minudel
 
Architettura del software un approccio Agile, Web-cast Microsoft 2006
Architettura del software un approccio Agile, Web-cast Microsoft 2006Architettura del software un approccio Agile, Web-cast Microsoft 2006
Architettura del software un approccio Agile, Web-cast Microsoft 2006Luca Minudel
 
Agility: The scientific definition of how to be(come) Agile
Agility: The scientific definition of how to be(come) AgileAgility: The scientific definition of how to be(come) Agile
Agility: The scientific definition of how to be(come) AgileLuca Minudel
 
Lightning talk: Active Agility, the magic ingredient of Lean and Agile
Lightning talk: Active Agility, the magic ingredient of Lean and AgileLightning talk: Active Agility, the magic ingredient of Lean and Agile
Lightning talk: Active Agility, the magic ingredient of Lean and AgileLuca Minudel
 
Software development in Formula One: challenges, complexity and struggle for ...
Software development in Formula One: challenges, complexity and struggle for ...Software development in Formula One: challenges, complexity and struggle for ...
Software development in Formula One: challenges, complexity and struggle for ...Luca Minudel
 

Plus de Luca Minudel (20)

It takes two to tango - why tech and business succeed or fail together v4.1 b...
It takes two to tango - why tech and business succeed or fail together v4.1 b...It takes two to tango - why tech and business succeed or fail together v4.1 b...
It takes two to tango - why tech and business succeed or fail together v4.1 b...
 
Scrum master self-assessment kit v3.2
Scrum master self-assessment kit v3.2Scrum master self-assessment kit v3.2
Scrum master self-assessment kit v3.2
 
Project management in the age of accelerating change - IT/Tech specific
Project management in the age of accelerating change - IT/Tech specificProject management in the age of accelerating change - IT/Tech specific
Project management in the age of accelerating change - IT/Tech specific
 
Project management in the age of accelerating change - general non IT specific
Project management in the age of accelerating change - general non IT specificProject management in the age of accelerating change - general non IT specific
Project management in the age of accelerating change - general non IT specific
 
Scrum master self assessment v2.7
Scrum master self assessment v2.7Scrum master self assessment v2.7
Scrum master self assessment v2.7
 
Agility - definition and curricula
Agility - definition and curriculaAgility - definition and curricula
Agility - definition and curricula
 
Agile Delivery Manager self-assessment radar
Agile Delivery Manager self-assessment radarAgile Delivery Manager self-assessment radar
Agile Delivery Manager self-assessment radar
 
CTO self-assessment radar
CTO self-assessment radarCTO self-assessment radar
CTO self-assessment radar
 
Reflections on Kent Beck's 3x Explore, Expand, and Extract
Reflections on Kent Beck's 3x Explore, Expand, and ExtractReflections on Kent Beck's 3x Explore, Expand, and Extract
Reflections on Kent Beck's 3x Explore, Expand, and Extract
 
New Lean-Agile Coach Self-Assessment - detailed descriptions v3
New Lean-Agile Coach Self-Assessment - detailed descriptions v3New Lean-Agile Coach Self-Assessment - detailed descriptions v3
New Lean-Agile Coach Self-Assessment - detailed descriptions v3
 
From Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOpsFrom Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOps
 
Draft your next training course with ideas from Training from the Back of the...
Draft your next training course with ideas from Training from the Back of the...Draft your next training course with ideas from Training from the Back of the...
Draft your next training course with ideas from Training from the Back of the...
 
New Lean-Agile Coach self-assessment - levels description v3.2
New Lean-Agile Coach self-assessment - levels description v3.2New Lean-Agile Coach self-assessment - levels description v3.2
New Lean-Agile Coach self-assessment - levels description v3.2
 
Pratica avanzata del refactoring (2004)
Pratica avanzata del refactoring (2004)Pratica avanzata del refactoring (2004)
Pratica avanzata del refactoring (2004)
 
New Lean-Agile Coach self-assessment radars v3.2
New Lean-Agile Coach self-assessment radars v3.2New Lean-Agile Coach self-assessment radars v3.2
New Lean-Agile Coach self-assessment radars v3.2
 
AgileDay 2006 - Essere agili nel diventare agili
AgileDay 2006 - Essere agili nel diventare agiliAgileDay 2006 - Essere agili nel diventare agili
AgileDay 2006 - Essere agili nel diventare agili
 
Architettura del software un approccio Agile, Web-cast Microsoft 2006
Architettura del software un approccio Agile, Web-cast Microsoft 2006Architettura del software un approccio Agile, Web-cast Microsoft 2006
Architettura del software un approccio Agile, Web-cast Microsoft 2006
 
Agility: The scientific definition of how to be(come) Agile
Agility: The scientific definition of how to be(come) AgileAgility: The scientific definition of how to be(come) Agile
Agility: The scientific definition of how to be(come) Agile
 
Lightning talk: Active Agility, the magic ingredient of Lean and Agile
Lightning talk: Active Agility, the magic ingredient of Lean and AgileLightning talk: Active Agility, the magic ingredient of Lean and Agile
Lightning talk: Active Agility, the magic ingredient of Lean and Agile
 
Software development in Formula One: challenges, complexity and struggle for ...
Software development in Formula One: challenges, complexity and struggle for ...Software development in Formula One: challenges, complexity and struggle for ...
Software development in Formula One: challenges, complexity and struggle for ...
 

Dernier

Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Dernier (20)

Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

Refactoring legacy code driven by tests - ITA

  • 1. Refactoring legacy code driven by tests Luca Minudel + Ilias Bartolini + Luigi Bozzo I’m the Refactoring Chicken I’m the TDD egg
  • 2. Let’s clarify the scope of this Workshop
  • 3. Languages supported in this Workshop C# Java JavaScr ipt Ruby Pytho n Sala PHP Cpp
  • 4. Automatic Testing Continuum Specification (documentation) Verification Design
  • 5. Scope of this workshop Specification (documentation) Verification Design
  • 6. Types of Automatic Tests End-to-end, out-of-process, business facing Unit, in-process, technology facing
  • 7. Scope of this workshop End-to-end, out-of-process, business facing Unit, in-process, technology facing
  • 8. Exercise 1: Tire Pressure Monitoring System Alarm class: controlla la pressione di un pneumatico e lancia un allarme se la pressione esce dall’intervallo di valori attesi.
  • 9. Exercise 1: Tire Pressure Monitoring System Alarm class: controlla la pressione di un pneumatico e lancia un allarme se la pressione esce dall’intervallo di valori attesi. Sensor class: simula un vero sensore di pressione in un pneumatico, generando valori casuali ma realistici di pressione.
  • 10. Exercise 1: Tire Pressure Monitoring System Scrivi gli unit test per la Alarm class. Fai il Refactoring del codice sino a rendere la Alarm class testabile.
  • 11. Exercise 1: Tire Pressure Monitoring System Scrivi gli unit test per la Alarm class. Fai il Refactoring del codice sino a rendere la Alarm class testabile. Minimizza i cambiamenti alla API pubblica più che puoi.
  • 12. Exercise 1: Tire Pressure Monitoring System Scrivi gli unit test per la Alarm class. Fai il Refactoring del codice sino a rendere la Alarm class testabile. Minimizza i cambiamenti alla API pubblica piu che puoi. Extra credits: Alarm class viola alcuni dei principi SOLID. Prendi nota della linea di codice e il principio violato.
  • 13. The SOLID acronym S single responsibility principle O open closed principle L Liskov substitution principle I interface segregation principle D dependency inversion principle
  • 14. Dependency Inversion Principle (DIP) Martin Fowler's definition: a) High level modules should not depend upon low level modules, both should depend upon abstractions. b) Abstractions should not depend upon details, details should depend upon abstractions.
  • 15. Dependency Inversion Principle (DIP) Both low level classes and high level classes should depend on abstractions. High level classes should not depend on low level classes.
  • 16. DIP Violation In Example Code High Level Class Dependency Low Level Class
  • 17. Open Closed Principle (OCP) Bertrand Meyer's definition: Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
  • 18. Open Closed Principle (OCP) Classes and methods should be open for extensions & strategically closed for modification. So that the behavior can be changed and extended adding new code instead of changing the class.
  • 19. OCP Violation In Example Code Want to use a new type of sensor? Must modify code; cannot extend it
  • 21. Reference: WELC Parametrize Constructor Extract Interface
  • 22. Exercise 2: Unicode File To Htm Text Converter UnicodeFileToHtmTextConverter class: trasforma del testo semplice in html per essere visualizzato da un browser.
  • 23. Exercise 2: Unicode File To Htm Text Converter Scrivi gli unit test per la UnicodeFileToHtmTextConverter. Fai il Refactoring del codice sino a rendere la classe testabile.
  • 24. Exercise 2: Unicode File To Htm Text Converter Scrivi gli unit test per la UnicodeFileToHtmTextConverter. Fai il Refactoring del codice sino a rendere la classe testabile. Minimizza i cambiamenti alla API pubblica più che puoi.
  • 25. Exercise 2: Unicode File To Htm Text Converter Scrivi gli unit test per la UnicodeFileToHtmTextConverter. Fai il Refactoring del codice sino a rendere la classe testabile. Minimizza i cambiamenti alla API pubblica più che puoi. Extra credits: UnicodeFileToHtmTextConverter class viola alcuni dei principi SOLID. Prendi nota della linea di codice e il principio violato.
  • 26. Feathers’ rules of thumb. Extended ! A test is not a unit test when:  It talks to the database  It communicates across the network  It touches the file system or reads config info  It uses DateTime.now() or Random  It depends on non-deterministic behavior  It can't run at the same time as any of your other unit tests  You have to do special things to your environment (such as editing config files) to run it.
  • 27. Refactoring and TDD Should we inject this dependency?
  • 28. Behavior of TextReader TextReader documentation from MSDN Non-idempotent behavior
  • 29. Dependency injection and idempotent behavior
  • 30. Reference: WELC Parametrize Constructor Extract Interface Skin and Wrap the API
  • 31. Exercise 3: Ticket Dispenser TicketDispenser class: gestisce il sistema delle code agli sportelli di un negozio. Ci possono essere più distributori dei biglietti col numero del turno senza che questi distribuiscano lo stesso numero a due clienti diversi.
  • 32. Exercise 3: Ticket Dispenser TurnTicket class: rappresenta il biglietto col numero del turno. TurnNumberSequence class: genera la sequenza dei numeri del turno.
  • 33. Exercise 3: Ticket Dispenser Scrivi gli unit test per la TicketDispenser class. Fai il Refactoring del codice sino a rendere la classe TicketDispenser testabile.
  • 34. Exercise 3: Ticket Dispenser Scrivi gli unit test per la TicketDispenser class. Fai il Refactoring del codice sino a rendere la classe TicketDispenser testabile. Minimizza i cambiamenti alla API pubblica più che puoi.
  • 35. Exercise 3: Ticket Dispenser Scrivi gli unit test per la TicketDispenser class. Fai il Refactoring del codice sino a rendere la classe TicketDispenser testabile. Minimizza i cambiamenti alla API pubblica più che puoi. Extra credits: TicketDispenser class viola alcuni dei principi OO e SOLID. Prendi nota della linea di codice e il principio violato.
  • 37. DIP Violation In Example Code High Level Class Dependencies Low Level Classes
  • 38. OCP Violation In Example Code Want to use a new type of sequence or ticket? Must modify code; cannot extend it
  • 41. Reference: WELC Parametrize Constructor Extract Interface Skin and Wrap the API Introduce Instance Delegator …
  • 42. Exercise 4: Telemetry System TelemetryDiagnosticControl class: establishes a connection to the telemetry server through the TelemetryClient, sends a diagnostic request and receives the response with diagnostic info. TelemetryClient class: simulates the communication with the Telemetry Server, sends requests and then receives and returns the responses
  • 43. Exercise 4: Telemetry System Write the unit tests for the TelemetryDiagnosticControl class. Refactor the code as much as you need to make the class testable.
  • 44. Exercise 4: Telemetry System Write the unit tests for the TelemetryDiagnosticControl class. Refactor the code as much as you need to make the class testable. Minimize changes to the public API as much as you can.
  • 45. Exercise 4: Telemetry System Write the unit tests for the TelemetryDiagnosticControl class. Refactor the code as much as you need to make the class testable. Minimize changes to the public API as much as you can. Extra credits: TelemetryClient class fails to follow one or more of the OO and SOLID principles. Write down the line number, the principle & the violation.
  • 46. Single Responsibility Principle (SRP) A class should have only one reason to change.
  • 47. Single Responsibility Principle (SRP) There should never be more than one reason for a class to change. A class should have one and only one responsibility.
  • 48. Interface Segregation Principle (IRP) Clients should not be forced to depend upon interfaces that they do not use.
  • 49. Interface Segregation Principle (IRP) Clients should not be forced to depend upon interface members that they don't use. Interfaces that serve only one scope should be preferred over fat interfaces.
  • 52. Synergy between testing and design Michael Feathers: writing tests is another way to look the code and locally understand it and reuse it, and that is the same goal of good OO design. This is the reason for the deep synergy between testability and good design.
  • 53. Other testing strategies for legacy code  Start with other tests  Use an automatic refactoring tool  Strangler pattern  DDD anti-corruption layer
  • 54. Mike Cohn's Test Pyramid. Explained ! UI tests Integration tests Unit tests
  • 58. References  http://scratch.mit.edu/projects/13134082/  http://vimeo.com/15007792  http://martinfowler.com/bliki/TestPyramid.html  http://martinfowler.com/bliki/StranglerApplication.html  http://www.markhneedham.com/blog/2009/07/07/domain-driven- design-anti-corruption-layer/  http://www.objectmentor.com/resources/articles/srp.pdf  http://www.objectmentor.com/resources/articles/ocp.pdf  http://www.objectmentor.com/resources/articles/lsp.pdf  http://www.objectmentor.com/resources/articles/isp.pdf  http://www.objectmentor.com/resources/articles/dip.pdf
  • 59. References / Links / Slides On Twitter On Twitter : @GGBOZZO @ILIASBARTOLINI @LUKADOTNET

Notes de l'éditeur

  1. The triangle in action: http://scratch.mit.edu/projects/13134082/
  2. They could be code you inherited from a legacy code-base.
  3. They could be code you inherited from a legacy code-base.
  4. They could be code you inherited from a legacy code-base.
  5. They could be code you inherited from a legacy code-base.
  6. They could be code you inherited from a legacy code-base.
  7. Michael Feathers, NDC 2010 The Deep Synergy Between Testability and Good Design http://vimeo.com/15007792 http://michaelfeathers.typepad.com/michael_feathers_blog/2007/09/the-deep-synerg.html
  8. http://martinfowler.com/bliki/TestPyramid.html http://martinfowler.com/bliki/StranglerApplication.html http://www.markhneedham.com/blog/2009/07/07/domain-driven-design-anti-corruption-layer/
  9. http://martinfowler.com/bliki/TestPyramid.html http://martinfowler.com/bliki/StranglerApplication.html http://www.markhneedham.com/blog/2009/07/07/domain-driven-design-anti-corruption-layer/
  10. Magic Tricks of Testing , Sendi Metz, https://speakerdeck.com/skmetz/magic-tricks-of-testing-railsconf