SlideShare a Scribd company logo
1 of 43
Download to read offline
TDD is for Dreamers,

not for Real Developers,
Isn’t It?
Sven Amann
academicscode.com
letsdeveloper.com
@svamann
artwork by Sven Amann - CC BY-SA 4.0
Why do I talk about TDD?
Why TDD
(discussions)?
artwork by Sven Amann - CC BY-SA 4.0
Sven Amann
artwork by Sven Amann - CC BY-SA 4.0
Academics code
Physicist
Computer
Scientist
artwork by Sven Amann - CC BY-SA 4.0
A Pro
Introduction to Computer
Science I - WS06/07
artwork by Sven Amann - CC BY-SA 4.0
“Faster development, higher code quality,
better design, and less waste!” Kent Beck
“Self-testing code and clean
interfaces!” Martin Fowler
“Exhaustive test suites, close to no
debugging, changing code without
fear, reduced coupling, …” Uncle Bob
“Fast feedback and safe
refactoring” James Shore
Academics code
artwork by Sven Amann - CC BY-SA 4.0
Academic
Industry
Developer
artwork by Sven Amann - CC BY-SA 4.0
Academic
Industry
Developer
artwork by Sven Amann - CC BY-SA 4.0
Academic
Industry
Developer
artwork by Sven Amann - CC BY-SA 4.0
“TDD is dead. Long live testing” DHH
“TDD needs a funeral.” Cope
“The real "problems" with TDD [is] in the "driven"
part, not the "test" part [and] the zealotry of
some of its evangelists” Rich Hickey
?!?
artwork by Sven Amann - CC BY-SA 4.0
Agile Alliance TDD
1976: The Dark Age of Developer Testing

“a developer should never test their own code”

Glenford Myers in “Software Reliability”
1994 - Kent Beck develops SUnit
1999 - Kent says “test first” in “XP Explained”
until 2002 - “test first” evolves to “test driven”
Source: https://www.agilealliance.org/glossary/tdd/
Queueing Theory
Source: http://blog.jbrains.ca/permalink/how-test-driven-development-works-and-more
Test-first Programming
Source: http://blog.jbrains.ca/permalink/how-test-driven-development-works-and-more
Uncle Bob’s Three Laws of TDD
1. You are not allowed to write any
production code unless it is to make a
failing unit test pass.
2. You are not allowed to write any more
of a unit test than is sufficient to fail;
and compilation failures are failures.
3. You are not allowed to write any more
production code than is sufficient to
pass the one failing unit test.
Source: http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
Classic
TDD
Classic
TDD Test: 1 = “I”
return “I”;
Test: 2 = “II”
return (i == 1) ? “I” : “II”;
Test: 3 = “III”
return i * “I”;
...
Classic
TDD
• Roman Numbers
• FizzBuzz
• Bowling Game
• Game of Life
• Harry Potter Book Sets
• …
Algorithms with
well-defined input-output relation
Test!
!Test
artwork by Sven Amann - CC BY-SA 4.0
–John Sonmez
“By writing unit tests ... you find all kinds of
problems with that code ... of those units [but]
unit testing is more of an appraisal activity than
a testing one... very few regressions are caught
by unit tests since changing the unit of code
you’re testing almost always involves changing
the unit test itself.”
Table 3-25, p. 179
Developer Test
≠
Acceptance Test
artwork by Sven Amann - CC BY-SA 4.0
“a developer should never test their own code”
–Glenford Myers
artwork by Sven Amann - CC BY-SA 4.0
self
control
Developer tests
are our job!
artwork by Sven Amann - CC BY-SA 4.0
Test
Test B
Test
Waste
Valuable
Tests
artwork by Sven Amann - CC BY-SA 4.0
TDD Tests
Required Functionality
All It Can Do
artwork by Sven Amann - CC BY-SA 4.0
Waste
Toy Project Real Software
???
Test-driven Programming
Source: http://blog.jbrains.ca/permalink/how-test-driven-development-works-and-more
London School TDD
London School TDD
Source: http://coding-is-like-cooking.info/tag/london-school-tdd/
???
Sale
Catalog
Display
Acceptance Test: “Sell One Item”
–James O. Coplien (Cope)
“TDD was created to replace up-front
architecture. It is not a testing technique.”
Source: https://twitter.com/jcoplien/status/828291686128304130
class Person
def age
Date.today.year - birthday.year
end
end
test “a person’s age is determined by birthday” do
seventy_niner = Person.new birthday: Date.new(1979)
travel_to Date.new(2009)
assert_equal 30, seventy_niner.age
end
artwork by Sven Amann - CC BY-SA 4.0
class Person
def age(now = Date.today)
now - birthday.year
end
end
test “a person’s age is determined by birthday” do
seventy_niner = Person.new birthday: Date.new(1979)
assert_equal 30, seventy_niner.age Date.new(2009)
end
First Design,
then Code,
then Test.
That’s how
we’ve always
done it.
artwork by Sven Amann - CC BY-SA 4.0
Traditional
Waterfall
Testing
Agile
Over-Enthusiast
All but that…
–David Heinemeier Hansson (DHH)
“Writing software is more like writing french
poetry than a hard science.”
The Ultimate Design
(You’ll Never Need)
artwork by Sven Amann - CC BY-SA 4.0
–Joe Rainsberger (jbrains)
“TDD doesn't create design. You do.”
Check Your Own Work Cleanup After Your TDD
Remember To Think
Listen Closely &
Consider the Context
–Joe Rainsberger (jbrains)
“TDD Is Not Magic. The rules themselves do not
guarantee success. You have to keep the brain
switched on. You have to pay attention to what’s
happening. You need a place to ask questions
and get answers. You need to know that when you
practise TDD, your code starts to speak to you,
but in a language you [may not yet] understand,
and that when you write tests and run them, this
act equates to learning a language by hearing it,
trying to speak it, and by native speakers
correcting you. If you do these things, then I
expect TDD to “work” for you.”
Sven Amann
academicscode.com
letsdeveloper.com
youtube.com/letsdeveloper
@svamann
artwork by Sven Amann - CC BY-SA 4.0

More Related Content

Viewers also liked

Lit Circles: Rebooted for CCSS and the 4Cs
Lit Circles: Rebooted for CCSS and the 4CsLit Circles: Rebooted for CCSS and the 4Cs
Lit Circles: Rebooted for CCSS and the 4Cs
Jon Corippo
 
Neuro science and mystical experience
Neuro science and mystical experienceNeuro science and mystical experience
Neuro science and mystical experience
Joby Mathew
 

Viewers also liked (9)

1.4.3 Компенсация реактивной мощности
1.4.3 Компенсация реактивной мощности1.4.3 Компенсация реактивной мощности
1.4.3 Компенсация реактивной мощности
 
ACHAS. ADVANCED CHANGE AGENT
ACHAS. ADVANCED CHANGE AGENTACHAS. ADVANCED CHANGE AGENT
ACHAS. ADVANCED CHANGE AGENT
 
Lit Circles: Rebooted for CCSS and the 4Cs
Lit Circles: Rebooted for CCSS and the 4CsLit Circles: Rebooted for CCSS and the 4Cs
Lit Circles: Rebooted for CCSS and the 4Cs
 
Father's prayer
Father's prayerFather's prayer
Father's prayer
 
Neuro science and mystical experience
Neuro science and mystical experienceNeuro science and mystical experience
Neuro science and mystical experience
 
EBD CPAD Lições bíblicas 3° trimestre2015 aula 4 pastores e diáconos.
EBD CPAD Lições bíblicas 3° trimestre2015 aula 4 pastores e diáconos.EBD CPAD Lições bíblicas 3° trimestre2015 aula 4 pastores e diáconos.
EBD CPAD Lições bíblicas 3° trimestre2015 aula 4 pastores e diáconos.
 
Understanding financial in HR
Understanding financial in HRUnderstanding financial in HR
Understanding financial in HR
 
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
 
TDD or TFD
TDD or TFDTDD or TFD
TDD or TFD
 

Similar to TDD is for Dreamers, not for Real Developers, Isn't It? - Entwicklertag Frankfurt 2017

The Search for the Perfect Program
The Search for the Perfect ProgramThe Search for the Perfect Program
The Search for the Perfect Program
Natallie Baikevich
 

Similar to TDD is for Dreamers, not for Real Developers, Isn't It? - Entwicklertag Frankfurt 2017 (20)

What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red TeamWhat is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
 
Software testing (2) trainingin-mumbai...
Software testing (2) trainingin-mumbai...Software testing (2) trainingin-mumbai...
Software testing (2) trainingin-mumbai...
 
Software testing (2) trainingin-mumbai
Software testing (2) trainingin-mumbaiSoftware testing (2) trainingin-mumbai
Software testing (2) trainingin-mumbai
 
Six simple steps to unit testing happiness
Six simple steps to unit testing happinessSix simple steps to unit testing happiness
Six simple steps to unit testing happiness
 
100% Code Coverage in Symfony applications
100% Code Coverage in Symfony applications100% Code Coverage in Symfony applications
100% Code Coverage in Symfony applications
 
Static-Analysis-in-Industry.pptx
Static-Analysis-in-Industry.pptxStatic-Analysis-in-Industry.pptx
Static-Analysis-in-Industry.pptx
 
Introduzione allo Unit Testing
Introduzione allo Unit TestingIntroduzione allo Unit Testing
Introduzione allo Unit Testing
 
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-StudioArcheology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
 
We Continue Exploring Tizen: C# Components Proved to be of High Quality
We Continue Exploring Tizen: C# Components Proved to be of High QualityWe Continue Exploring Tizen: C# Components Proved to be of High Quality
We Continue Exploring Tizen: C# Components Proved to be of High Quality
 
All about PVS-Studio
All about PVS-StudioAll about PVS-Studio
All about PVS-Studio
 
Zero to tested
Zero to testedZero to tested
Zero to tested
 
The Search for the Perfect Program
The Search for the Perfect ProgramThe Search for the Perfect Program
The Search for the Perfect Program
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
 
Serverless in production, an experience report (NDC London, 31 Jan 2018)
Serverless in production, an experience report (NDC London, 31 Jan 2018)Serverless in production, an experience report (NDC London, 31 Jan 2018)
Serverless in production, an experience report (NDC London, 31 Jan 2018)
 
Serverless in production, an experience report (NDC London 2018)
Serverless in production, an experience report (NDC London 2018)Serverless in production, an experience report (NDC London 2018)
Serverless in production, an experience report (NDC London 2018)
 
100% Code Coverage in Real World Software
100% Code Coverage in Real World Software100% Code Coverage in Real World Software
100% Code Coverage in Real World Software
 
Serverless in production, an experience report
Serverless in production, an experience reportServerless in production, an experience report
Serverless in production, an experience report
 
Serverless in production, an experience report (London js community)
Serverless in production, an experience report (London js community)Serverless in production, an experience report (London js community)
Serverless in production, an experience report (London js community)
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+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
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Recently uploaded (20)

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+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...
 
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
 
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 kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
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...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%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
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
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
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 

TDD is for Dreamers, not for Real Developers, Isn't It? - Entwicklertag Frankfurt 2017