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

What's hot (20)

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

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

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

Recently uploaded (20)

PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 

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/