Getting Test-y Test-driven Development & Automated Deployment for iOS.

48
Getting “Test”-y Test-driven Development & Automated Deployment for iOS

Transcript of Getting Test-y Test-driven Development & Automated Deployment for iOS.

Page 1: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Getting “Test”-yTest-driven Development & Automated

Deployment for iOS

Page 2: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Your Humble Speakers

•Jonah Williams - @Zalambar

•Rudy Jahchan - @rudy

Page 3: Getting Test-y Test-driven Development & Automated Deployment for iOS.

How do we test?

Page 4: Getting Test-y Test-driven Development & Automated Deployment for iOS.

How do we test?

SenTestingKit

GTM

Cedar

KiwiKIF

GHUnitOCMock

OCHamcrest

Frank

iCuke

Page 5: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Why do we test?

Page 6: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Why do we test?

To make sure our code works(duh!)

Page 7: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Why do we test FIRST?

Page 8: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Why do we test FIRST?

To design our code.(duh!)

Page 9: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Why do we test FIRST?

Page 10: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Test Structure

GIVEN

WHEN

THEN

certain conditions

something happens

the conditions change (or don’t)

Page 11: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Unit Testing

Page 12: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Unit Testing

Page 13: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Sample Class

Page 14: Getting Test-y Test-driven Development & Automated Deployment for iOS.

xUnit Style

Page 15: Getting Test-y Test-driven Development & Automated Deployment for iOS.

SenTestingKit

Page 16: Getting Test-y Test-driven Development & Automated Deployment for iOS.

OCHamcresthttp://bit.ly/ochamcrest

Page 17: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Stubbing & Mocking

Page 18: Getting Test-y Test-driven Development & Automated Deployment for iOS.

OCMock

http://bit.ly/qktX3H

Page 19: Getting Test-y Test-driven Development & Automated Deployment for iOS.

GTMhttp://bit.ly/gtmtest

Page 20: Getting Test-y Test-driven Development & Automated Deployment for iOS.

GHUnithttp://gabriel.github.com/gh-unit/

Page 21: Getting Test-y Test-driven Development & Automated Deployment for iOS.

BDD

Page 22: Getting Test-y Test-driven Development & Automated Deployment for iOS.

BDD

Behavior Driven Design

Page 23: Getting Test-y Test-driven Development & Automated Deployment for iOS.

RSpec

http://github.com/rspec/rspec

Page 24: Getting Test-y Test-driven Development & Automated Deployment for iOS.

RSpec Book

Page 25: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Cedar

http://github.com/pivotal/cedar

Page 26: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Kiwi

http://kiwi-lib.info/

Page 27: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Integration Tests

Page 28: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Cucumber

http://cukes.info/

Page 29: Getting Test-y Test-driven Development & Automated Deployment for iOS.

iCuke

http://github.com/unboxed/icuke

Page 30: Getting Test-y Test-driven Development & Automated Deployment for iOS.

iCuke

http://github.com/unboxed/icuke

Page 31: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Frank

http://github.com/moredip/Frank

Page 32: Getting Test-y Test-driven Development & Automated Deployment for iOS.

KIFhttp://github.com/square/KIF

Page 33: Getting Test-y Test-driven Development & Automated Deployment for iOS.

KIF

http://github.com/square/KIF

KeepItFunctional

Page 34: Getting Test-y Test-driven Development & Automated Deployment for iOS.

KIF

http://github.com/square/KIF

Page 35: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Continuous Integration

Page 36: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Command-Line Builds

Page 37: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Command-Line Execution

Page 38: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Bash

http://gist.github.com/949831

➜ ~ ./build.sh...**** 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!

Page 39: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Rake

http://gist.github.com/1017153

Page 40: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Over The Air Distribution

Page 41: Getting Test-y Test-driven Development & Automated Deployment for iOS.

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

Page 42: Getting Test-y Test-driven Development & Automated Deployment for iOS.

OTA: TestFlight

http://testflightapp.com/

Page 43: Getting Test-y Test-driven Development & Automated Deployment for iOS.

What’s Missing?

Page 44: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Factories

Page 45: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Factories

Page 46: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Fixtures

Page 47: Getting Test-y Test-driven Development & Automated Deployment for iOS.

CoreData Migrations

Page 48: Getting Test-y Test-driven Development & Automated Deployment for iOS.

Auto-testingguard integration

https://github.com/guard/guard