480 likes | 494 Views
Learn about test-driven development and automated deployment techniques for iOS development. Discover tools like OCHamcrest, Cedar, KIF, Kiwi, GTM, OCMock, Frank, GHUnit, and iCuke.
E N D
Getting “Test”-y • Test-driven Development & Automated Deployment for iOS
Your Humble Speakers • Jonah Williams - @Zalambar • Rudy Jahchan - @rudy
How do we test? OCHamcrest Cedar SenTestingKit KIF Kiwi GTM OCMock Frank GHUnit iCuke
Why do we test? To make sure our code works (duh!)
Why do we test FIRST? To design our code. (duh!)
Test Structure GIVEN certain conditions WHEN something happens THEN the conditions change (or don’t)
OCHamcrest http://bit.ly/ochamcrest
OCMock http://bit.ly/qktX3H
GTM http://bit.ly/gtmtest
GHUnit http://gabriel.github.com/gh-unit/
BDD Behavior Driven Design
RSpec http://github.com/rspec/rspec
Cedar http://github.com/pivotal/cedar
Kiwi http://kiwi-lib.info/
Cucumber http://cukes.info/
iCuke http://github.com/unboxed/icuke
iCuke http://github.com/unboxed/icuke
Frank http://github.com/moredip/Frank
KIF http://github.com/square/KIF
KIF Keep It Functional http://github.com/square/KIF
KIF http://github.com/square/KIF
Bash ➜ ~ ./build.sh ... **** Describe Workspace Available schemes Information about workspace "My_App": Schemes: Ad Hoc Development **** Set Environment My_App/My_App/staging-Info.plist -> ~/TeamCity/build-agent-1/work/My_App_staging/My_App/My_App/My_App-Info.plist My_App/My_App/staging.plist -> My_App/My_App/environment.plist Environment set to com.MyCompany.My_App.staging at version 1.0 **** Increment Bundle Version Setting version of project My_App to: 24. ... **** Build Running xcodebuild > xcodebuild_output ... ... Retrieving build products... ... **** Package Application Codesign 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 Distribution Generating com.MyCompany.My_App.staging.app.plist **** Complete! http://gist.github.com/949831
Rake http://gist.github.com/1017153
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
OTA: TestFlight http://testflightapp.com/
Auto-testing guard integration https://github.com/guard/guard