SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Test Driven Development
Clean Code that works!!!
Agenda
2
Intro to TDD
TDD by example
Conclusions
Intro
3
What is TDD
Developed (or rediscovered) by Kent Beck to encourage
simple design and inspire confidence.
Related to the test-first programming concepts of eXtrem
Programming
A software development process that relies on the
repetition of a very short development cicle
4
The golden rules
Never write model code
unless you have a test that
requires it
Write new code only if an
automated test has failed
Eliminate duplication
5
What's my motivation?
TDD<piè di
pagina><piè di
pagina><piè di 6
COURAGE
Clean Code that works!!!
Managing fear
“I have a problem and I
can't see the end from
the beginning”
Fear says you to be
carefull
7
TDD mantra
8
Benefits
9
Programmers who wrote more tests tended to be more productive
Programmers using TDD rarely felt the need to invoke a debugger
TDD offers validation of correctness and drives the design of a program
TDD offers the ability to take small steps
Even if more code is required, the total code implementation time could be
shorter
TDD can lead to more modularized, flexible and extensible code
Because no more code is written than necessary to pass a failing test case, tests
tend to cover every code path.
TDD by example
10
Multi Currency Money
11
Bond portfolio management system.
Company Shares Price Total
Pippo SpA 1000 25 25000
Pluto srl 400 100 40000
Total 65000
Multy currency report
Company Shar
es
Price Total
Pippo SpA 1000 25 EUR 25000 EUR
Gastone SaS 400 100 USD 40000 USD
Total 65000 EUR
Rates
From To Rate
USD EUR 2
12
Conclusions
13
TDD Best Practices I
Work only on one test at a time
14
TDD Best Practices II
Write test assertions
self-explanatory
15
TDD Best Practices III
Same structure for tests and
source code
16
TDD Best Practices IV
Keep tests small
17
TDD Best Practices V.I
integrate your code every few unit test and never
leave broken tests
18
If you are working in a team...
TDD Best Practices V.II
end every day with a broken test
19
If you are working alone...
Summary
TDD Mantra
TDD rhythm
Value Object pattern
Information Hiding principle
DRY principle
20
Bibliography and references
Kent Beck – Test-Driven Development by Example, The Addison-Wesley Signature Series
Jason Gorma – Agile Java Development: Test-Driven Development using JUnit and Eclipse
WardsWiKi - http://c2.com/cgi/wiki?TestDrivenDevelopment
WardsWiKi - http://c2.com/cgi/wiki?DontRepeatYourself
www.testdriven.com
www.junit.com
www.bigthink.it/php/test-driven-development-prima-i-test-poi-il-codice
www.agiledata.org/essays/tdd.html
21
Thank you for your attention!!!
22

Weitere ähnliche Inhalte

Was ist angesagt?

Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentguestc8093a6
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiPitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiAgileee
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentJohn Blum
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
Test driven development
Test driven developmentTest driven development
Test driven developmentNascenia IT
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven DevelopmentPablo Villar
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect coupleStephen Tucker
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) CodeOps Technologies LLP
 
Agile Programming Systems # TDD intro
Agile Programming Systems # TDD introAgile Programming Systems # TDD intro
Agile Programming Systems # TDD introVitaliy Kulikov
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy codeLars Thorup
 
TDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereDaniel Davis
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentguy_davis
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDDavid Rodenas
 

Was ist angesagt? (20)

Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiPitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz Bankowski
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
 
PHPUnit - Unit testing
PHPUnit - Unit testingPHPUnit - Unit testing
PHPUnit - Unit testing
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD)
 
Agile Programming Systems # TDD intro
Agile Programming Systems # TDD introAgile Programming Systems # TDD intro
Agile Programming Systems # TDD intro
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
 
TDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & Where
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 

Andere mochten auch

Test driven-development
Test driven-developmentTest driven-development
Test driven-developmentDavid Paluy
 
TDD - Short for Test Driven Development!
TDD - Short for Test Driven Development!TDD - Short for Test Driven Development!
TDD - Short for Test Driven Development!Bradley Cypert
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In ActionJon Kruger
 
Protokoll Vom 30.11.09
Protokoll Vom 30.11.09Protokoll Vom 30.11.09
Protokoll Vom 30.11.09Mareike Rensch
 
Flipping the pimp
Flipping the pimpFlipping the pimp
Flipping the pimpwieters
 
Interfaces humanas con kinect
Interfaces humanas con kinectInterfaces humanas con kinect
Interfaces humanas con kinectAndrés Londoño
 
Cómo valoran la RSC y el periodismo social los Medios y los periodistas
Cómo valoran la RSC y el periodismo social los Medios y los periodistasCómo valoran la RSC y el periodismo social los Medios y los periodistas
Cómo valoran la RSC y el periodismo social los Medios y los periodistasEstudio de Comunicación
 
Seguros agropecuarios y gestión integral de riesgos
Seguros agropecuarios y gestión integral de riesgosSeguros agropecuarios y gestión integral de riesgos
Seguros agropecuarios y gestión integral de riesgosFAO
 
Clients TS Consulting has worked with
Clients TS Consulting has worked withClients TS Consulting has worked with
Clients TS Consulting has worked withJoe Gabriel
 
Revista nuevas tecnologias
Revista nuevas tecnologiasRevista nuevas tecnologias
Revista nuevas tecnologiasSamy Martinez
 
Cach hoi va tra loi ve so thich trong tieng anh
Cach hoi va tra loi ve so thich trong tieng anhCach hoi va tra loi ve so thich trong tieng anh
Cach hoi va tra loi ve so thich trong tieng anhCleverlearnvietnam
 
Damas - market management system for TSO
Damas - market management system for TSODamas - market management system for TSO
Damas - market management system for TSOaxlboy
 
Presentacion VI jornadas Voluntariado Cáritas Toledo
Presentacion VI jornadas Voluntariado Cáritas ToledoPresentacion VI jornadas Voluntariado Cáritas Toledo
Presentacion VI jornadas Voluntariado Cáritas ToledoCaritas Toledo
 
Lifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath Testers
Lifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath TestersLifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath Testers
Lifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath TestersLifeloc Technologies
 
Neurología y apoptosis paola imbaquingo
Neurología y apoptosis paola imbaquingoNeurología y apoptosis paola imbaquingo
Neurología y apoptosis paola imbaquingopaolaimbaquingo
 
Rosa rueda cárceles 1
Rosa rueda cárceles 1Rosa rueda cárceles 1
Rosa rueda cárceles 1felirosa
 
Construyendo Aplicaciones Web con PHP + LUA + REDIS
Construyendo Aplicaciones Web con PHP + LUA + REDISConstruyendo Aplicaciones Web con PHP + LUA + REDIS
Construyendo Aplicaciones Web con PHP + LUA + REDISGonzalo Chacaltana
 

Andere mochten auch (20)

Test driven-development
Test driven-developmentTest driven-development
Test driven-development
 
TDD - Short for Test Driven Development!
TDD - Short for Test Driven Development!TDD - Short for Test Driven Development!
TDD - Short for Test Driven Development!
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
 
SE- PRODUCTS
SE- PRODUCTSSE- PRODUCTS
SE- PRODUCTS
 
Programme brasage 2014
Programme brasage 2014Programme brasage 2014
Programme brasage 2014
 
Protokoll Vom 30.11.09
Protokoll Vom 30.11.09Protokoll Vom 30.11.09
Protokoll Vom 30.11.09
 
Flipping the pimp
Flipping the pimpFlipping the pimp
Flipping the pimp
 
Interfaces humanas con kinect
Interfaces humanas con kinectInterfaces humanas con kinect
Interfaces humanas con kinect
 
Cómo valoran la RSC y el periodismo social los Medios y los periodistas
Cómo valoran la RSC y el periodismo social los Medios y los periodistasCómo valoran la RSC y el periodismo social los Medios y los periodistas
Cómo valoran la RSC y el periodismo social los Medios y los periodistas
 
Seguros agropecuarios y gestión integral de riesgos
Seguros agropecuarios y gestión integral de riesgosSeguros agropecuarios y gestión integral de riesgos
Seguros agropecuarios y gestión integral de riesgos
 
Clients TS Consulting has worked with
Clients TS Consulting has worked withClients TS Consulting has worked with
Clients TS Consulting has worked with
 
Revista nuevas tecnologias
Revista nuevas tecnologiasRevista nuevas tecnologias
Revista nuevas tecnologias
 
Cach hoi va tra loi ve so thich trong tieng anh
Cach hoi va tra loi ve so thich trong tieng anhCach hoi va tra loi ve so thich trong tieng anh
Cach hoi va tra loi ve so thich trong tieng anh
 
Damas - market management system for TSO
Damas - market management system for TSODamas - market management system for TSO
Damas - market management system for TSO
 
Presentacion VI jornadas Voluntariado Cáritas Toledo
Presentacion VI jornadas Voluntariado Cáritas ToledoPresentacion VI jornadas Voluntariado Cáritas Toledo
Presentacion VI jornadas Voluntariado Cáritas Toledo
 
EId Al Nakib CV
EId Al Nakib CVEId Al Nakib CV
EId Al Nakib CV
 
Lifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath Testers
Lifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath TestersLifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath Testers
Lifeloc EASYCAL Automatic Calibration Brochure for Workplace Breath Testers
 
Neurología y apoptosis paola imbaquingo
Neurología y apoptosis paola imbaquingoNeurología y apoptosis paola imbaquingo
Neurología y apoptosis paola imbaquingo
 
Rosa rueda cárceles 1
Rosa rueda cárceles 1Rosa rueda cárceles 1
Rosa rueda cárceles 1
 
Construyendo Aplicaciones Web con PHP + LUA + REDIS
Construyendo Aplicaciones Web con PHP + LUA + REDISConstruyendo Aplicaciones Web con PHP + LUA + REDIS
Construyendo Aplicaciones Web con PHP + LUA + REDIS
 

Ähnlich wie Test Driven Development

Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...mCloud
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentbhochhi
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25Jeremy Kendall
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019Paulo Clavijo
 
Bdd - L'arte di non farsi i fatti propri
Bdd - L'arte di non farsi i fatti propriBdd - L'arte di non farsi i fatti propri
Bdd - L'arte di non farsi i fatti propriCommit University
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionPyxis Technologies
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief exampleJeremy Kendall
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Developmentsatya sudheer
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Gianluca Padovani
 
How have we developed product without bugs
How have we developed product without bugsHow have we developed product without bugs
How have we developed product without bugsSigma Software
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDDAhmed Misbah
 
Pair programming and introduction to TDD
Pair programming and introduction to TDDPair programming and introduction to TDD
Pair programming and introduction to TDDArati Joshi
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with MagentoTu Hoang
 
Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference CardSeapine Software
 

Ähnlich wie Test Driven Development (20)

Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Bdd - L'arte di non farsi i fatti propri
Bdd - L'arte di non farsi i fatti propriBdd - L'arte di non farsi i fatti propri
Bdd - L'arte di non farsi i fatti propri
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Development
 
Methods of agile
Methods of agileMethods of agile
Methods of agile
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)
 
How have we developed product without bugs
How have we developed product without bugsHow have we developed product without bugs
How have we developed product without bugs
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDD
 
Pair programming and introduction to TDD
Pair programming and introduction to TDDPair programming and introduction to TDD
Pair programming and introduction to TDD
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
 
Intro to TDD
Intro to TDDIntro to TDD
Intro to TDD
 
Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference Card
 

Mehr von Consulthinkspa

GDPR - Il Nuovo Regolamento Generale sulla Protezione dei Dati
GDPR - Il Nuovo Regolamento Generale sulla Protezione dei DatiGDPR - Il Nuovo Regolamento Generale sulla Protezione dei Dati
GDPR - Il Nuovo Regolamento Generale sulla Protezione dei DatiConsulthinkspa
 
Big Data Vs. Open Data
Big Data Vs.  Open Data Big Data Vs.  Open Data
Big Data Vs. Open Data Consulthinkspa
 
Pensiero Analogico e Microservizi
Pensiero Analogico  e MicroserviziPensiero Analogico  e Microservizi
Pensiero Analogico e MicroserviziConsulthinkspa
 
DevOps - Come diventare un buon DevOpper
DevOps -  Come diventare un buon DevOpperDevOps -  Come diventare un buon DevOpper
DevOps - Come diventare un buon DevOpperConsulthinkspa
 
Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...
Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...
Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...Consulthinkspa
 
Scenari introduzione Application Service Governance in Azienda
Scenari introduzione Application Service Governance in AziendaScenari introduzione Application Service Governance in Azienda
Scenari introduzione Application Service Governance in AziendaConsulthinkspa
 
Droidcon it 2015: Android Lollipop for Enterprise
Droidcon it 2015: Android Lollipop for EnterpriseDroidcon it 2015: Android Lollipop for Enterprise
Droidcon it 2015: Android Lollipop for EnterpriseConsulthinkspa
 
IPv6 - Breve panoramica tra mito e realtà
IPv6 - Breve panoramica tra mito e realtàIPv6 - Breve panoramica tra mito e realtà
IPv6 - Breve panoramica tra mito e realtàConsulthinkspa
 
Big data - stack tecnologico
Big data -  stack tecnologicoBig data -  stack tecnologico
Big data - stack tecnologicoConsulthinkspa
 
Quality Software Development LifeCycle
Quality Software Development LifeCycleQuality Software Development LifeCycle
Quality Software Development LifeCycleConsulthinkspa
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...Consulthinkspa
 
Android Security - Key Management at GDG DevFest Rome 2013
Android Security - Key Management at GDG DevFest Rome 2013 Android Security - Key Management at GDG DevFest Rome 2013
Android Security - Key Management at GDG DevFest Rome 2013 Consulthinkspa
 
Prevenzione degli attacchi informatici che coinvolgono dati sensibili aziendali
Prevenzione degli attacchi informatici che coinvolgono dati sensibili aziendaliPrevenzione degli attacchi informatici che coinvolgono dati sensibili aziendali
Prevenzione degli attacchi informatici che coinvolgono dati sensibili aziendaliConsulthinkspa
 

Mehr von Consulthinkspa (17)

GDPR - Il Nuovo Regolamento Generale sulla Protezione dei Dati
GDPR - Il Nuovo Regolamento Generale sulla Protezione dei DatiGDPR - Il Nuovo Regolamento Generale sulla Protezione dei Dati
GDPR - Il Nuovo Regolamento Generale sulla Protezione dei Dati
 
Big Data Vs. Open Data
Big Data Vs.  Open Data Big Data Vs.  Open Data
Big Data Vs. Open Data
 
Data Science
Data ScienceData Science
Data Science
 
Hot trend 2017
Hot trend 2017Hot trend 2017
Hot trend 2017
 
Pensiero Analogico e Microservizi
Pensiero Analogico  e MicroserviziPensiero Analogico  e Microservizi
Pensiero Analogico e Microservizi
 
DevOps - Come diventare un buon DevOpper
DevOps -  Come diventare un buon DevOpperDevOps -  Come diventare un buon DevOpper
DevOps - Come diventare un buon DevOpper
 
Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...
Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...
Increasing Android app security for free - Roberto Gassirà, Roberto Piccirill...
 
Consulthink Overview
Consulthink OverviewConsulthink Overview
Consulthink Overview
 
Scenari introduzione Application Service Governance in Azienda
Scenari introduzione Application Service Governance in AziendaScenari introduzione Application Service Governance in Azienda
Scenari introduzione Application Service Governance in Azienda
 
Droidcon it 2015: Android Lollipop for Enterprise
Droidcon it 2015: Android Lollipop for EnterpriseDroidcon it 2015: Android Lollipop for Enterprise
Droidcon it 2015: Android Lollipop for Enterprise
 
IPv6 - Breve panoramica tra mito e realtà
IPv6 - Breve panoramica tra mito e realtàIPv6 - Breve panoramica tra mito e realtà
IPv6 - Breve panoramica tra mito e realtà
 
BitCoin Protocol
BitCoin ProtocolBitCoin Protocol
BitCoin Protocol
 
Big data - stack tecnologico
Big data -  stack tecnologicoBig data -  stack tecnologico
Big data - stack tecnologico
 
Quality Software Development LifeCycle
Quality Software Development LifeCycleQuality Software Development LifeCycle
Quality Software Development LifeCycle
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
 
Android Security - Key Management at GDG DevFest Rome 2013
Android Security - Key Management at GDG DevFest Rome 2013 Android Security - Key Management at GDG DevFest Rome 2013
Android Security - Key Management at GDG DevFest Rome 2013
 
Prevenzione degli attacchi informatici che coinvolgono dati sensibili aziendali
Prevenzione degli attacchi informatici che coinvolgono dati sensibili aziendaliPrevenzione degli attacchi informatici che coinvolgono dati sensibili aziendali
Prevenzione degli attacchi informatici che coinvolgono dati sensibili aziendali
 

Kürzlich hochgeladen

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Kürzlich hochgeladen (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Test Driven Development

  • 1. Test Driven Development Clean Code that works!!!
  • 2. Agenda 2 Intro to TDD TDD by example Conclusions
  • 4. What is TDD Developed (or rediscovered) by Kent Beck to encourage simple design and inspire confidence. Related to the test-first programming concepts of eXtrem Programming A software development process that relies on the repetition of a very short development cicle 4
  • 5. The golden rules Never write model code unless you have a test that requires it Write new code only if an automated test has failed Eliminate duplication 5
  • 6. What's my motivation? TDD<piè di pagina><piè di pagina><piè di 6 COURAGE Clean Code that works!!!
  • 7. Managing fear “I have a problem and I can't see the end from the beginning” Fear says you to be carefull 7
  • 9. Benefits 9 Programmers who wrote more tests tended to be more productive Programmers using TDD rarely felt the need to invoke a debugger TDD offers validation of correctness and drives the design of a program TDD offers the ability to take small steps Even if more code is required, the total code implementation time could be shorter TDD can lead to more modularized, flexible and extensible code Because no more code is written than necessary to pass a failing test case, tests tend to cover every code path.
  • 11. Multi Currency Money 11 Bond portfolio management system. Company Shares Price Total Pippo SpA 1000 25 25000 Pluto srl 400 100 40000 Total 65000 Multy currency report Company Shar es Price Total Pippo SpA 1000 25 EUR 25000 EUR Gastone SaS 400 100 USD 40000 USD Total 65000 EUR Rates From To Rate USD EUR 2
  • 12. 12
  • 14. TDD Best Practices I Work only on one test at a time 14
  • 15. TDD Best Practices II Write test assertions self-explanatory 15
  • 16. TDD Best Practices III Same structure for tests and source code 16
  • 17. TDD Best Practices IV Keep tests small 17
  • 18. TDD Best Practices V.I integrate your code every few unit test and never leave broken tests 18 If you are working in a team...
  • 19. TDD Best Practices V.II end every day with a broken test 19 If you are working alone...
  • 20. Summary TDD Mantra TDD rhythm Value Object pattern Information Hiding principle DRY principle 20
  • 21. Bibliography and references Kent Beck – Test-Driven Development by Example, The Addison-Wesley Signature Series Jason Gorma – Agile Java Development: Test-Driven Development using JUnit and Eclipse WardsWiKi - http://c2.com/cgi/wiki?TestDrivenDevelopment WardsWiKi - http://c2.com/cgi/wiki?DontRepeatYourself www.testdriven.com www.junit.com www.bigthink.it/php/test-driven-development-prima-i-test-poi-il-codice www.agiledata.org/essays/tdd.html 21
  • 22. Thank you for your attention!!! 22