SlideShare a Scribd company logo
Coding Dojo:
TDD as if You Meant It
Agile Testing Days 2013

Peter Kofler, ‘Code Cop’
@codecopkofler
www.code-cop.org
Copyright Peter Kofler, licensed under CC-BY.
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Peter Kofler
• Software Developer
for 14 years
• “fanatic about
code quality”
• I help development teams to do it right
• Pair Programming #CodeCopTour
Expectations?
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Coding Dojo Mindset
●

Safe place outside
work

●

We are here to learn

●

Need to slow down

●

Focus on doing it right

●

Collaborative Game
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Dojo Structure
●

Introduction 15'

●

Coding 30'

●

Interim (Retrospective) 15'

●

Break 25'

●

Coding 45'

●

Retrospective 15'
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

TDD Skills
●

Driving Development with Tests 

●

Designing Test Cases

●

Designing Clean Code

●

Refactoring Safely
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

TDD should be...
●

Add a test

●

See it fail

●

Add code to make all tests pass

●

Refactor mercilessly

●

Repeat
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

… but often is
●

Think up design

●

Write some tests that verify the design

●

Write full implementation

●

Test, debug, test, debug, test, debug, …

●

Add TODO to refactor later
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

TDD as if You Meant It
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Rules
Exactly one, simplest failing test
●
Least code possible to pass failing test
●
Add code only to test methods
●
When duplication is spotted
●
Extract non-test methods (extract method)
●
New classes only as target for “move method”
●
Refactor as required
●
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Assignment
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Tic-Tac-Toe
●

http://en.wikipedia.org/wiki/Tic-tac-toe

●

Board 3x3

●

X plays first, O plays second

●

Check if/who is winner
Don't Focus on
Getting it Done.
F0cus on Doing
It Perfectly.
→Practice
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Closing Circle
●

What did you learn today?

●

What surprised you today?

●

What will you do
differently in the
future?
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Please evaluate my presentation
using the AgileTD Mobile App at
www.touchmyconference.com/ATD2013

I appreciate your feedback.
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

Peter Kofler
@codecopkofler
www.code-cop.org

Kata by

Keith Braithwaite
@keithb_b
http://cumulative-hypotheses.org/2011/08/30/tdd-as-if-you-meant-it/
PETER KOFLER, CODE-COP.ORG

FANATIC ABOUT CODE QUALITY

CC Images
●

Dojo http://www.flickr.com/photos/49715404@N00/3267627038/

●

Todos http://www.flickr.com/photos/kylesteeddesign/3724074594/

●

Signs http://www.flickr.com/photos/rwp-roger/7689114246/

●

Game http://www.flickr.com/photos/benclinch/476855843/

●

Wants you http://www.flickr.com/photos/shutter/105497713/

More Related Content

PDF
The Brutal Refactoring Game (2013)
PDF
Code Retreat Graz, Austria 2013
PDF
Designing Test Cases for the Gilded Rose Kata (2013)
PDF
Idiomatic R for Rosetta Code (2013)
PDF
Software Craftsmanship Journeyman Tour (2013)
PDF
Deliberate Practice (Agile Slovenia 2015)
PDF
Coding Dojo: Functional Calisthenics (2016)
PDF
Designing Test Cases for the Gilded Rose Kata v3 (2016)
The Brutal Refactoring Game (2013)
Code Retreat Graz, Austria 2013
Designing Test Cases for the Gilded Rose Kata (2013)
Idiomatic R for Rosetta Code (2013)
Software Craftsmanship Journeyman Tour (2013)
Deliberate Practice (Agile Slovenia 2015)
Coding Dojo: Functional Calisthenics (2016)
Designing Test Cases for the Gilded Rose Kata v3 (2016)

What's hot (20)

PDF
Refactoring the Tennis Kata v2 (2016)
PDF
Clean Readable Specifications (ETC 2016)
PDF
Brutal Coding Constraints (ITAKE 2017)
PDF
JUnit Boot Camp (GeeCON 2016)
PDF
Coding Dojo: Data Munging (2016)
PDF
Code Retreat Venice (2016)
PDF
Coding Dojo: Bank OCR Outside-In (2015)
PDF
Coding Dojo: Asynchronous Clock-In (2016)
PDF
Coding Dojo: Mars Rover (2014)
PDF
Mob Programming (2016)
PDF
Code Quality Assurance v4 (2013)
PDF
Extract Method Refactoring Workshop (2016)
PDF
Coding Dojo Object Calisthenics (2016)
PDF
Refactoring the Tennis Kata (2013)
PDF
Coding Dojo: Adding Tests to Legacy Code (2014)
PDF
GDCR15 in Las Palmas, Gran Canaria
PDF
Coding Dojo: Naming with Dices (2021)
PDF
Coding Dojo: Baby Steps Push Challenge (2021)
PDF
TDD and Related Techniques for Non Developers (2012)
PDF
Pair Programming (2015)
Refactoring the Tennis Kata v2 (2016)
Clean Readable Specifications (ETC 2016)
Brutal Coding Constraints (ITAKE 2017)
JUnit Boot Camp (GeeCON 2016)
Coding Dojo: Data Munging (2016)
Code Retreat Venice (2016)
Coding Dojo: Bank OCR Outside-In (2015)
Coding Dojo: Asynchronous Clock-In (2016)
Coding Dojo: Mars Rover (2014)
Mob Programming (2016)
Code Quality Assurance v4 (2013)
Extract Method Refactoring Workshop (2016)
Coding Dojo Object Calisthenics (2016)
Refactoring the Tennis Kata (2013)
Coding Dojo: Adding Tests to Legacy Code (2014)
GDCR15 in Las Palmas, Gran Canaria
Coding Dojo: Naming with Dices (2021)
Coding Dojo: Baby Steps Push Challenge (2021)
TDD and Related Techniques for Non Developers (2012)
Pair Programming (2015)
Ad

Similar to TDD as if You Meant It (2013) (18)

PDF
Coding Dojo: Baby Steps (2014)
PDF
Coding Dojo: Roman Numerals (2014)
PDF
Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)
PDF
Coding Dojo: Tic-Tac-Toe (2014)
PDF
Coding Dojo: String Calculator (2013)
PDF
Deliberate Practice (2014)
PDF
Designing Test Cases for the Gilded Rose Kata v2 (2015)
PDF
Coding Dojo: Fun with Tic-Tac-Toe (2014)
PDF
Coding Dojo: Bank OCR (2014)
PDF
Outside-in Test Driven Development - the London School of TDD
PDF
Prime Factors Code Kata - Practicing TDD (2014)
PDF
Deliberate Practice, New Learning Styles (2015)
PDF
Pragmatic Introduction to Python Unit Testing (PyDays 2018)
PDF
Pair Programming (2014)
PDF
Pragmatic Introduction to PHP Unit Testing (2015)
PDF
Using Automated Code Reviews to Achieve Continuous Quality (ASQF Agile Night ...
PDF
Can PL/SQL be Clean? (2013)
PDF
Coding Dojo: Baby Steps (2014)
Coding Dojo: Roman Numerals (2014)
Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)
Coding Dojo: Tic-Tac-Toe (2014)
Coding Dojo: String Calculator (2013)
Deliberate Practice (2014)
Designing Test Cases for the Gilded Rose Kata v2 (2015)
Coding Dojo: Fun with Tic-Tac-Toe (2014)
Coding Dojo: Bank OCR (2014)
Outside-in Test Driven Development - the London School of TDD
Prime Factors Code Kata - Practicing TDD (2014)
Deliberate Practice, New Learning Styles (2015)
Pragmatic Introduction to Python Unit Testing (PyDays 2018)
Pair Programming (2014)
Pragmatic Introduction to PHP Unit Testing (2015)
Using Automated Code Reviews to Achieve Continuous Quality (ASQF Agile Night ...
Can PL/SQL be Clean? (2013)
Ad

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PPTX
Cloud computing and distributed systems.
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The Rise and Fall of 3GPP – Time for a Sabbatical?
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Cloud computing and distributed systems.

TDD as if You Meant It (2013)

  • 1. Coding Dojo: TDD as if You Meant It Agile Testing Days 2013 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.
  • 2. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Peter Kofler • Software Developer for 14 years • “fanatic about code quality” • I help development teams to do it right • Pair Programming #CodeCopTour
  • 4. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Coding Dojo Mindset ● Safe place outside work ● We are here to learn ● Need to slow down ● Focus on doing it right ● Collaborative Game
  • 5. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Dojo Structure ● Introduction 15' ● Coding 30' ● Interim (Retrospective) 15' ● Break 25' ● Coding 45' ● Retrospective 15'
  • 6. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY TDD Skills ● Driving Development with Tests  ● Designing Test Cases ● Designing Clean Code ● Refactoring Safely
  • 7. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY TDD should be... ● Add a test ● See it fail ● Add code to make all tests pass ● Refactor mercilessly ● Repeat
  • 8. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY … but often is ● Think up design ● Write some tests that verify the design ● Write full implementation ● Test, debug, test, debug, test, debug, … ● Add TODO to refactor later
  • 9. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY TDD as if You Meant It
  • 10. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Rules Exactly one, simplest failing test ● Least code possible to pass failing test ● Add code only to test methods ● When duplication is spotted ● Extract non-test methods (extract method) ● New classes only as target for “move method” ● Refactor as required ●
  • 11. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Assignment
  • 12. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Tic-Tac-Toe ● http://en.wikipedia.org/wiki/Tic-tac-toe ● Board 3x3 ● X plays first, O plays second ● Check if/who is winner
  • 13. Don't Focus on Getting it Done. F0cus on Doing It Perfectly.
  • 15. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Closing Circle ● What did you learn today? ● What surprised you today? ● What will you do differently in the future?
  • 16. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Please evaluate my presentation using the AgileTD Mobile App at www.touchmyconference.com/ATD2013 I appreciate your feedback.
  • 17. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Peter Kofler @codecopkofler www.code-cop.org Kata by Keith Braithwaite @keithb_b http://cumulative-hypotheses.org/2011/08/30/tdd-as-if-you-meant-it/
  • 18. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY CC Images ● Dojo http://www.flickr.com/photos/49715404@N00/3267627038/ ● Todos http://www.flickr.com/photos/kylesteeddesign/3724074594/ ● Signs http://www.flickr.com/photos/rwp-roger/7689114246/ ● Game http://www.flickr.com/photos/benclinch/476855843/ ● Wants you http://www.flickr.com/photos/shutter/105497713/