fake it outside-in tdd xp days i… · 2014 justin searls "the failures of 'intro to...
TRANSCRIPT
![Page 1: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/1.jpg)
FAKE IT OUTSIDE-IN TDDDavid Völkel 05.10.2017 @ XP Days Germany
![Page 2: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/2.jpg)
@DAVIDVOELKEL@codecentric
@softwerkskammer
#TDD
![Page 3: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/3.jpg)
INFLUENCES 2003 Kent Beck’s "Fake It" Pattern 2009 #GOOS’s "Outside-In" Design 2013 Emily Bache
"Outside-In development with Double Loop TDD" 2014 Justin Searls "The Failures of 'Intro to TDD'"
COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In Fake It Session 2017 Refinement
![Page 4: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/4.jpg)
INFLUENCES 2003 Kent Beck’s "Fake It" Pattern 2009 #GOOS’s "Outside-In" Design 2013 Emily Bache
"Outside-In development with Double Loop TDD" 2014 Justin Searls "The Failures of 'Intro to TDD'"
COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In Fake It Session 2017 Refinement
![Page 5: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/5.jpg)
INFLUENCES 2003 Kent Beck’s "Fake It" Pattern 2009 #GOOS’s "Outside-In" Design
COMBINATION FAKE IT OUTSIDE-IN TDD
![Page 6: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/6.jpg)
FAKE IT OUTSIDE-IN TDD
INFLUENCES 2003 Kent Beck’s "Fake It" Pattern 2009 #GOOS’s "Outside-In" Design 2013 Emily Bache
"Outside-In development with Double Loop TDD" 2014 Justin Searls "The Failures of 'Intro to TDD'" 2017 Llewelyn Falco „Extreme: Fake it Till you Make It“
FAKE IT OUTSIDE-IN TDD
![Page 7: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/7.jpg)
WHY? Outside-In => YAGNI free design
![Page 8: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/8.jpg)
WHY? Outside-In => YAGNI free design
Avoid mocking drawbacks - Readability - Refactorability
![Page 9: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/9.jpg)
AGENDA Theory
Building Blocks Fake It Outside-In
Questions
![Page 10: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/10.jpg)
AGENDA Theory
Building Blocks Fake It Outside-In
Questions
OPEN SPACE Practice
Mob Programming Session Reflect
Retro Trade-Offs
![Page 11: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/11.jpg)
BUILDING BLOCKS
![Page 12: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/12.jpg)
INTEGRATION OPERATION SEGREGATION PRINCIPLE
*"Integration Operation Segregation Principle", Ralf Westphal "Die kniffligen Fälle beim Testen - Sichtbarkeit", Stefan Lieser
*
![Page 13: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/13.jpg)
INTEGRATION OPERATION SEGREGATION PRINCIPLE
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
Account account = customer.account(); String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; String content = "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service";
mailService.sendMail(email, content); }
![Page 14: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/14.jpg)
OPERATION
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
Account account = customer.account(); String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; String content = "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service";
mailService.sendMail(email, content); }
INTEGRATION OPERATION SEGREGATION PRINCIPLE
![Page 15: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/15.jpg)
INTEGRATION
INTEGRATION
OPERATION
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
Account account = customer.account(); String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; String content = "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service";
mailService.sendMail(email, content); }
INTEGRATION OPERATION SEGREGATION PRINCIPLE
![Page 16: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/16.jpg)
INTEGRATION
INTEGRATION
OPERATION
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
Account account = customer.account(); String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; String content = "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service";
mailService.sendMail(email, content); }
INTEGRATION OPERATION SEGREGATION PRINCIPLE
![Page 17: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/17.jpg)
OPERATION
INTEGRATIONpublic void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
String content = renderMessage(customer, customer.account());
mailService.sendMail(email, content); }
private String renderMessage(Customer customer, Account account) { String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; return "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service"; }
INTEGRATION OPERATION SEGREGATION PRINCIPLE
![Page 18: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/18.jpg)
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
String content = renderMessage(customer, customer.account());
mailService.sendMail(email, content); }
private String renderMessage(Customer customer, Account account) { String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; return "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service"; }
TESTS?
![Page 19: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/19.jpg)
OPERATION
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
String content = renderMessage(customer, customer.account());
mailService.sendMail(email, content); }
private String renderMessage(Customer customer, Account account) { String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; return "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service"; }
TESTS?
N UNITTESTS
![Page 20: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/20.jpg)
INTEGRATION
OPERATION
public void sendDiscountMailingTo(String email) { Customer customer = customerDB.findCustomerBy(email);
String content = renderMessage(customer, customer.account());
mailService.sendMail(email, content); }
private String renderMessage(Customer customer, Account account) { String discount = account == FREE ? "no" : account == BASE ? "a 10%" : account == PREMIUM ? "a 25%" : "-ERROR-"; return "Hello " + customer.getName() + ",\n\n" + "This week you get " + discount + " discount " + "on all our products.\n\n" + "Best Regards,\n" + "ACME Customer Service"; }
TESTS?1 INTEGRATION TEST
N UNITTESTS
![Page 21: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/21.jpg)
GREEN BAR PATTERNS*
Obvious Implementation
Fake it (until you make it)
Triangulation
* Kent Beck in "TDD by Example"
![Page 22: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/22.jpg)
GREEN BAR PATTERNS
Obvious Implementation
Fake it
Triangulation
Trade-Off
Complexity
![Page 23: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/23.jpg)
GREEN BAR PATTERNS DEMO
![Page 24: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/24.jpg)
SWEET SPOT
Trivial
GREEN BAR PATTERNS
Obvious Implementation
Fake it
Triangulation
![Page 25: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/25.jpg)
SWEET SPOT
Trivial
Structure
GREEN BAR PATTERNS
Obvious Implementation
Fake it
Triangulation
![Page 26: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/26.jpg)
SWEET SPOT
Trivial
Structure
Logic
GREEN BAR PATTERNS
Obvious Implementation
Fake it
Triangulation
![Page 27: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/27.jpg)
PREPARATORY REFACTORINGS*
*"An example of preparatory refactoring", Martin Fowler
![Page 28: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/28.jpg)
PREPARATORY REFACTORINGS*
*"An example of preparatory refactoring", Martin Fowler
![Page 29: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/29.jpg)
"GREEN" PHASE TRIANGULATION
Implementation Run Test
"Green Phase"
![Page 30: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/30.jpg)
LIMIT YOUR TIME IN RED
"Green Phase"
Implementation Run Test
![Page 31: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/31.jpg)
LIMIT YOUR TIME IN RED
"Green Phase"
Implementation Run Test
Implementation Run TestPreparatory Refactoring
![Page 32: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/32.jpg)
PREPARATORY REFACTORINGS
DEMO
![Page 33: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/33.jpg)
Acceptance Test
UI
Persistence
OUTSIDE-IN
![Page 34: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/34.jpg)
Acceptance Test
UI
Persistence
OUTSIDE-IN & MOCKS
![Page 35: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/35.jpg)
Unit test Mock
OUTSIDE-IN & MOCKS
![Page 36: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/36.jpg)
Unit Test
OUTSIDE-IN & MOCKS
![Page 37: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/37.jpg)
Acceptance Test
UI
Persistence
OUTSIDE-IN & MOCKS
![Page 38: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/38.jpg)
Non trivial
Acceptance Test
OUTSIDE-IN & FAKE IT
![Page 39: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/39.jpg)
Comprehensive
Acceptance Test
Faked Result
OUTSIDE-IN & FAKE IT
![Page 40: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/40.jpg)
Acceptance Test
Fake
Fake
OUTSIDE-IN & FAKE IT
![Page 41: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/41.jpg)
Acceptance Test Drive Structure
through Refactoring
OUTSIDE-IN & FAKE IT
![Page 42: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/42.jpg)
OUTSIDE-IN & FAKE IT
Acceptance Test
Unit Test
Fill logic with
triangulation
![Page 43: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/43.jpg)
OUTSIDE-IN & FAKE IT
Acceptance Test Unit Test
![Page 44: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/44.jpg)
OUTSIDE-IN & FAKE IT INTEGRATION
Fake It
TriangulationOPERATION
Start with
• comprehensive Acceptance Test
• faked result
Drive structure by refactoring
Drive logic by unit tests
![Page 45: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/45.jpg)
OUTSIDE-IN & FAKE IT INTEGRATION
Fake It
TriangulationOPERATION
Start with
• comprehensive Acceptance Test
• faked result
Drive structure by refactoring
Drive logic by unit tests
![Page 46: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/46.jpg)
DIAMOND KATA
![Page 47: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/47.jpg)
FAKE IT OUTSIDE-IN
DEMO
![Page 48: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/48.jpg)
FAKE-IT VARIANT CALCULATE BACKWARDS
DEMO
![Page 49: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/49.jpg)
WHY? Outside-In
=> YAGNI free design Without mocking drawbacks
![Page 50: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/50.jpg)
WHY? Outside-In
=> YAGNI free design Without mocking drawbacks
Vs Triangulation More time in GREEN Better Design Guidance
![Page 51: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/51.jpg)
DISCUSSION
![Page 52: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/52.jpg)
LICENSE Creative Commons Attribution-ShareAlike 3.0
![Page 53: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/53.jpg)
IMAGES Most are Public Domain except theses
Creative Commons with attributions:
"Unstruttalbrücke" by Störfix
From State Library of Queensland
![Page 54: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/54.jpg)
FAKE IT OUTSIDE-IN TDD MOB PROGRAMMING SESSION
![Page 55: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/55.jpg)
AGENDA 05 min. Intro & Kata 40 min. Mob Programming 15 min. Retro & Tradeoffs
![Page 56: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/56.jpg)
OUTSIDE-IN & FAKE IT INTEGRATION
Fake It
TriangulationOPERATION
Start with
• comprehensive Acceptance Test
• faked result
Drive structure by refactoring
Drive logic by unit tests
![Page 57: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/57.jpg)
OUTSIDE-IN & FAKE IT INTEGRATION
Fake It
TriangulationOPERATION
Start with
• comprehensive Acceptance Test
• faked result
Drive structure by refactoring
Drive logic by unit tests
![Page 58: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/58.jpg)
DIAMOND KATA
![Page 59: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/59.jpg)
KATA Continue Diamond Kata
https://github.com/davidvoelkel/diamond-kata
CODING SESSION
![Page 60: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/60.jpg)
RETROSPECTIVE Observations?
![Page 61: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/61.jpg)
RETROSPECTIVE Observations?
Strenghts / Weaknesses?
![Page 62: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/62.jpg)
TRADE-OFFS FAKE IT VS
OUTSIDE-IN & MOCKS TRIANGULATION
![Page 63: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/63.jpg)
CONDITIONAL INTERACTIONS
Mocking when IOSP not possible
public String signup(String username) throws Exception { if(userDB.findUserBy(username) == null) { userDB.createUser(new User(username)); return "Welcome " + username; } else { return "Username ' " + username + "' " + "already taken, please choose another"; } }
![Page 64: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/64.jpg)
COUPLING OUTSIDE-IN
Mocking Fake It
Decoupling Refactorability
![Page 65: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/65.jpg)
DATA GUIDES STRUCTURE
Triangulation Fake It
Structure Cumbersome Data guides well
![Page 66: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/66.jpg)
# BRANCHES
Triangulation Fake It
# N 1
More confidence More effort
![Page 67: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/67.jpg)
# BRANCHES
Triangulation Fake It
# N 1
Fake data easy to forget
Omitting cases is tempting
![Page 68: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/68.jpg)
TIME IN GREEN
Triangulation
Prep Refactoring Triangulation
Fake It
![Page 69: Fake It Outside-In TDD XP Days I… · 2014 Justin Searls "The Failures of 'Intro to TDD'" COMBINATION 2015 Dimitry Polivaev Outside-In with faked Data 2016 SoCraTes DE Outside-In](https://reader033.vdocuments.mx/reader033/viewer/2022051810/601b118772a05904a428c818/html5/thumbnails/69.jpg)
DISCUSSION