SlideShare a Scribd company logo
Test Driven Development
Erinda Jaupaj
@ErindaJaupi
Valentina Servile
@EsseValentina
goes to
Introduction
What is Test Driven Development?
Introduction
What is Test Driven Development?
Introduction
What is Test Driven Development?
Maybe we should first ask ourselves...
Introduction
What is Test Driven Development?
What is a Test?
Introduction: what is a test?
A test is an assertion about how your
code should work
Introduction: what is a test?
It’s automated
Introduction: what is a test?
It has a binary output
(It’s either passing or failing)
Introduction: what is a test?
It begins with a precondition
(setup)
Introduction: what is a test?
It invokes a unit of work in the system
(trigger)
Introduction: what is a test?
It makes an assertion about the result
Setting up the
precondition
Invoking the
desired behavior
Asserting about
what happened
Patterns
Back to our
main topic...
Introduction
What is Test Driven Development?
Introduction
What is Test Driven Development?
It’s a technique where you let tests
guide your development workflow
Introduction: how do I TDD?
It works in 3 steps:
Introduction: how do I TDD?
It works in 3 steps:
• Write a failing test
Introduction: how do I TDD?
It works in 3 steps:
• Write a failing test
• Write just enough code to make it pass
Introduction: how do I TDD?
It works in 3 steps:
• Write a failing test
• Write just enough code to make it pass
• Refactor your mess
Introduction: how do I TDD?
It works in 3 steps:
• Write a failing test
• Write just enough code to make it pass
• Refactor your mess
Rinse and
Repeat!
Introduction: how do I TDD?
REFACTOR
FAIL
PASS
TDD
Introduction
What a waste
Of time!!!
Just make it work!!!
Patterns
TDD
Hands on
TDD Hands on
The requirements:
• Print numbers in sequence
• If the number is divisible by 3, print “Fizz”
• If the number is divisible by 5, print “Buzz”
• If divisible by both, print “FizzBuzz”
Patterns
The
FizzBuzz Kata
Patterns
Ta-Da!
Wrapping up: what is TDD for?
Okay, so what?
Wrapping up: what is TDD for?
But...
Wrapping up: what is TDD for? ...Design!
You HAVE to think of the edge cases
Wrapping up: what is TDD for? ...Design!
It often leads you to a simpler solution
Wrapping up: what is TDD for? ...Design!
Makes you write pretty object interfaces
Wrapping up: what is TDD for? ...Design!
You HAVE to think OO. And keep it simple.
Wrapping up: what is TDD for? ...Design!
It’s easy to add new features!
Wrapping up: what is TDD for? ...also, tests
...and to check if you broke the old ones
Wrapping up: what is TDD for? ...also, tests
...I’ll write my tests after.
Wrapping up: what is TDD for? ...also, tests
The code is self documented
TDD vs Traditional
Wrapping up: when NOT to use TDD?
• The application has little to no
business logic (CRUD?)
• You are building a prototype
• Quality is not important
Wrapping up: when to use TDD?
• The application has complicated
business logic
• You don’t know how your
implementation will look like
• Correctness is crucial
• The project is gonna be long lived
and frequently retouched
Patterns
Give it a try!
www.xpeppers.com
/xpepperssrl@xpeppers
Thanks!
Any questions?
Resources:
• http://www.jamesshore.com/Agile-Book/test_driven_d
evelopment.html
• https://www.amazon.com/Test-Driven-Development-
Kent-Beck/dp/0321146530
• http://codingdojo.org/kata/

More Related Content

PDF
The Art of Questioning to improve Software Testing, Agile and Automating
PDF
Level Up Your Automated Tests
PDF
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
PPTX
Exceptions: Why, When, How and Where!
PPTX
Level Up Your Automated Tests
PPTX
TDD & Refactoring
PPTX
Go/Ruby/Java: What's next?
PPTX
Low Code Development: Workflow
The Art of Questioning to improve Software Testing, Agile and Automating
Level Up Your Automated Tests
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
Exceptions: Why, When, How and Where!
Level Up Your Automated Tests
TDD & Refactoring
Go/Ruby/Java: What's next?
Low Code Development: Workflow

Viewers also liked (20)

PPTX
No borders innovation: how to build a remote working-based “liquid company”
PDF
Google Next Cloud Trento
PDF
The tricky road to autonomous cars
PDF
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
PDF
Test Driven Development (TDD) & Continuous Integration (CI)
PDF
Intelligent Transportation by OpenMove
PDF
Test Driven Design - GDG DevFest Istanbul 2016
PDF
Test driven development
PDF
OpenStreetMap: state of the art technologies and challenges
PDF
Test Driven Design
PDF
Socket.IO
PPTX
Test-Driven Cloud Development with Oracle SOA Cloud Service and Oracle Develo...
PDF
Artusi Learning - Blended course
PDF
Digital Entrepreneur - Creare startup di successo
PDF
Test driven development_continuous_integration
PDF
Why Test Driven Development?
PDF
EyeCity - a Data-Driven Decision Maker
PDF
FrancigenR - Plan your trip, meet like-minded travellers
PDF
EIT Alumni Startup Days 2016 - Lisbon
PDF
A tabletop system to paper-prototype for mobile applications
No borders innovation: how to build a remote working-based “liquid company”
Google Next Cloud Trento
The tricky road to autonomous cars
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
Test Driven Development (TDD) & Continuous Integration (CI)
Intelligent Transportation by OpenMove
Test Driven Design - GDG DevFest Istanbul 2016
Test driven development
OpenStreetMap: state of the art technologies and challenges
Test Driven Design
Socket.IO
Test-Driven Cloud Development with Oracle SOA Cloud Service and Oracle Develo...
Artusi Learning - Blended course
Digital Entrepreneur - Creare startup di successo
Test driven development_continuous_integration
Why Test Driven Development?
EyeCity - a Data-Driven Decision Maker
FrancigenR - Plan your trip, meet like-minded travellers
EIT Alumni Startup Days 2016 - Lisbon
A tabletop system to paper-prototype for mobile applications
Ad

Similar to Test Driven Development SpeedRun (20)

PDF
iOS Test-Driven Development
PDF
TDD in Python With Pytest
PPTX
WeActuallyBuildStuff - Extreme Programming Live
PPTX
Intro to TDD
PDF
BDD & Rspec
PPT
Agile latvia evening_unit_testing_in_practice
PDF
TDD and Simple Design Workshop - Session 1 - March 2019
PPTX
Unit testing
PDF
The Way of The Software Craftsman # Part One: The Beginning
PPTX
2013 09-11 java zone - extreme programming live
PDF
Introducción práctica a TDD
PDF
Introducción práctica a Test-Driven Development (TDD)
PDF
PPTX
Lập trình hướng kiểm thử - Test Driven development
PDF
Tdd is not about testing
PPT
The ten commandments of TDD
PDF
Code Quality Makes Your Job Easier
PDF
TDD reloaded - JUGTAA 24 Ottobre 2012
PPTX
Agile Programming Live - AgilePrague2012
PDF
B D D Intro
iOS Test-Driven Development
TDD in Python With Pytest
WeActuallyBuildStuff - Extreme Programming Live
Intro to TDD
BDD & Rspec
Agile latvia evening_unit_testing_in_practice
TDD and Simple Design Workshop - Session 1 - March 2019
Unit testing
The Way of The Software Craftsman # Part One: The Beginning
2013 09-11 java zone - extreme programming live
Introducción práctica a TDD
Introducción práctica a Test-Driven Development (TDD)
Lập trình hướng kiểm thử - Test Driven development
Tdd is not about testing
The ten commandments of TDD
Code Quality Makes Your Job Easier
TDD reloaded - JUGTAA 24 Ottobre 2012
Agile Programming Live - AgilePrague2012
B D D Intro
Ad

More from Speck&Tech (20)

PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
PDF
Persuasive AI: risks and opportunities in the age of digital debate
PDF
Fai da te ed elettricità, con la bobina di Tesla!
PDF
DIY ed elettronica ai tempi dell’università
PDF
Sotto il letto, sopra il cloud: costruirsi un’infrastruttura da zero
PDF
Verze e diamanti: oltre le nanotecnologie
PDF
Respira, sei in Trentino! Monitorare l'invisibile
PDF
Cognitive Robotics: from Babies to Robots and AI
PDF
Edge AI: Bringing Intelligence to Embedded Devices
PDF
Genere e gioco da tavolo: il caso di "Free to Choose"
PDF
SPaRKLE: un rivelatore compatto di radiazioni spaziali, realizzato dagli stud...
PDF
Il ruolo degli stati alterati di coscienza e degli psichedelici nella terapia
PDF
Unity3D: Things you need to know to get started
PDF
Learning from Biometric Fingerprints to prevent Cyber Security Threats
PDF
How do we program a God? - Do the Androids dream of the electric sheep?
PDF
The bad, the ugly and the weird about IoT
PDF
Arduino is Hardware, Software, IoT and Community
PDF
Computational privacy: balancing privacy and utility in the digital era
PDF
Il trucco c'è (e si vede) - Beatrice Mautino
PDF
ScrapeGraphAI: AI-powered web scraping, reso facile con l'open source
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Persuasive AI: risks and opportunities in the age of digital debate
Fai da te ed elettricità, con la bobina di Tesla!
DIY ed elettronica ai tempi dell’università
Sotto il letto, sopra il cloud: costruirsi un’infrastruttura da zero
Verze e diamanti: oltre le nanotecnologie
Respira, sei in Trentino! Monitorare l'invisibile
Cognitive Robotics: from Babies to Robots and AI
Edge AI: Bringing Intelligence to Embedded Devices
Genere e gioco da tavolo: il caso di "Free to Choose"
SPaRKLE: un rivelatore compatto di radiazioni spaziali, realizzato dagli stud...
Il ruolo degli stati alterati di coscienza e degli psichedelici nella terapia
Unity3D: Things you need to know to get started
Learning from Biometric Fingerprints to prevent Cyber Security Threats
How do we program a God? - Do the Androids dream of the electric sheep?
The bad, the ugly and the weird about IoT
Arduino is Hardware, Software, IoT and Community
Computational privacy: balancing privacy and utility in the digital era
Il trucco c'è (e si vede) - Beatrice Mautino
ScrapeGraphAI: AI-powered web scraping, reso facile con l'open source

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Test Driven Development SpeedRun