SlideShare a Scribd company logo
Testing in isolation
Who am I Giorgio Sironi Bachelor in Computer Engineering Advisor @ Allbus Zone Leader @ DZone
The format A little bit of theory; for ($i = 1; $i <= 3; $i++) { code in development; problem arises; refactoring of the code; }
Requirement: TDD
Isolation Unit tests > functional, end-to-end ones simpler tests less paths to test faster localize defects
Test Doubles in one phrase Dummy only passed around Stub returns canned results Mock expects some particular calls Fake implements the collaborator without hassles
Let's begin... I told you there was little theory Follow at  https://github.com/giorgiosironi/testing-in-isolation
The solution for ClosedMail
If we extend it...
The solution for AddressBookGenerator
The solution for OrderRepository
References All the code seen today http://github.com/giorgiosironi/testing-in-isolation Integration tests are a scam  http://www.infoq.com/presentations/integration-tests-scam Growing object-oriented software, guided by tests http://www.growing-object-oriented-software.com/ Pattern of Enterprise Application Architecture by Fowler http://martinfowler.com/eaaCatalog/ Hexagonal architecture http://alistair.cockburn.us/Hexagonal+architecture
Thanks for your attention

More Related Content

PPT
Pursuing Domain-Driven Design practices in PHP
PPTX
C++ Object Oriented Programming
PDF
Session 1.2 high-precision, context-free entity linking exploiting unambigu...
PDF
C# Summer course - Lecture 2
PPTX
Std 12 computer chapter 6 object oriented concepts (part 1)
PPTX
Chapter 2 c#
PDF
Object-oriented programming (OOP) with Complete understanding modules
Pursuing Domain-Driven Design practices in PHP
C++ Object Oriented Programming
Session 1.2 high-precision, context-free entity linking exploiting unambigu...
C# Summer course - Lecture 2
Std 12 computer chapter 6 object oriented concepts (part 1)
Chapter 2 c#
Object-oriented programming (OOP) with Complete understanding modules

What's hot (20)

PPTX
Clean code
PDF
Oop concepts classes_objects
PPT
PPT
香港六合彩 &raquo; SlideShare
PPT
Object Oriented Programming In .Net
PPTX
Object Oriented Concept
PPTX
Lecture01 object oriented-programming
PDF
Data Structure Interview Questions & Answers
PPTX
Unit 1 OOSE
PPTX
Encapsulation
PPTX
Advance oops concepts
PPT
Object oriented programming using c++
PPT
C sharp
PPTX
Vb ch 3-object-oriented_fundamentals_in_vb.net
PPTX
Oops in vb
PPT
Oops ppt
PPTX
concept of oops
PPT
Encapsulation
PPTX
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
PPTX
Oop in c++ lecture 1
Clean code
Oop concepts classes_objects
香港六合彩 &raquo; SlideShare
Object Oriented Programming In .Net
Object Oriented Concept
Lecture01 object oriented-programming
Data Structure Interview Questions & Answers
Unit 1 OOSE
Encapsulation
Advance oops concepts
Object oriented programming using c++
C sharp
Vb ch 3-object-oriented_fundamentals_in_vb.net
Oops in vb
Oops ppt
concept of oops
Encapsulation
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
Oop in c++ lecture 1
Ad

Similar to Testing in isolation (20)

PDF
TDD and Simple Design Workshop - Session 1 - March 2019
PDF
Tdd is not about testing
PDF
Treat Your Unit Tests As Production Code - DARGO - Amadeus - Soirée du Test L...
PPT
Test Driven Development - Overview and Adoption
PPT
Google test training
PPTX
Android design patterns
PPT
Mocking 101
ODP
PHP Barcelona 2010 - Architecture and testability
PDF
So You Just Inherited a $Legacy Application...
PDF
PHPUnit with Magento
PDF
So You Just Inherited a $Legacy Application… NomadPHP July 2016
PPTX
Tdd is not about testing (C++ version)
PPT
Test Driven Development
PDF
Raising the Bar
PDF
TDD Flow: The Mantra in Action
PPTX
Entering the matrix
PDF
Androides y Mazmorras. Part I (dungeons & robots)
PPT
Crowd debugging (FSE 2015)
PPTX
Test Driven Development
PPTX
White box & Black box testing
TDD and Simple Design Workshop - Session 1 - March 2019
Tdd is not about testing
Treat Your Unit Tests As Production Code - DARGO - Amadeus - Soirée du Test L...
Test Driven Development - Overview and Adoption
Google test training
Android design patterns
Mocking 101
PHP Barcelona 2010 - Architecture and testability
So You Just Inherited a $Legacy Application...
PHPUnit with Magento
So You Just Inherited a $Legacy Application… NomadPHP July 2016
Tdd is not about testing (C++ version)
Test Driven Development
Raising the Bar
TDD Flow: The Mantra in Action
Entering the matrix
Androides y Mazmorras. Part I (dungeons & robots)
Crowd debugging (FSE 2015)
Test Driven Development
White box & Black box testing
Ad

More from Giorgio Sironi (20)

ODP
Case study: Khan Academy
ODP
Case study: iTunes for K-12
ODP
Case study: Insegnalo
ODP
Case study: Innovascuola
ODP
Case study: e-Learning for Kids
ODP
Case study: Chocolat 3B
PDF
Khan Academy
PDF
Itunes K-12
PDF
Insegnalo
PDF
Innovascuola
PDF
e-Learning for kids
PDF
Chocolat 3B
PDF
Pursuing practices of Domain-Driven Design in PHP
ODP
An year of Pomodoros
ODP
Blind detection of image manipulation @ PoliMi
ODP
CouchDB @ PoliMi
PDF
Cohesion and coupling metrics for workflow process design
ODP
Chansonnier: web application for multimedia search on song videos
ODP
Chansonnier: web application for multimedia search on song videos
ODP
Php day2010
Case study: Khan Academy
Case study: iTunes for K-12
Case study: Insegnalo
Case study: Innovascuola
Case study: e-Learning for Kids
Case study: Chocolat 3B
Khan Academy
Itunes K-12
Insegnalo
Innovascuola
e-Learning for kids
Chocolat 3B
Pursuing practices of Domain-Driven Design in PHP
An year of Pomodoros
Blind detection of image manipulation @ PoliMi
CouchDB @ PoliMi
Cohesion and coupling metrics for workflow process design
Chansonnier: web application for multimedia search on song videos
Chansonnier: web application for multimedia search on song videos
Php day2010

Testing in isolation

  • 2. Who am I Giorgio Sironi Bachelor in Computer Engineering Advisor @ Allbus Zone Leader @ DZone
  • 3. The format A little bit of theory; for ($i = 1; $i <= 3; $i++) { code in development; problem arises; refactoring of the code; }
  • 5. Isolation Unit tests > functional, end-to-end ones simpler tests less paths to test faster localize defects
  • 6. Test Doubles in one phrase Dummy only passed around Stub returns canned results Mock expects some particular calls Fake implements the collaborator without hassles
  • 7. Let's begin... I told you there was little theory Follow at https://github.com/giorgiosironi/testing-in-isolation
  • 8. The solution for ClosedMail
  • 9. If we extend it...
  • 10. The solution for AddressBookGenerator
  • 11. The solution for OrderRepository
  • 12. References All the code seen today http://github.com/giorgiosironi/testing-in-isolation Integration tests are a scam http://www.infoq.com/presentations/integration-tests-scam Growing object-oriented software, guided by tests http://www.growing-object-oriented-software.com/ Pattern of Enterprise Application Architecture by Fowler http://martinfowler.com/eaaCatalog/ Hexagonal architecture http://alistair.cockburn.us/Hexagonal+architecture
  • 13. Thanks for your attention