SlideShare a Scribd company logo
1 of 64
Los Diez Mandamientos de
           TDD
     Scrum Bolivia Day
       Hernán Wilkinson

               Twitter: @HernanWilkinson
       Blog: objectmodels.blogspot.com
                       www.10pines.com

              agile software development & services
What is TDD?
This is NOT TDD, this is how you do it!




   So… what is the ESENCE of TDD
TDD is not about testing only
   It is more than that…
TDD is about doing incremental
 problem solving guided by concrete
             examples


We are used to incremental development
(cycles/iteration), but not incremental
design/programming
TDD brings testing to development
                cycle


               Analisys

                                   Testing
    Program.              Design
TDD brings testing to development
                cycle


                     Analisys



           Testing              Design




                     Program.
TDD brings testing to development
                  cycle

1. Tests are explicit, not implicit
   anymore
2. Tests run automatically, not because
   a person tests
3. Tests bring requirements to live!
TDD “SINCERIZA” programmers about
              testing
A programmer that is not a good tester
      is not a good programmer

Good Programmer = Good Tester




                 =
TDD is a cultural change… a big one
The Commandments

1. Management ones
2. Technical one
 A
The Management Commandments
You shall not expect your developers do
TDD because it is God, I mean Good 
You shall not expect your developers
   do TDD because it is God, I mean
                 Good 
1. It is a Cultural Change!
2. Cultural changes do not happen by themselves
3. As manager, you have to provide the
   environment for the change and support it
4. … and yes sometimes you have to be tuff, it is
   part of being a leader
5. It is great start doing Pair Programming!
You shall provide time to do TDD
You shall provide time to do TDD

1. YES!! Doing TDD TAKES TIME!!!
   and more at the beginning… It is a cultural
   change!
2. BUT… the time you “invest” doing TDD gets pay
   in the mid-term
3. Finding a bug running the tests during a
   regression has no price!… for the rest you have
   mastercard
You shall not send
  mixed messages
stopping TDD when
   time looks not
      enough
You shall not send mixed messages
    stopping TDD when time looks not
                  enough

1. The problem is the PLAN… it is a PLAN for God
   sake!
2. If you HAVE TO do it, provide a reasonable
   explanation, talk to your team!
You shall not expect no errors at all
You shall not expect no errors at all




1. Testing is not a “formal verification technique”
2. You can not say anything about what it is not
   tested… that is why it is important to write the
   test first
3. DO NOT STOP DOING TDD because you got
   some errors on production
4. Use Mutation Testing/Coverage to test your
   tests!!
You shall not expect one hundred
        percent coverage
You shall not expect one hundred
            percent coverage

1. Sometimes it is too costly to
   automatize certain tests
2. Coverage is not a good measure of
   testing quality
3. 100% coverage is impossible when
   just starting to do TDD
You shall not remove the QA team due
                to TDD
You shall not remove the QA team due
                 to TDD

1. Because TDD is not about testing
   only!
2. Because TDD does not test UI, user
   experience, performance, scalability,
   etc, etc
3. TDD helps QA to concentrate on the
   real and important issues
You shall wait for your team to be “test
                infected”
You shall wait for your team to be “test
                infected”

1.Experience is IMPORTANT. Wait your
team to become expert, it will not
happen in a week
2.Do not mix senior programmers with
junior programmers, but semi-senior
programmers with both (Pragmatic
thinking and learning)
The Technical Commandments
You shall write the test
          first
You shall write the test first

1. Is about incremental design and programming
2. Is not about providing a generic implementation
   with one case
3. It is not only about not doing what is not
   necessary
4. If you don’t do it, you will lie to yourself and
   forget to write some tests
5. If you don’t do it, you are just testing
6. IT IS THE MOST DIFICULT PART
You shall assert in your tests
You shall assert in your tests

1. Test without assertion is not a test,
   it is just a mere observation
2. If you don’t have an assertion, re-
   think the whole test or remove it
You shall not write many tests and
      then try to run them
You shall not write many tests and
           then try to run them

1. Use a notepad to write the description of the
   tests that came to your mind
2. Wrong design decisions (which is common
   when not knowing the whole picture) will affect
   all the tests you wrote
3. You have to start feeling comfortable with the
   “uncertainty”… it is about incremental
   design/programming
You shall not believe that TDD is about
           unit testing only

 (with the classical definition of unit
               testing)
You shall not believe that TDD is about
            unit testing only

1. TDD is not only about testing a method
   or a class
2. The more important tests are those that
   verify a functionality of the system
3. Unit Test = Run fast! (less than 100
   milliseconds)
You shall not name your tests after the
      HOW but after the WHAT
You shall not name your tests after the
        HOW but after the WHAT

1. Wrong name: testAccountBalance
You shall verify one case per test
You shall verify one case per test

1. To keep tests simple
2. If a test fails the you know by the
   test name what it is wrong
3. It is difficult to name a test that
   verifies more than one case  smell
You shall not test twice the same
You shall not test twice the same

1. To simplify test maintenance
2. To keep consistency
You shall keep your tests clean, they
         are another system
You shall keep your tests clean, they
           are another system

1. The tests are another system using
   yours!
2. Test maintenance can get costly if
   you don’t keep them clean
You shall not start testing interfaces,
 you shall start testing the business
                model
You shall not start testing interfaces,
    you shall start testing the business
                   model

1. Because you have to start with the
   simplest test possible
2. Because you want immediate feedback
3. Because is the business model what is
   important regardless any interface (UI,
   rest, webservices, etc)
You shall not TDD using relational
            databases
You shall not TDD using relational
                 databases
1. Relational databases are SLOW (from a testing
   point of view)
2. Relational databases make your development
   harder
3. Relational databases misguide your design
4. Relational databases are a solution to a
   computable problem: persistence
5. Test but not TDD using relational database
You shall not test using external
            systems
You shall not test using external
                  systems
1. A Relational Database is an external
   system!
2. External systems make your test slow
3. External systems avoid your test to be in
   “control of everything”
4. External systems create an unnecessary
   coupling with your tests
5. Simulate external systems
You shall not mock your wife!
You shall not mock your wife!
1. There are certain things you should not
   simulate!
2. Do not simulate your business objects
3. Only simulate what is out of your
   system’s reach
4. If scenarios are difficult to create, create
   scenarios factories!
5. Objects collaborate, they don’t live alone
   by themselves
You shall understand that TDD does
      not imply good design
You shall understand that TDD does
          not imply good design
1. Good designs are made by good
   designers
2. TDD implies less couple designs but
   not good ones
3. TDD does not imply not to think!
4. TDD does not imply not to use good
   design techniques or rules
You shall not worry about performance
           at the beginning
You shall not worry about performance
             at the beginning

1. You shall not worry about
   performance, persistence,
   scalability, etc. (the computational
   problems)
2. You shall worry about modeling the
   business first!
You shall love testing as much as
           programming
You shall love testing as much as
                programming
1. Because as programmers, we
   always test
   We do it implicitly
   We do it in our heads
2. Testing is part of development
3. GOOD PROGRAMMER = GOOD
   TESTER
And now …




(Nota: El Papa es Argentino… mais Deus é brasileiro -
                     Dilma dixit)
Los Diez Mandamientos

1.   Amarás TDD sobre todas las cosas
2.   No usarás el nombre de TDD en vano
3.   Festejarás cuando uses TDD
4.   Honrarás a tus tests y tus test suites.
5.   No matarás a QA
Los Diez Mandamientos

6. No cometerás adulterio con tus
   programas
7. ROBARAS las ideas de los tests de otros
8. No mentirás en tus tests
9. DESEARAS los tests de otros
10.No codiciarás la falta de testing de los
   otros
Enseñamos estos y otros cursos como:
• Diseño Avanzado con Objetos I
• Diseño Avanzado con Objetos II
• Construcción de Soft. con TDD
• TDD Avanzado … y más
     http://www.10pines.com/content/cursosdisponibles
Questions?
Muchas gracias!

info@10pines.com        Argentina
www.10Pines.com
                        Tel.: +54 (11) 4780-2460
twitter: @10Pines       Alem 693, 5B
                        Buenos Aires




                      agile software development & services

More Related Content

What's hot

Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017Xavi Hidalgo
 
Writing Tests Effectively
Writing Tests EffectivelyWriting Tests Effectively
Writing Tests EffectivelyPaul Boocock
 
Test driven-development
Test driven-developmentTest driven-development
Test driven-developmentDavid Paluy
 
Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Danny van Kasteel
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentLim Chanmann
 
NI week 2018 - Bringing down the barrier - A pragmatic view of software design
NI week 2018 - Bringing down the barrier - A pragmatic view of software designNI week 2018 - Bringing down the barrier - A pragmatic view of software design
NI week 2018 - Bringing down the barrier - A pragmatic view of software designJeffrey Habets
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentjakubkoci
 
Reliable tests with selenium web driver
Reliable tests with selenium web driverReliable tests with selenium web driver
Reliable tests with selenium web driverPawelPabich
 
TDD and Simple Design Workshop - Session 1 - November 2018
TDD and Simple Design Workshop - Session 1 - November 2018TDD and Simple Design Workshop - Session 1 - November 2018
TDD and Simple Design Workshop - Session 1 - November 2018Paulo Clavijo
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDDavid Rodenas
 
Test driven development
Test driven developmentTest driven development
Test driven developmentNascenia IT
 
A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...
A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...
A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...Yuval Yeret
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your codeTest driven development - Zombie proof your code
Test driven development - Zombie proof your codePascal Larocque
 
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile ProjectsAgile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile ProjectsAlan Richardson
 
Test Driven Development Powered by LEGO
Test Driven Development Powered by LEGOTest Driven Development Powered by LEGO
Test Driven Development Powered by LEGOAgile Montréal
 

What's hot (20)

Tdd
TddTdd
Tdd
 
Podstawy testowania oprogramowania
Podstawy testowania oprogramowaniaPodstawy testowania oprogramowania
Podstawy testowania oprogramowania
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
 
Writing Tests Effectively
Writing Tests EffectivelyWriting Tests Effectively
Writing Tests Effectively
 
Test driven-development
Test driven-developmentTest driven-development
Test driven-development
 
Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
TDD with RSpec
TDD with RSpecTDD with RSpec
TDD with RSpec
 
Test driven development(tdd)
Test driven development(tdd)Test driven development(tdd)
Test driven development(tdd)
 
NI week 2018 - Bringing down the barrier - A pragmatic view of software design
NI week 2018 - Bringing down the barrier - A pragmatic view of software designNI week 2018 - Bringing down the barrier - A pragmatic view of software design
NI week 2018 - Bringing down the barrier - A pragmatic view of software design
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Reliable tests with selenium web driver
Reliable tests with selenium web driverReliable tests with selenium web driver
Reliable tests with selenium web driver
 
TDD and Simple Design Workshop - Session 1 - November 2018
TDD and Simple Design Workshop - Session 1 - November 2018TDD and Simple Design Workshop - Session 1 - November 2018
TDD and Simple Design Workshop - Session 1 - November 2018
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...
A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...
A Software Tester's Travels from the Land of the Waterfall to the Land of Agi...
 
Best pratice
Best praticeBest pratice
Best pratice
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your codeTest driven development - Zombie proof your code
Test driven development - Zombie proof your code
 
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile ProjectsAgile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
Agile Testing Days 2014 Keynote - Helping Testers Add Value on Agile Projects
 
Test Driven Development Powered by LEGO
Test Driven Development Powered by LEGOTest Driven Development Powered by LEGO
Test Driven Development Powered by LEGO
 

Viewers also liked

Como escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDDComo escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDDHernan Wilkinson
 
Desarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agilesDesarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agilesHernan Wilkinson
 
Introducción a Agile y Scrum
Introducción a Agile y ScrumIntroducción a Agile y Scrum
Introducción a Agile y ScrumJohnny Ordóñez
 
Arithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languagesArithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languagesHernan Wilkinson
 
Confianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresaConfianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresaHernan Wilkinson
 
Objects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmObjects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmHernan Wilkinson
 
Como hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intentoComo hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intentoHernan Wilkinson
 
A new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendarA new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendarHernan Wilkinson
 
Growing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust companyGrowing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust companyHernan Wilkinson
 
Augmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxAugmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxHernan Wilkinson
 
Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...Hernan Wilkinson
 
Programming Languages and their influence in Thinking
Programming Languages and their influence in ThinkingProgramming Languages and their influence in Thinking
Programming Languages and their influence in ThinkingHernan Wilkinson
 
Adopción Ágil y Cambio Cultural: Lean Change Management
Adopción Ágil y Cambio Cultural: Lean Change ManagementAdopción Ágil y Cambio Cultural: Lean Change Management
Adopción Ágil y Cambio Cultural: Lean Change ManagementJohnny Ordóñez
 
¿Es Scrum compatible con tu Cultura Organizacional?
¿Es Scrum compatible con tu Cultura Organizacional?¿Es Scrum compatible con tu Cultura Organizacional?
¿Es Scrum compatible con tu Cultura Organizacional?Johnny Ordóñez
 
Los 10 mandamientos
Los 10 mandamientosLos 10 mandamientos
Los 10 mandamientosjosed2016
 
Seminario de metodologías ágiles, bloque I
Seminario de metodologías ágiles, bloque ISeminario de metodologías ágiles, bloque I
Seminario de metodologías ágiles, bloque IJuan Carlos Rubio Pineda
 
Lebenslauf_Tamas_Zsiros_02_2016
Lebenslauf_Tamas_Zsiros_02_2016Lebenslauf_Tamas_Zsiros_02_2016
Lebenslauf_Tamas_Zsiros_02_2016Tamás Zsiros
 
EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...
EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...
EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...Carlos Ernesto Peñaranda Sanchez
 

Viewers also liked (20)

Como escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDDComo escribir buenos tests al hacer TDD
Como escribir buenos tests al hacer TDD
 
Desarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agilesDesarrollando sistemas con metodologías y técnicas agiles
Desarrollando sistemas con metodologías y técnicas agiles
 
Introducción a Agile y Scrum
Introducción a Agile y ScrumIntroducción a Agile y Scrum
Introducción a Agile y Scrum
 
Arithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languagesArithmetic with measures on dynamically typed object oriented languages
Arithmetic with measures on dynamically typed object oriented languages
 
Confianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresaConfianza+Participación+Transparencia= Refactorizando la empresa
Confianza+Participación+Transparencia= Refactorizando la empresa
 
Objects: The Misunderstood Paradigm
Objects: The Misunderstood ParadigmObjects: The Misunderstood Paradigm
Objects: The Misunderstood Paradigm
 
Como hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intentoComo hacer tdd y no morir en el intento
Como hacer tdd y no morir en el intento
 
A new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendarA new object oriented model of the gregorian calendar
A new object oriented model of the gregorian calendar
 
Growing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust companyGrowing an open participative horizontal and based on trust company
Growing an open participative horizontal and based on trust company
 
Augmenting Smalltalk Syntax
Augmenting Smalltalk SyntaxAugmenting Smalltalk Syntax
Augmenting Smalltalk Syntax
 
Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...Técnicas y herramientas para que la computadora haga más y el programador m...
Técnicas y herramientas para que la computadora haga más y el programador m...
 
Programming Languages and their influence in Thinking
Programming Languages and their influence in ThinkingProgramming Languages and their influence in Thinking
Programming Languages and their influence in Thinking
 
Adopción Ágil y Cambio Cultural: Lean Change Management
Adopción Ágil y Cambio Cultural: Lean Change ManagementAdopción Ágil y Cambio Cultural: Lean Change Management
Adopción Ágil y Cambio Cultural: Lean Change Management
 
Rup
RupRup
Rup
 
¿Es Scrum compatible con tu Cultura Organizacional?
¿Es Scrum compatible con tu Cultura Organizacional?¿Es Scrum compatible con tu Cultura Organizacional?
¿Es Scrum compatible con tu Cultura Organizacional?
 
Los 10 mandamientos
Los 10 mandamientosLos 10 mandamientos
Los 10 mandamientos
 
Scrum
ScrumScrum
Scrum
 
Seminario de metodologías ágiles, bloque I
Seminario de metodologías ágiles, bloque ISeminario de metodologías ágiles, bloque I
Seminario de metodologías ágiles, bloque I
 
Lebenslauf_Tamas_Zsiros_02_2016
Lebenslauf_Tamas_Zsiros_02_2016Lebenslauf_Tamas_Zsiros_02_2016
Lebenslauf_Tamas_Zsiros_02_2016
 
EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...
EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...
EL FRENTE “IDEAs” ES EL INTENTO POR RESTAURAR EL PODER DE LA ROSCA MASISTA EN...
 

Similar to Los diez mandamientos de TDD

I'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit itI'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit itDaniel Irvine
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven DevelopmentPablo Villar
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development Amir Assad
 
TDD, the way to better software | Dan Ursu | CodeWay 2015
TDD, the way to better software | Dan Ursu | CodeWay 2015TDD, the way to better software | Dan Ursu | CodeWay 2015
TDD, the way to better software | Dan Ursu | CodeWay 2015YOPESO
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpicsLanette Creamer
 
From Gatekeeper to Partner by Kelsey Shannahan
From Gatekeeper to Partner by Kelsey ShannahanFrom Gatekeeper to Partner by Kelsey Shannahan
From Gatekeeper to Partner by Kelsey ShannahanQA or the Highway
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockPragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockJoseph Yoder
 
Pragmatic notdogmatictdd agile2012
Pragmatic notdogmatictdd   agile2012Pragmatic notdogmatictdd   agile2012
Pragmatic notdogmatictdd agile2012drewz lin
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012Alan Christensen
 
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
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Developmentsatya sudheer
 
Fantastic Tests - The Crimes of Bad Test Design
Fantastic Tests - The Crimes of Bad Test DesignFantastic Tests - The Crimes of Bad Test Design
Fantastic Tests - The Crimes of Bad Test DesignWinston Laoh
 
Introducing Test Driven Development to an existing environment
Introducing Test Driven Development to an existing environmentIntroducing Test Driven Development to an existing environment
Introducing Test Driven Development to an existing environmentNarato
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentbhochhi
 
Avoiding Release Anxiety
Avoiding Release AnxietyAvoiding Release Anxiety
Avoiding Release AnxietyBruno Rocha
 

Similar to Los diez mandamientos de TDD (20)

Agile Practices
Agile PracticesAgile Practices
Agile Practices
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Tdd
TddTdd
Tdd
 
I'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit itI'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit it
 
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
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
 
TDD, the way to better software | Dan Ursu | CodeWay 2015
TDD, the way to better software | Dan Ursu | CodeWay 2015TDD, the way to better software | Dan Ursu | CodeWay 2015
TDD, the way to better software | Dan Ursu | CodeWay 2015
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpics
 
From Gatekeeper to Partner by Kelsey Shannahan
From Gatekeeper to Partner by Kelsey ShannahanFrom Gatekeeper to Partner by Kelsey Shannahan
From Gatekeeper to Partner by Kelsey Shannahan
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockPragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
 
Pragmatic notdogmatictdd agile2012
Pragmatic notdogmatictdd   agile2012Pragmatic notdogmatictdd   agile2012
Pragmatic notdogmatictdd agile2012
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
 
TDD & Refactoring
TDD & RefactoringTDD & Refactoring
TDD & Refactoring
 
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 Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Development
 
Fantastic Tests - The Crimes of Bad Test Design
Fantastic Tests - The Crimes of Bad Test DesignFantastic Tests - The Crimes of Bad Test Design
Fantastic Tests - The Crimes of Bad Test Design
 
Introducing Test Driven Development to an existing environment
Introducing Test Driven Development to an existing environmentIntroducing Test Driven Development to an existing environment
Introducing Test Driven Development to an existing environment
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Avoiding Release Anxiety
Avoiding Release AnxietyAvoiding Release Anxiety
Avoiding Release Anxiety
 

More from Hernan Wilkinson

Hacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con softwareHacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con softwareHernan Wilkinson
 
Live Typing - California Smalltalkers
Live Typing - California SmalltalkersLive Typing - California Smalltalkers
Live Typing - California SmalltalkersHernan Wilkinson
 
Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020Hernan Wilkinson
 
LiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicosLiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicosHernan Wilkinson
 
LiveTyping: Update and What is next
LiveTyping: Update and What is nextLiveTyping: Update and What is next
LiveTyping: Update and What is nextHernan Wilkinson
 
Cuis smalltalk past present and future
Cuis smalltalk past present and futureCuis smalltalk past present and future
Cuis smalltalk past present and futureHernan Wilkinson
 
Live Typing - Automatic Type Annotation that improves the Programming eXperie...
Live Typing- Automatic Type Annotation that improves the Programming eXperie...Live Typing- Automatic Type Annotation that improves the Programming eXperie...
Live Typing - Automatic Type Annotation that improves the Programming eXperie...Hernan Wilkinson
 
El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018Hernan Wilkinson
 
Lessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsLessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsHernan Wilkinson
 
El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018Hernan Wilkinson
 
El Desarrollo de Software como debería Ser
El Desarrollo de Software como debería SerEl Desarrollo de Software como debería Ser
El Desarrollo de Software como debería SerHernan Wilkinson
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Hernan Wilkinson
 
Cómo Java afecta nuestros Diseños
Cómo Java afecta nuestros DiseñosCómo Java afecta nuestros Diseños
Cómo Java afecta nuestros DiseñosHernan Wilkinson
 
Encadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de DiseñoEncadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de DiseñoHernan Wilkinson
 

More from Hernan Wilkinson (17)

Hacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con softwareHacia una síntesis de diseño a partir de entender qué es modelar con software
Hacia una síntesis de diseño a partir de entender qué es modelar con software
 
Live Typing - California Smalltalkers
Live Typing - California SmalltalkersLive Typing - California Smalltalkers
Live Typing - California Smalltalkers
 
Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020Buenos Aires vs. (London vs. Chicago) Agiles 2020
Buenos Aires vs. (London vs. Chicago) Agiles 2020
 
LiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicosLiveTyping - Anotación automática de tipos para lenguajes dinámicos
LiveTyping - Anotación automática de tipos para lenguajes dinámicos
 
LiveTyping: Update and What is next
LiveTyping: Update and What is nextLiveTyping: Update and What is next
LiveTyping: Update and What is next
 
Cuis smalltalk past present and future
Cuis smalltalk past present and futureCuis smalltalk past present and future
Cuis smalltalk past present and future
 
Live Typing - Automatic Type Annotation that improves the Programming eXperie...
Live Typing- Automatic Type Annotation that improves the Programming eXperie...Live Typing- Automatic Type Annotation that improves the Programming eXperie...
Live Typing - Automatic Type Annotation that improves the Programming eXperie...
 
El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018El Desarrollo de Software como debería Ser - PyConAr 2018
El Desarrollo de Software como debería Ser - PyConAr 2018
 
Lessons Learned Implementing Refactorings
Lessons Learned Implementing RefactoringsLessons Learned Implementing Refactorings
Lessons Learned Implementing Refactorings
 
Dynamic Type Information
Dynamic Type InformationDynamic Type Information
Dynamic Type Information
 
El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018El Desarrollo de Software como debería Ser - Nerdear.la 2018
El Desarrollo de Software como debería Ser - Nerdear.la 2018
 
El Desarrollo de Software como debería Ser
El Desarrollo de Software como debería SerEl Desarrollo de Software como debería Ser
El Desarrollo de Software como debería Ser
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?
 
CuisUniversity
CuisUniversityCuisUniversity
CuisUniversity
 
Oop is not Dead
Oop is not DeadOop is not Dead
Oop is not Dead
 
Cómo Java afecta nuestros Diseños
Cómo Java afecta nuestros DiseñosCómo Java afecta nuestros Diseños
Cómo Java afecta nuestros Diseños
 
Encadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de DiseñoEncadenamiento de refactorings para generar cambios Agiles de Diseño
Encadenamiento de refactorings para generar cambios Agiles de Diseño
 

Los diez mandamientos de TDD

  • 1. Los Diez Mandamientos de TDD Scrum Bolivia Day Hernán Wilkinson Twitter: @HernanWilkinson Blog: objectmodels.blogspot.com www.10pines.com agile software development & services
  • 3. This is NOT TDD, this is how you do it! So… what is the ESENCE of TDD
  • 4. TDD is not about testing only It is more than that…
  • 5. TDD is about doing incremental problem solving guided by concrete examples We are used to incremental development (cycles/iteration), but not incremental design/programming
  • 6. TDD brings testing to development cycle Analisys Testing Program. Design
  • 7. TDD brings testing to development cycle Analisys Testing Design Program.
  • 8. TDD brings testing to development cycle 1. Tests are explicit, not implicit anymore 2. Tests run automatically, not because a person tests 3. Tests bring requirements to live!
  • 10. A programmer that is not a good tester is not a good programmer Good Programmer = Good Tester =
  • 11. TDD is a cultural change… a big one
  • 12. The Commandments 1. Management ones 2. Technical one A
  • 14. You shall not expect your developers do TDD because it is God, I mean Good 
  • 15. You shall not expect your developers do TDD because it is God, I mean Good  1. It is a Cultural Change! 2. Cultural changes do not happen by themselves 3. As manager, you have to provide the environment for the change and support it 4. … and yes sometimes you have to be tuff, it is part of being a leader 5. It is great start doing Pair Programming!
  • 16. You shall provide time to do TDD
  • 17. You shall provide time to do TDD 1. YES!! Doing TDD TAKES TIME!!! and more at the beginning… It is a cultural change! 2. BUT… the time you “invest” doing TDD gets pay in the mid-term 3. Finding a bug running the tests during a regression has no price!… for the rest you have mastercard
  • 18. You shall not send mixed messages stopping TDD when time looks not enough
  • 19. You shall not send mixed messages stopping TDD when time looks not enough 1. The problem is the PLAN… it is a PLAN for God sake! 2. If you HAVE TO do it, provide a reasonable explanation, talk to your team!
  • 20. You shall not expect no errors at all
  • 21. You shall not expect no errors at all 1. Testing is not a “formal verification technique” 2. You can not say anything about what it is not tested… that is why it is important to write the test first 3. DO NOT STOP DOING TDD because you got some errors on production 4. Use Mutation Testing/Coverage to test your tests!!
  • 22. You shall not expect one hundred percent coverage
  • 23. You shall not expect one hundred percent coverage 1. Sometimes it is too costly to automatize certain tests 2. Coverage is not a good measure of testing quality 3. 100% coverage is impossible when just starting to do TDD
  • 24. You shall not remove the QA team due to TDD
  • 25. You shall not remove the QA team due to TDD 1. Because TDD is not about testing only! 2. Because TDD does not test UI, user experience, performance, scalability, etc, etc 3. TDD helps QA to concentrate on the real and important issues
  • 26. You shall wait for your team to be “test infected”
  • 27. You shall wait for your team to be “test infected” 1.Experience is IMPORTANT. Wait your team to become expert, it will not happen in a week 2.Do not mix senior programmers with junior programmers, but semi-senior programmers with both (Pragmatic thinking and learning)
  • 29. You shall write the test first
  • 30. You shall write the test first 1. Is about incremental design and programming 2. Is not about providing a generic implementation with one case 3. It is not only about not doing what is not necessary 4. If you don’t do it, you will lie to yourself and forget to write some tests 5. If you don’t do it, you are just testing 6. IT IS THE MOST DIFICULT PART
  • 31. You shall assert in your tests
  • 32. You shall assert in your tests 1. Test without assertion is not a test, it is just a mere observation 2. If you don’t have an assertion, re- think the whole test or remove it
  • 33. You shall not write many tests and then try to run them
  • 34. You shall not write many tests and then try to run them 1. Use a notepad to write the description of the tests that came to your mind 2. Wrong design decisions (which is common when not knowing the whole picture) will affect all the tests you wrote 3. You have to start feeling comfortable with the “uncertainty”… it is about incremental design/programming
  • 35. You shall not believe that TDD is about unit testing only (with the classical definition of unit testing)
  • 36. You shall not believe that TDD is about unit testing only 1. TDD is not only about testing a method or a class 2. The more important tests are those that verify a functionality of the system 3. Unit Test = Run fast! (less than 100 milliseconds)
  • 37. You shall not name your tests after the HOW but after the WHAT
  • 38. You shall not name your tests after the HOW but after the WHAT 1. Wrong name: testAccountBalance
  • 39. You shall verify one case per test
  • 40. You shall verify one case per test 1. To keep tests simple 2. If a test fails the you know by the test name what it is wrong 3. It is difficult to name a test that verifies more than one case  smell
  • 41. You shall not test twice the same
  • 42. You shall not test twice the same 1. To simplify test maintenance 2. To keep consistency
  • 43. You shall keep your tests clean, they are another system
  • 44. You shall keep your tests clean, they are another system 1. The tests are another system using yours! 2. Test maintenance can get costly if you don’t keep them clean
  • 45. You shall not start testing interfaces, you shall start testing the business model
  • 46. You shall not start testing interfaces, you shall start testing the business model 1. Because you have to start with the simplest test possible 2. Because you want immediate feedback 3. Because is the business model what is important regardless any interface (UI, rest, webservices, etc)
  • 47. You shall not TDD using relational databases
  • 48. You shall not TDD using relational databases 1. Relational databases are SLOW (from a testing point of view) 2. Relational databases make your development harder 3. Relational databases misguide your design 4. Relational databases are a solution to a computable problem: persistence 5. Test but not TDD using relational database
  • 49. You shall not test using external systems
  • 50. You shall not test using external systems 1. A Relational Database is an external system! 2. External systems make your test slow 3. External systems avoid your test to be in “control of everything” 4. External systems create an unnecessary coupling with your tests 5. Simulate external systems
  • 51. You shall not mock your wife!
  • 52. You shall not mock your wife! 1. There are certain things you should not simulate! 2. Do not simulate your business objects 3. Only simulate what is out of your system’s reach 4. If scenarios are difficult to create, create scenarios factories! 5. Objects collaborate, they don’t live alone by themselves
  • 53. You shall understand that TDD does not imply good design
  • 54. You shall understand that TDD does not imply good design 1. Good designs are made by good designers 2. TDD implies less couple designs but not good ones 3. TDD does not imply not to think! 4. TDD does not imply not to use good design techniques or rules
  • 55. You shall not worry about performance at the beginning
  • 56. You shall not worry about performance at the beginning 1. You shall not worry about performance, persistence, scalability, etc. (the computational problems) 2. You shall worry about modeling the business first!
  • 57. You shall love testing as much as programming
  • 58. You shall love testing as much as programming 1. Because as programmers, we always test We do it implicitly We do it in our heads 2. Testing is part of development 3. GOOD PROGRAMMER = GOOD TESTER
  • 59. And now … (Nota: El Papa es Argentino… mais Deus é brasileiro - Dilma dixit)
  • 60. Los Diez Mandamientos 1. Amarás TDD sobre todas las cosas 2. No usarás el nombre de TDD en vano 3. Festejarás cuando uses TDD 4. Honrarás a tus tests y tus test suites. 5. No matarás a QA
  • 61. Los Diez Mandamientos 6. No cometerás adulterio con tus programas 7. ROBARAS las ideas de los tests de otros 8. No mentirás en tus tests 9. DESEARAS los tests de otros 10.No codiciarás la falta de testing de los otros
  • 62. Enseñamos estos y otros cursos como: • Diseño Avanzado con Objetos I • Diseño Avanzado con Objetos II • Construcción de Soft. con TDD • TDD Avanzado … y más http://www.10pines.com/content/cursosdisponibles
  • 64. Muchas gracias! info@10pines.com Argentina www.10Pines.com Tel.: +54 (11) 4780-2460 twitter: @10Pines Alem 693, 5B Buenos Aires agile software development & services