SlideShare uma empresa Scribd logo
1 de 19
TDD
Desarrollo Dirigido por Pruebas
Ciclo


Test en ROJO
Ciclo


Test en ROJO   Test en VERDE
Ciclo


Test en ROJO   Test en VERDE   Refactor
Ciclo


Test en ROJO   Test en VERDE   Refactor

 Baby steps
Ciclo


Test en ROJO    Test en VERDE     Refactor

 Baby steps    Prohibido pensar
Ciclo


Test en ROJO    Test en VERDE        Refactor

 Baby steps    Prohibido pensar   Transformations
Evolución del código con TDD


•   Tests progresan desde una definición genérica hacia la más específica

•   Implementación progresa desde específica hacia genérica
Refactor
Code refactoring is "a disciplined way to restructure code",[1] undertaken
in order to improve some of the nonfunctional attributes of the software.


By continuously improving the design of code, we make it easier and easier to work with. This
is in sharp contrast to what typically happens: little refactoring and a great deal of attention
paid to expediently adding new features. If you get into the hygienic habit of refactoring
continuously, you'll find that it is easier to extend and maintain code.

                                                  —- Joshua Kerievsky, Refactoring to Patterns
Transformation
({}–>nil) no code at all->code that employs nil
(nil->constant)
(constant->constant+) a simple constant to a more complex constant
(constant->scalar) replacing a constant with a variable or an argument
(statement->statements) adding more unconditional statements.
(unconditional->if) splitting the execution path
(scalar->array)
(array->container)
(statement->recursion)
(if->while)
(expression->function) replacing an expression with a function or algorithm
(variable->assignment) replacing the value of a variable.
       http://cleancoder.posterous.com/the-transformation-priority-premise
Waterfall

•   Requisitos

•   Análisis          Cada paso
•   Diseño         inyecta feedback
•   Coding
                      al anterior
•   Testeo
Lean - BDD - TDD - Test first

   •   Requisitos

   •   Análisis

   •   Diseño

   •   Coding       Test first

   •   Testeo
Lean - BDD - TDD - Test first

   •   Requisitos

   •   Análisis

   •   Diseño                   TDD

   •   Coding       Test first

   •   Testeo
Lean - BDD - TDD - Test first

   •   Requisitos

   •   Análisis                       BDD

   •   Diseño                   TDD

   •   Coding       Test first

   •   Testeo
Lean - BDD - TDD - Test first

   •   Requisitos                           Lean

   •   Análisis                       BDD

   •   Diseño                   TDD

   •   Coding       Test first

   •   Testeo
TDD                                       BDD


Top-down / Bottom up    Estrategias            Outside in


      Arrange                                   Given ...
        Act         Forma de una prueba         When ...
      Assert                                    Then ...

   Example driven      Fuerza motriz      Business value driven


       xUnit             Standard                  --
                       Frameworks
       jUnit                           Concordion, EasyB, JBehave
                           Java
Herramientas
       KISS,YAGNI, SOLID, DRY

   Bloc de notas, estrategia de testeo

       Autotest, TDGotchi, Pulse

Pair programming, ping-pong, peer-review



 Esto va de hacer software bien hecho
Ejemplo BDD
  Describir comportamiento                               Escribir la definición de un paso                                   Ver cómo falla




Escribir lo mínimo para que pase                                  Ver que pasa                                  Iterar hasta que todo esté verde




                         Y, finalmente, repetir todo con nuevos comportamientos hasta que se acabe la pasta/alcance/tiempo
Ejemplo de TDD


Kata: StringCalculator

Mais conteúdo relacionado

Destaque

Aftermath of functional programming. the good parts
Aftermath of functional programming. the good partsAftermath of functional programming. the good parts
Aftermath of functional programming. the good partsGuillermo Gutiérrez
 
Aftermath of functional programming. The good parts
Aftermath of functional programming. The good partsAftermath of functional programming. The good parts
Aftermath of functional programming. The good partsGuillermo Gutiérrez
 
Comité paritario de salud ocupacional
Comité paritario de salud ocupacionalComité paritario de salud ocupacional
Comité paritario de salud ocupacionallinitanex
 
Salud trabajo autocuidado
Salud trabajo autocuidadoSalud trabajo autocuidado
Salud trabajo autocuidadoelianitalinda
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Destaque (8)

Control de Versiones - Slides
Control de Versiones - SlidesControl de Versiones - Slides
Control de Versiones - Slides
 
Aftermath of functional programming. the good parts
Aftermath of functional programming. the good partsAftermath of functional programming. the good parts
Aftermath of functional programming. the good parts
 
Aftermath of functional programming. The good parts
Aftermath of functional programming. The good partsAftermath of functional programming. The good parts
Aftermath of functional programming. The good parts
 
Comité paritario de salud ocupacional
Comité paritario de salud ocupacionalComité paritario de salud ocupacional
Comité paritario de salud ocupacional
 
Salud trabajo autocuidado
Salud trabajo autocuidadoSalud trabajo autocuidado
Salud trabajo autocuidado
 
Autocuidado
AutocuidadoAutocuidado
Autocuidado
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Semelhante a TDD

TDD 101 - Introducción al Desarrollo Dirigido por Pruebas
TDD 101 - Introducción al Desarrollo Dirigido por PruebasTDD 101 - Introducción al Desarrollo Dirigido por Pruebas
TDD 101 - Introducción al Desarrollo Dirigido por PruebasOrlando Bustos Mateluna
 
Behavior1
Behavior1Behavior1
Behavior1arajar
 
Meetup bdd & tdd: aprovecha_su_poder
Meetup bdd & tdd: aprovecha_su_poderMeetup bdd & tdd: aprovecha_su_poder
Meetup bdd & tdd: aprovecha_su_poderEduardo Riol
 
Joseluisseijoreig samuelsánchezmuñoz
Joseluisseijoreig samuelsánchezmuñozJoseluisseijoreig samuelsánchezmuñoz
Joseluisseijoreig samuelsánchezmuñozjoseluisseijo
 
Crowdar - Introducción a BDD
Crowdar - Introducción a BDDCrowdar - Introducción a BDD
Crowdar - Introducción a BDDJavier Re
 
"Demystifying development techniques" por @eturino
"Demystifying development techniques" por @eturino"Demystifying development techniques" por @eturino
"Demystifying development techniques" por @eturinowebcat
 
Módulo 4. Desarrollador ágil
Módulo 4. Desarrollador ágilMódulo 4. Desarrollador ágil
Módulo 4. Desarrollador ágilJohnny Ordóñez
 
BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos
BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos
BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos SolidQ
 
Integrando Test Driven Development en aplicaciones React
Integrando Test Driven Development en aplicaciones ReactIntegrando Test Driven Development en aplicaciones React
Integrando Test Driven Development en aplicaciones ReactBelatrix Software
 
#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps
#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps
#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOpsHablemosDeTesting
 
[ES] webcat 2014-03 Demystifying Development Techniques
[ES] webcat 2014-03 Demystifying Development Techniques[ES] webcat 2014-03 Demystifying Development Techniques
[ES] webcat 2014-03 Demystifying Development TechniquesEduardo Turiño
 
Dad diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...
Dad  diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...Dad  diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...
Dad diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...Julissa mateo abad
 

Semelhante a TDD (20)

TDD 101 - Introducción al Desarrollo Dirigido por Pruebas
TDD 101 - Introducción al Desarrollo Dirigido por PruebasTDD 101 - Introducción al Desarrollo Dirigido por Pruebas
TDD 101 - Introducción al Desarrollo Dirigido por Pruebas
 
BDD TDD ATDD
BDD TDD ATDDBDD TDD ATDD
BDD TDD ATDD
 
Bddtddatdd
BddtddatddBddtddatdd
Bddtddatdd
 
Behavior1
Behavior1Behavior1
Behavior1
 
Meetup bdd & tdd: aprovecha_su_poder
Meetup bdd & tdd: aprovecha_su_poderMeetup bdd & tdd: aprovecha_su_poder
Meetup bdd & tdd: aprovecha_su_poder
 
Joseluisseijoreig samuelsánchezmuñoz
Joseluisseijoreig samuelsánchezmuñozJoseluisseijoreig samuelsánchezmuñoz
Joseluisseijoreig samuelsánchezmuñoz
 
Crowdar - Introducción a BDD
Crowdar - Introducción a BDDCrowdar - Introducción a BDD
Crowdar - Introducción a BDD
 
TDD
TDDTDD
TDD
 
"Demystifying development techniques" por @eturino
"Demystifying development techniques" por @eturino"Demystifying development techniques" por @eturino
"Demystifying development techniques" por @eturino
 
Módulo 4. Desarrollador ágil
Módulo 4. Desarrollador ágilMódulo 4. Desarrollador ágil
Módulo 4. Desarrollador ágil
 
BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos
BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos
BEST_PRACTICES: Buenas Prácticas para el Desarrollador de bases de datos
 
Integrando Test Driven Development en aplicaciones React
Integrando Test Driven Development en aplicaciones ReactIntegrando Test Driven Development en aplicaciones React
Integrando Test Driven Development en aplicaciones React
 
#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps
#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps
#HablemosDeTestingDay - José Castillo: Estrategia de QA en un contexto de DevOps
 
Introducción a tdd
Introducción a tddIntroducción a tdd
Introducción a tdd
 
Day01
Day01Day01
Day01
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Introducción a tdd
Introducción a tddIntroducción a tdd
Introducción a tdd
 
Creando rascacielos con tdd
Creando rascacielos con tddCreando rascacielos con tdd
Creando rascacielos con tdd
 
[ES] webcat 2014-03 Demystifying Development Techniques
[ES] webcat 2014-03 Demystifying Development Techniques[ES] webcat 2014-03 Demystifying Development Techniques
[ES] webcat 2014-03 Demystifying Development Techniques
 
Dad diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...
Dad  diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...Dad  diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...
Dad diciplined agil delivery.(DAD), Metodología ágil para empresas Grandes o...
 

TDD

  • 3. Ciclo Test en ROJO Test en VERDE
  • 4. Ciclo Test en ROJO Test en VERDE Refactor
  • 5. Ciclo Test en ROJO Test en VERDE Refactor Baby steps
  • 6. Ciclo Test en ROJO Test en VERDE Refactor Baby steps Prohibido pensar
  • 7. Ciclo Test en ROJO Test en VERDE Refactor Baby steps Prohibido pensar Transformations
  • 8. Evolución del código con TDD • Tests progresan desde una definición genérica hacia la más específica • Implementación progresa desde específica hacia genérica
  • 9. Refactor Code refactoring is "a disciplined way to restructure code",[1] undertaken in order to improve some of the nonfunctional attributes of the software. By continuously improving the design of code, we make it easier and easier to work with. This is in sharp contrast to what typically happens: little refactoring and a great deal of attention paid to expediently adding new features. If you get into the hygienic habit of refactoring continuously, you'll find that it is easier to extend and maintain code. —- Joshua Kerievsky, Refactoring to Patterns
  • 10. Transformation ({}–>nil) no code at all->code that employs nil (nil->constant) (constant->constant+) a simple constant to a more complex constant (constant->scalar) replacing a constant with a variable or an argument (statement->statements) adding more unconditional statements. (unconditional->if) splitting the execution path (scalar->array) (array->container) (statement->recursion) (if->while) (expression->function) replacing an expression with a function or algorithm (variable->assignment) replacing the value of a variable. http://cleancoder.posterous.com/the-transformation-priority-premise
  • 11. Waterfall • Requisitos • Análisis Cada paso • Diseño inyecta feedback • Coding al anterior • Testeo
  • 12. Lean - BDD - TDD - Test first • Requisitos • Análisis • Diseño • Coding Test first • Testeo
  • 13. Lean - BDD - TDD - Test first • Requisitos • Análisis • Diseño TDD • Coding Test first • Testeo
  • 14. Lean - BDD - TDD - Test first • Requisitos • Análisis BDD • Diseño TDD • Coding Test first • Testeo
  • 15. Lean - BDD - TDD - Test first • Requisitos Lean • Análisis BDD • Diseño TDD • Coding Test first • Testeo
  • 16. TDD BDD Top-down / Bottom up Estrategias Outside in Arrange Given ... Act Forma de una prueba When ... Assert Then ... Example driven Fuerza motriz Business value driven xUnit Standard -- Frameworks jUnit Concordion, EasyB, JBehave Java
  • 17. Herramientas KISS,YAGNI, SOLID, DRY Bloc de notas, estrategia de testeo Autotest, TDGotchi, Pulse Pair programming, ping-pong, peer-review Esto va de hacer software bien hecho
  • 18. Ejemplo BDD Describir comportamiento Escribir la definición de un paso Ver cómo falla Escribir lo mínimo para que pase Ver que pasa Iterar hasta que todo esté verde Y, finalmente, repetir todo con nuevos comportamientos hasta que se acabe la pasta/alcance/tiempo
  • 19. Ejemplo de TDD Kata: StringCalculator

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n