Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Test-Driven Development for iOS

Test-Driven Development for iOS

9th iOS Practice Leaders Community Meet-up

Avatar for Maksym Koshtenko

Maksym Koshtenko

April 16, 2015

More Decks by Maksym Koshtenko

Other Decks in Programming

Transcript

  1. Test-driven flow Design Implement Test Test Write a test to

    express the design 
 It should FAIL
  2. Add a test Each new feature begins with writing a

    test Focus on the requirements before writing the code
  3. Write a code Write simplest and inelegant code to make

    test pass Use hardcodes where possible
  4. What is TDD? Red Refactor Green 1. Write tests! 2.

    Implement changes! 3. Cleanup code
  5. Bug fixing 1. Find bad code ! 2. Turn it

    into a test ! 3. Test should fail ! 4. Fix bug ! 5. Test should now pass
  6. Advantages of TDD No more repeat bugs 
 Better design

    
 Quick feedback 
 Easy refactoring 

  7. Advantages of TDD No more repeat bugs 
 Better design

    
 Quick feedback 
 Easy refactoring 
 Great code coverage