TDD with
JavaScript
Test-driven JavaScript
programming workshop



        November 3, 2011
        Agile Tour Toronto
Objectives
At	
  the	
  end	
  of	
  the	
  workshop,	
  par1cipants:	
  

 •  Will	
  know	
  one	
  way	
  to	
  write	
  JavaScript	
  code	
  guided	
  by	
  tests	
  
 •  Will	
  know	
  about	
  the	
  @12meses12katas	
  ini1a1ve	
  	
  
Agenda
	
  

	
                                    Workshop	
  



       Introduc1on	
                                 End	
  




                         Review	
  
Ready!	
  
Set!	
  
Really	
  ready?	
  
The	
  Minesweeper	
  game	
  
	
  
A	
  realis1c	
  objec1ve	
  
Go!	
  

                Test	
  first	
  
Workshop   • 
           •    Test	
  first!	
  
           •    For	
  instance,	
  you	
  could	
  begin	
  with	
  exploring	
  the	
  model…	
  




           •    …	
  or	
  the	
  view	
  




                                                                                                      20	
  
Heads	
  up	
  for	
  5	
  minutes...	
  


•    How	
  do	
  you	
  feel?	
  
•    What	
  can	
  you	
  improve?	
  
•    Consider	
  the	
  following	
  op1ons:	
  
      –  Change	
  partner	
  
      –  Start	
  over	
  

      	
  
Heads	
  up	
  for	
  5	
  minutes...	
  


•    How	
  do	
  you	
  feel?	
  
•    What	
  can	
  you	
  improve?	
  
•    Consider	
  the	
  following	
  op1ons:	
  
      –  Change	
  partner	
  
      –  Start	
  over	
  

      	
  
The	
  road	
  is	
  more	
  interes1ng	
  than	
  the	
  end.	
  
      	
  
Go!	
  

                A	
  new	
  beginning	
  
Workshop   • 
           •    Test	
  first!	
  

           •    New	
  explora1ons	
  are	
  possible	
  




                                                            20	
  
Thank	
  you	
  J	
  


•      Share	
  your	
  katas	
  




•      Share	
  your	
  code	
  
	
  

Javascript TDD by example

  • 1.
    TDD with JavaScript Test-driven JavaScript programmingworkshop November 3, 2011 Agile Tour Toronto
  • 2.
    Objectives At  the  end  of  the  workshop,  par1cipants:   •  Will  know  one  way  to  write  JavaScript  code  guided  by  tests   •  Will  know  about  the  @12meses12katas  ini1a1ve    
  • 3.
    Agenda     Workshop   Introduc1on   End   Review  
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
    Go!   Test  first   Workshop •  •  Test  first!   •  For  instance,  you  could  begin  with  exploring  the  model…   •  …  or  the  view   20  
  • 11.
    Heads  up  for  5  minutes...   •  How  do  you  feel?   •  What  can  you  improve?   •  Consider  the  following  op1ons:   –  Change  partner   –  Start  over    
  • 12.
    Heads  up  for  5  minutes...   •  How  do  you  feel?   •  What  can  you  improve?   •  Consider  the  following  op1ons:   –  Change  partner   –  Start  over     The  road  is  more  interes1ng  than  the  end.    
  • 13.
    Go!   A  new  beginning   Workshop •  •  Test  first!   •  New  explora1ons  are  possible   20  
  • 15.
    Thank  you  J   •  Share  your  katas   •  Share  your  code