Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Unit testing in swift 2 - The before & after story

735 views

Published on

Into unit testing? If so you've probably found yourself in the dark alleys of Swift unit testing. If you haven't yet dabbled in unit testing, this talk will be an awesome opportunity to get started and charge up your unit testing superpowers. I explain three scenarios of unit testing with Swift, and provide us with practical advice for each of them and the implications of the recently introduced version 2 of Swift.

Published in: Technology
  • Be the first to comment

Unit testing in swift 2 - The before & after story

  1. 1. Unit Testing in Swift 2: The Before & After Story Jorge D. Ortiz-Fuentes @jdortiz #Swift2Testing
  2. 2. A Canonical Examples production #Swift2Testing
  3. 3. #Swift2Testing Agenda ★ Using testable ★ Testing error handling ★ Measuring test coverage
  4. 4. #Swift2Testing Agenda ★ Using testable ★ Testing error handling ★ Measuring test coverage
  5. 5. Using testable
  6. 6. Swift Modules Test Bundle = Module App / Framework = Module Internal x Testable
  7. 7. https://github.com/jdortiz/ EvilTalentSwift2 Demo
  8. 8. Before Make everything public or Include the classes in testing target Detestable
  9. 9. After @testable import Module provides access to everything internal Testable
  10. 10. #Swift2Testing Agenda ★ Using testable ★ Testing error handling ★ Measuring test coverage
  11. 11. Testing error handling
  12. 12. Always Look at the Bright Side Don’t
  13. 13. https://github.com/jdortiz/ EvilTalentSwift2 Demo
  14. 14. Before Deal with pointers to references and put the data in there in order to mock the behavior
  15. 15. After Just implement a test for the case when it fails and mock the failure
  16. 16. #Swift2Testing Agenda ★ Using testable ★ Testing error handling ★ Measuring test coverage
  17. 17. Test coverage
  18. 18. The importance of Unit Testing
  19. 19. https://github.com/jdortiz/ EvilTalentSwift2 Demo
  20. 20. Before No idea about how much code is actually tested
  21. 21. After Per method/class coverage information
  22. 22. Thank you!
  23. 23. @jdortiz #Swift2Testing

×