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.

iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deployment for iOS

10,509 views

Published on

Great testing and deployment tools already exist for web platforms like Rails; now it is iOS' turn! What's out there, where can you get it, how do you use it ... and where do we go from here?

Published in: Technology, Business
  • Be the first to comment

iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deployment for iOS

  1. 1. Getting “Test”-yTest-driven Development & Automated Deployment for iOS
  2. 2. Your Humble Speakers• Jonah Williams - @Zalambar• Rudy Jahchan - @rudy
  3. 3. How do we test?
  4. 4. How do we test? OCHamcrestSenTestingKit Cedar KIF GTM Kiwi OCMock Frank GHUnit iCuke
  5. 5. Why do we test?
  6. 6. Why do we test?To make sure our code works (duh!)
  7. 7. Why do we test FIRST?
  8. 8. Why do we test FIRST? To design our code.
  9. 9. Why do we test FIRST? To design our code. (duh!)
  10. 10. Why do we test FIRST?
  11. 11. Test Structure
  12. 12. Test StructureGIVEN
  13. 13. Test StructureGIVENWHEN
  14. 14. Test StructureGIVENWHENTHEN
  15. 15. Test StructureGIVEN certain conditionsWHENTHEN
  16. 16. Test StructureGIVEN certain conditionsWHEN something happensTHEN
  17. 17. Test StructureGIVEN certain conditionsWHEN something happensTHEN the conditions change (or don’t)
  18. 18. Unit Testing
  19. 19. Unit Testing
  20. 20. Sample Class
  21. 21. xUnit Style
  22. 22. SenTestingKit
  23. 23. OCHamcresthttp://bit.ly/ochamcrest
  24. 24. Stubbing & Mocking
  25. 25. OCMockhttp://bit.ly/qktX3H
  26. 26. GTMhttp://bit.ly/gtmtest
  27. 27. GHUnithttp://gabriel.github.com/gh-unit/
  28. 28. BDD
  29. 29. BDDBehaviorDrivenDesign
  30. 30. RSpechttp://github.com/rspec/rspec
  31. 31. RSpec Book
  32. 32. Cedarhttp://github.com/pivotal/cedar
  33. 33. Kiwihttp://kiwi-lib.info/
  34. 34. Integration Tests
  35. 35. Cucumberhttp://cukes.info/
  36. 36. iCukehttp://github.com/unboxed/icuke
  37. 37. iCukehttp://github.com/unboxed/icuke
  38. 38. Frankhttp://github.com/moredip/Frank
  39. 39. KIFhttp://github.com/square/KIF
  40. 40. KIF Keep It Functionalhttp://github.com/square/KIF
  41. 41. KIFhttp://github.com/square/KIF
  42. 42. Continuous Integration
  43. 43. Command-Line Builds
  44. 44. Command-Line Execution
  45. 45. ➜ ~ ./build.sh Bash...**** Describe WorkspaceAvailable schemesInformation about workspace "My_App":    Schemes:        Ad Hoc        Development**** Set EnvironmentMy_App/My_App/staging-Info.plist -> ~/TeamCity/build-agent-1/work/My_App_staging/My_App/My_App/My_App-Info.plistMy_App/My_App/staging.plist -> My_App/My_App/environment.plistEnvironment set to com.MyCompany.My_App.staging at version 1.0**** Increment Bundle VersionSetting version of project My_App to:    24....**** BuildRunning xcodebuild > xcodebuild_output ......Retrieving build products......**** Package ApplicationCodesign as "iPhone Distribution: MyCompany, LLC", embedding provisioning profile ~/TeamCity/build-agent-1/work/My_App_staging/ad_hoc/My_App_Staging_Ad_Hoc.mobileprovision**** Verify...**** Prepare OTA DistributionGenerating com.MyCompany.My_App.staging.app.plist**** Complete! http://gist.github.com/949831
  46. 46. Rakehttp://gist.github.com/1017153
  47. 47. Over The AirDistribution
  48. 48. OTA: Roll Your Own<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>items</key> <array> <dict> <key>assets</key> <array> <dict> <key>kind</key><string>software-package</string> <key>url</key><string>$artifacts_url/$project_app.ipa</string> </dict> <dict> <key>kind</key><string>full-size-image</string> <key>needs-shine</key><true/> <key>url</key><string>$artifacts_url/$full_size_image_name</string> </dict> <dict> <key>kind</key><string>display-image</string> <key>needs-shine</key><true/> <key>url</key><string>$artifacts_url/$display_image_name</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>$bundle_identifier</string> <key>bundle-version</key><string>$short_version_string $build_number</string> <key>kind</key><string>software</string> <key>subtitle</key><string>$environment_name</string> <key>title</key><string>$project_app</string> </dict> </dict> </array></dict></plist> itms-services://?action=download-manifest&url=http://host.example/project_name.acceptance.app.plist
  49. 49. OTA: TestFlight http://testflightapp.com/
  50. 50. What’s Missing?
  51. 51. Factories
  52. 52. Factories
  53. 53. Fixtures
  54. 54. CoreData Migrations
  55. 55. Auto-testing guard integrationhttps://github.com/guard/guard

×