SlideShare uma empresa Scribd logo
1 de 62
Things to consider for testable code Frank Kleine, 27.10.2009
The Speaker: Frank Kleine ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Separation of Concerns ,[object Object]
Business logic
Logging
Error handling
Environment handling
Didn't we forget something really important?
Construction of Objects!
Construction of objects ,[object Object]
Construction of objects ,[object Object],[object Object]
Construction of objects ,[object Object],[object Object],[object Object],[object Object]
Construction of objects ,[object Object],[object Object],[object Object],[object Object],[object Object]
Construction of objects II ,[object Object],class Car { public function __construct() { $this->engine = new Engine(); $this->tire  = TireFactory::createTire(); } }
Construction of objects II ,[object Object],class Car { public function __construct() { $this->engine = new Engine(); $this->tire  = TireFactory::createTire(); } } Work in constructor (Anti-Pattern)
Construction of objects II ,[object Object],class Car { public function __construct() { $this->engine = new Engine(); $this->tire  = TireFactory::createTire(); } } Work in constructor (Anti-Pattern) Hard to test
Construction of objects II ,[object Object],[object Object],class Car { public function __construct() { $this->engine = new Engine(); $this->tire  = TireFactory::createTire(); } } class Car { public function __construct(Engine $eng, Tire $tire) { $this->engine = $eng; $this->tire  = $tire; } } Work in constructor (Anti-Pattern) Hard to test
Construction of objects II ,[object Object],[object Object],class Car { public function __construct() { $this->engine = new Engine(); $this->tire  = TireFactory::createTire(); } } class Car { public function __construct(Engine $eng, Tire $tire) { $this->engine = $eng; $this->tire  = $tire; } } Work in constructor (Anti-Pattern) Hard to test Piece of cake to test
Construction of objects II ,[object Object],[object Object],class Car { public function __construct() { $this->engine = new Engine(); $this->tire  = TireFactory::createTire(); } } class Car { public function __construct(Engine $eng, Tire $tire) { $this->engine = $eng; $this->tire  = $tire; } } Work in constructor (Anti-Pattern) Dependency Injection Hard to test Piece of cake to test
Dependency Injection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
Law of Demeter ,[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); }
Law of Demeter ,[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Driver coupled to Engine
Law of Demeter ,[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Hard to test: test always needs Engine or a mock of it Driver coupled to Engine
Law of Demeter ,[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Internal state of Vehicle revealed Driver coupled to Engine Hard to test: test always needs Engine or a mock of it
Law of Demeter ,[object Object],[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Internal state of Vehicle revealed class Driver { public function drive($miles) { $this->vehicle->start(); $this->vehicle->drive($miles); $this->vehicle->stop(); } Hard to test: test always needs Engine or a mock of it Driver coupled to Engine
Law of Demeter ,[object Object],[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Internal state of Vehicle revealed class Driver { public function drive($miles) { $this->vehicle->start(); $this->vehicle->drive($miles); $this->vehicle->stop(); } Driver coupled to Engine Hard to test: test always needs Engine or a mock of it Driver not coupled to Engine: simpler to maintain
Law of Demeter ,[object Object],[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Internal state of Vehicle revealed class Driver { public function drive($miles) { $this->vehicle->start(); $this->vehicle->drive($miles); $this->vehicle->stop(); } Piece of cake to test Hard to test: test always needs Engine or a mock of it Driver coupled to Engine Driver not coupled to Engine: simpler to maintain
Law of Demeter ,[object Object],[object Object],class Driver { public function drive($miles) { $this->vehicle->engine->start(); $this->vehicle->drive($miles); $this->vehicle->engine->stop(); } Internal state of Vehicle revealed class Driver { public function drive($miles) { $this->vehicle->start(); $this->vehicle->drive($miles); $this->vehicle->stop(); } Piece of cake to test Less prone to errors Driver coupled to Engine Hard to test: test always needs Engine or a mock of it Driver not coupled to Engine: simpler to maintain
Global state ,[object Object],[object Object]
Global state ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Global state: Singletons ,[object Object],[object Object]
Global state: Singletons ,[object Object],[object Object],[object Object],[object Object],[object Object]
Singleton with DI framework $binder->bind('Session') ->to('PhpSession')
Singleton with DI framework $binder->bind('Session') ->to('PhpSession') Configure the binding
Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance
Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance
Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance Dependency Injection
Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance Dependency Injection Tell DI framework to inject required parameters on creation of Processor
Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance Dependency Injection Piece of cake to test: independent of PhpSession Tell DI framework to inject required parameters on creation of Processor
Global state:  static  methods ,[object Object],[object Object],[object Object],[object Object]
Global state:  $_GET, $_POST, … ,[object Object]
Global state:  $_GET, $_POST, … ,[object Object],[object Object]
Global state:  $_GET, $_POST, … ,[object Object],[object Object],[object Object],[object Object]
Global state:  $_GET, $_POST, … ,[object Object],[object Object],[object Object],[object Object],[object Object]
Global state:  $_GET, $_POST, … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Global state: Registry ,[object Object]
Global state: Registry ,[object Object],[object Object]
Global state: Registry ,[object Object],[object Object],[object Object]
Global state: Registry ,[object Object],[object Object],[object Object],[object Object]
 
Modify
Simplify Modify
Simplify Improve Modify
Finally… ,[object Object]
Singletons are really, really (and I mean really)
Singletons are really, really (and I mean really) EVIL
The End ,[object Object]
The End ,[object Object],[object Object]
Commercial break ,[object Object]
Commercial break ,[object Object],[object Object]
Commercial break ,[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Dutch php a short tale about state machine
Dutch php   a short tale about state machineDutch php   a short tale about state machine
Dutch php a short tale about state machine
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
Good karma: UX Patterns and Unit Testing in Angular with Karma
Good karma: UX Patterns and Unit Testing in Angular with KarmaGood karma: UX Patterns and Unit Testing in Angular with Karma
Good karma: UX Patterns and Unit Testing in Angular with Karma
 
Frontin like-a-backer
Frontin like-a-backerFrontin like-a-backer
Frontin like-a-backer
 
Barely Enough Design
Barely Enough DesignBarely Enough Design
Barely Enough Design
 
Typed Properties and more: What's coming in PHP 7.4?
Typed Properties and more: What's coming in PHP 7.4?Typed Properties and more: What's coming in PHP 7.4?
Typed Properties and more: What's coming in PHP 7.4?
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
James Thomas - Serverless Machine Learning With TensorFlow - Codemotion Berli...
James Thomas - Serverless Machine Learning With TensorFlow - Codemotion Berli...James Thomas - Serverless Machine Learning With TensorFlow - Codemotion Berli...
James Thomas - Serverless Machine Learning With TensorFlow - Codemotion Berli...
 
Concurrent test frameworks
Concurrent test frameworksConcurrent test frameworks
Concurrent test frameworks
 
QA for PHP projects
QA for PHP projectsQA for PHP projects
QA for PHP projects
 
Refactoring
RefactoringRefactoring
Refactoring
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
 
Testing most things in JavaScript - LeedsJS 31/05/2017
Testing most things in JavaScript - LeedsJS 31/05/2017Testing most things in JavaScript - LeedsJS 31/05/2017
Testing most things in JavaScript - LeedsJS 31/05/2017
 
TDD with PhpSpec
TDD with PhpSpecTDD with PhpSpec
TDD with PhpSpec
 
Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"Nikita Popov "What’s new in PHP 8.0?"
Nikita Popov "What’s new in PHP 8.0?"
 
PHPSpec BDD for PHP
PHPSpec BDD for PHPPHPSpec BDD for PHP
PHPSpec BDD for PHP
 
OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScript
 
Optimizing Magento by Preloading Data
Optimizing Magento by Preloading DataOptimizing Magento by Preloading Data
Optimizing Magento by Preloading Data
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for Magento
 
Test driven development_for_php
Test driven development_for_phpTest driven development_for_php
Test driven development_for_php
 

Destaque (7)

What A Wonderful World Av Annie
What A Wonderful World Av AnnieWhat A Wonderful World Av Annie
What A Wonderful World Av Annie
 
Vackra Bilder 2
Vackra Bilder  2Vackra Bilder  2
Vackra Bilder 2
 
Frontend-Performance mit PHP
Frontend-Performance mit PHPFrontend-Performance mit PHP
Frontend-Performance mit PHP
 
Gott Nytt År!
Gott Nytt År!Gott Nytt År!
Gott Nytt År!
 
Barnbarn Pps
Barnbarn PpsBarnbarn Pps
Barnbarn Pps
 
Modello - Riccardo Colombo
Modello - Riccardo ColomboModello - Riccardo Colombo
Modello - Riccardo Colombo
 
Fake Food - Work In Progress
Fake Food - Work In ProgressFake Food - Work In Progress
Fake Food - Work In Progress
 

Semelhante a Things to consider for testable Code

2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner
Geoffrey De Smet
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
Peter Wilcsinszky
 

Semelhante a Things to consider for testable Code (20)

Symfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusSymfony 4 Workshop - Limenius
Symfony 4 Workshop - Limenius
 
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac..."Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
PHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityPHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testability
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
PHP Unit Testing
PHP Unit TestingPHP Unit Testing
PHP Unit Testing
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenarios
 
4Developers 2015: Be pragmatic, be SOLID - Krzysztof Menżyk
4Developers 2015: Be pragmatic, be SOLID - Krzysztof Menżyk4Developers 2015: Be pragmatic, be SOLID - Krzysztof Menżyk
4Developers 2015: Be pragmatic, be SOLID - Krzysztof Menżyk
 
Be pragmatic, be SOLID
Be pragmatic, be SOLIDBe pragmatic, be SOLID
Be pragmatic, be SOLID
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
Going web native
Going web nativeGoing web native
Going web native
 
Total Compensationbuild.xml Builds, tests, and runs th.docx
Total Compensationbuild.xml      Builds, tests, and runs th.docxTotal Compensationbuild.xml      Builds, tests, and runs th.docx
Total Compensationbuild.xml Builds, tests, and runs th.docx
 
Do I need tests when I have the compiler - Andrzej Jóźwiak - TomTom Dev Day 2020
Do I need tests when I have the compiler - Andrzej Jóźwiak - TomTom Dev Day 2020Do I need tests when I have the compiler - Andrzej Jóźwiak - TomTom Dev Day 2020
Do I need tests when I have the compiler - Andrzej Jóźwiak - TomTom Dev Day 2020
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Things to consider for testable Code

  • 1. Things to consider for testable code Frank Kleine, 27.10.2009
  • 2.
  • 3.
  • 8. Didn't we forget something really important?
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Singleton with DI framework $binder->bind('Session') ->to('PhpSession')
  • 35. Singleton with DI framework $binder->bind('Session') ->to('PhpSession') Configure the binding
  • 36. Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance
  • 37. Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance
  • 38. Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance Dependency Injection
  • 39. Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance Dependency Injection Tell DI framework to inject required parameters on creation of Processor
  • 40. Singleton with DI framework $binder->bind('Session') ->to('PhpSession') ->in(stubBindingScopes::$SINGLETON); class Processor { protected $session; /** * @Inject */ public function __construct(Session $session) { $this->session = $session; } … } Configure the binding Enforce singletoness: DI framework will only create one instance of PhpSession and inject always this same instance Dependency Injection Piece of cake to test: independent of PhpSession Tell DI framework to inject required parameters on creation of Processor
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.  
  • 55.
  • 56. Singletons are really, really (and I mean really)
  • 57. Singletons are really, really (and I mean really) EVIL
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.

Notas do Editor

  1. Simplify – remove accidental complexity Improve – smaller methods, better namings. You need unit tests for this.
  2. Simplify – remove accidental complexity Improve – smaller methods, better namings. You need unit tests for this.
  3. Simplify – remove accidental complexity Improve – smaller methods, better namings. You need unit tests for this.
  4. Simplify – remove accidental complexity Improve – smaller methods, better namings. You need unit tests for this.