SlideShare a Scribd company logo
1 of 34
Download to read offline
How TDD can protect you from your own experience
TDD: Cultivating a Beginner’s Mind
Shai Yallin, Head of Backend Engineering
linkedin.com/electricmonk@shaiyallinshaiy@wix.com
Your job 

is not 

to write code
TDD

is not 

about testing
You

are not 

a software engineer
01 02 03
Hi.
I’m Shai Yallin.

o Coding since 1994

o Engineering software and culture at Wix.com since 2010 

o Involved with Israeli Scala and TDD communities

o Rewrote big chunks of Wix backend code
There is a common misconception
of what design is.
01
Is it this?
http://www.u.arizona.edu/~przybyls/labels/software.html
http://www.tracemodeler.com/gallery/java%20io%20-%20reading%20an%20int%20from%20a%20file.html
Software design is the process of implementing
software solutions to one or more set of problems. 

One of the important parts of software design is the
software requirements analysis (SRA).
It is a part of the software development process that
lists specifications used in software engineering.
“ “
http://www.chrisaitchison.com/2011/05/03/you-are-not-a-software-engineer/
You are NOT a Software Engineer. 

You do not build skyscrapers. You do not build bridges.

You grow gardens.

You are a Software Gardener.
Growing Object-Oriented Software, Guided by Tests, page XVII
We used the term “Growing”
because it gives a sense of how
we develop incrementally.
“Growing” also hints at the
biological quality we see in good
software, the sense of coherence
at every level of structure.
“ “
http://c2.com/cgi/wiki?WhatIsSoftwareDesign
When you are programming, 

you are doing detailed design… 

class diagrams are not the design.
programming and design [aren’t]
different, we just misunderstood
[them]. Coding and testing are
[part of] design.
“ “
To code is to design.
As we grow our software

the design emerges.
http://www.laputan.org/mud/
http://effectivesoftwaredesign.com/2013/06/17/the-myth-of-emergent-design-and-the-big-ball-of-mud/
http://www.bonsaitreegardener.net/care/growing-from-seed
www.stylepinner.com
We code according to product requirements.
Alas, requirements may change as the software grows.
Often, this gives rise to Big Balls Of Mud.
Thus, focus on
interfaces and defer
the implementation.
Requirements will
change.
Early design
decisions have
bigger impact than
later decisions.
Your experience makes you
vulnerable.
02
We grew up on
GoF, Spring,
Hibernate and
the likes.
Patterns and
technologies
are cool and
exciting. 

We want to use
them.
We are proud of
our
achievements.
We make the mistake of automatically following
familiar patterns.
shop.lego.com
www.laserpegs.com
Always end up with cohesive,
loosely-coupled, SOLID systems.
You Ain’t Gonna
Need It.
www.mememaker.net
Use abstractions to form a meaningful
language over the code.
LibrarianBookService
We sin in indirections and bad naming.
Bad naming might fixate our thinking.
Your job is to 

introduce abstractions,
not to write code.
www.protocol-consulting.com
rodrigueaflatounamsterdam.wordpress.com
Old habits lead to pattern abuse,
indirections and over-engineering.
We need to lose the design-
pattern colored glasses.
Always code as if
you’re on the outside
looking in.
https://campfornow.wordpress.com/2014/09/03/on-the-outside-looking-in/
1
2
Code to interfaces rather than to
implementation, by writing a new
collaborator (method, class, module)
from the call site.
The same approach can – and should
– be used when approaching systems,
sub-systems and modules.
apivoice.com

www.streetnpark.com
TDD to the
Rescue
03
Not TDD
● Writing tests after writing
production code
● Writing all tests for a module
before writing the module
● Writing lots of E2E tests that
are tightly-coupled to the
system’s inner behavior
● Writing E2Es for the server
without including the client in
the flows
Same rules apply on tests 

(as for code) – YAGNI!
Not E2E
There should be few E2Es, 

that are oblivious to implementation
Duh!
TDD at Wix
2013 201420122011
Major Refactoring
Of BBOM via E2E
acceptance tests
PETRI
Developed using
TDD
IT/E2E
infrastructure for
HTTP servers
Beginnings
Of TDD
adoption
Teaching TDD
As part of Wix
Academy
Refactor
pixabay.com
Make the
Test Pass
Write a
Failing Test
The TDD Cycle
Refactor
Make the Test
Pass
Write a Failing
Test
Kicking Off the TDD Cycle
Pick one,
simple feature
with PM
Understanding that our requirements are wrong / not accurate /
not enough / 

more difficult to implement than we thought
❑ Demonstrates the 1st use case E2E
❑ Describes the problem domain IN ENGLISH
❑ Makes NO ASSUMPTIONS about implementation details
Refactor
Make the Test
Pass
Write a Failing
Test
❑ Pass the test with the SIMPLEST code possible – no design!
❑ End up with the WALKING SKELETON
Refactor
Make the Test
Pass
Write a Failing
Test
❑ LOOK FOR SMELLS in the code we wrote and affected code
❑ Determine SOLUTIONS (design patterns / missing abstractions)
❑ TEST CODE IS CODE too and should have language and abstractions
Refactor
Make the Test
Pass
Write a Failing
Test
http://martinfowler.com/books/refactoring.html
Refactoring [does not] alter the
external behavior of the code…
When you refactor you are
improving the design of the code
after it has been written.
“ “
It is our job, a craft that requires our expertise

yet -
It is often regarded as optional or left out
The Paradox with Refactoring
TDD is your shield
TDD compels you to code 

in small increments

(effectively holding us back from 

making drastic unnecessary changes).
Refactoring is what aims
you towards the required
abstractions.
When you test-drive your
code, you implicitly do
outside-in development.
Develop from the
Outside-in
AbstractYAGNI
TDD is your shield, so:
We grow up on
GoF, Spring and
Hibernate books.
Patterns and
technologies are
cool and
exciting. 

We want to use
them.
We are proud of
our
achievements.
Cultivating a
Beginner’s Mind.
Should we use
them?
Pride clouds our
judgment.
Letting go of our egos, shedding off old habits.
Q&A
http://www.shaiyallin.com/
Shai Yallin
linkedin/electricmonk@shaiyallinshaiy@wix.com

More Related Content

What's hot

What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
Simplilearn
 

What's hot (20)

Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...
Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...
Lemi Orhan Ergin - Code Your Agility: Tips for Boosting Technical Agility in ...
 
Guided Path to DevOps Career.
Guided Path to DevOps Career.Guided Path to DevOps Career.
Guided Path to DevOps Career.
 
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
 
Tailoring your SDLC for DevOps, Agile and more
Tailoring your SDLC for DevOps, Agile and moreTailoring your SDLC for DevOps, Agile and more
Tailoring your SDLC for DevOps, Agile and more
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
 
DOES15 - Elisabeth Hendrickson - Its All About Feedback
DOES15 - Elisabeth Hendrickson - Its All About FeedbackDOES15 - Elisabeth Hendrickson - Its All About Feedback
DOES15 - Elisabeth Hendrickson - Its All About Feedback
 
Agile paris 2022 sharing
Agile paris 2022   sharingAgile paris 2022   sharing
Agile paris 2022 sharing
 
DevOps 101
DevOps 101DevOps 101
DevOps 101
 
The business case for devops
The business case for devopsThe business case for devops
The business case for devops
 
DevOps 101 - an Introduction to DevOps
DevOps 101  - an Introduction to DevOpsDevOps 101  - an Introduction to DevOps
DevOps 101 - an Introduction to DevOps
 
How We Do DevOps at Walmart: OneOps OSS Application Lifecycle Management Plat...
How We Do DevOps at Walmart: OneOps OSS Application Lifecycle Management Plat...How We Do DevOps at Walmart: OneOps OSS Application Lifecycle Management Plat...
How We Do DevOps at Walmart: OneOps OSS Application Lifecycle Management Plat...
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partner
 
What is-not-devops!
What is-not-devops!What is-not-devops!
What is-not-devops!
 
About DevOps in simple steps
About DevOps in simple stepsAbout DevOps in simple steps
About DevOps in simple steps
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015
 
ScrumOps - Featuring Dave West & Jayne Groll
ScrumOps - Featuring Dave West & Jayne GrollScrumOps - Featuring Dave West & Jayne Groll
ScrumOps - Featuring Dave West & Jayne Groll
 
from 0 to continuous delivery in 30 minutes
from 0 to continuous delivery in 30 minutesfrom 0 to continuous delivery in 30 minutes
from 0 to continuous delivery in 30 minutes
 
DevOps Overview
DevOps OverviewDevOps Overview
DevOps Overview
 
Software Architecture Anti-Patterns
Software Architecture Anti-PatternsSoftware Architecture Anti-Patterns
Software Architecture Anti-Patterns
 
Continuously Deploying Culture: Scaling Culture at Etsy - Velocity Europe 2012
Continuously Deploying Culture: Scaling Culture at Etsy - Velocity Europe 2012Continuously Deploying Culture: Scaling Culture at Etsy - Velocity Europe 2012
Continuously Deploying Culture: Scaling Culture at Etsy - Velocity Europe 2012
 

Viewers also liked

Viewers also liked (7)

Writing and using Hamcrest Matchers
Writing and using Hamcrest MatchersWriting and using Hamcrest Matchers
Writing and using Hamcrest Matchers
 
Startup marketing workshop - marketing experts and tools
Startup marketing workshop - marketing experts and toolsStartup marketing workshop - marketing experts and tools
Startup marketing workshop - marketing experts and tools
 
The Immor(t)ality of Legacy Projects - Dalia Simons, Wix - DevOpsDays Tel Avi...
The Immor(t)ality of Legacy Projects - Dalia Simons, Wix - DevOpsDays Tel Avi...The Immor(t)ality of Legacy Projects - Dalia Simons, Wix - DevOpsDays Tel Avi...
The Immor(t)ality of Legacy Projects - Dalia Simons, Wix - DevOpsDays Tel Avi...
 
Experimenting on Humans
Experimenting on HumansExperimenting on Humans
Experimenting on Humans
 
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 

Similar to TDD - Cultivating a Beginner's Mind

Recipe of a rockstar developer
Recipe of a rockstar developerRecipe of a rockstar developer
Recipe of a rockstar developer
Topu Newaj
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
Svetlin Nakov
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
John Choi
 

Similar to TDD - Cultivating a Beginner's Mind (20)

Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
 
Recipe of a rockstar developer
Recipe of a rockstar developerRecipe of a rockstar developer
Recipe of a rockstar developer
 
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
Greythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideGreythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview Guide
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript Code
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
Waste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupWaste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia Meetup
 
How to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software DeveloperHow to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software Developer
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Quick Intro to Clean Coding
Quick Intro to Clean CodingQuick Intro to Clean Coding
Quick Intro to Clean Coding
 
Coding principles
Coding principles Coding principles
Coding principles
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
 
Code smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software OdorsCode smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software Odors
 
Software as a craft (February, 2018)
Software as a craft (February, 2018)Software as a craft (February, 2018)
Software as a craft (February, 2018)
 
Software Design Notes
Software Design NotesSoftware Design Notes
Software Design Notes
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
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
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

TDD - Cultivating a Beginner's Mind