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

Post on 26-Mar-2015

219 views 1 download

Tags:

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

Getting “Test”-yTest-driven Development & Automated

Deployment for iOS

Your Humble Speakers

•Jonah Williams - @Zalambar

•Rudy Jahchan - @rudy

How do we test?

How do we test?

SenTestingKit

GTM

Cedar

KiwiKIF

GHUnitOCMock

OCHamcrest

Frank

iCuke

Why do we test?

Why do we test?

To make sure our code works(duh!)

Why do we test FIRST?

Why do we test FIRST?

To design our code.(duh!)

Why do we test FIRST?

Test Structure

GIVEN

WHEN

THEN

certain conditions

something happens

the conditions change (or don’t)

Unit Testing

Unit Testing

Sample Class

xUnit Style

SenTestingKit

OCHamcresthttp://bit.ly/ochamcrest

Stubbing & Mocking

OCMock

http://bit.ly/qktX3H

GTMhttp://bit.ly/gtmtest

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

BDD

BDD

Behavior Driven Design

RSpec

http://github.com/rspec/rspec

RSpec Book

Cedar

http://github.com/pivotal/cedar

Kiwi

http://kiwi-lib.info/

Integration Tests

Cucumber

http://cukes.info/

iCuke

http://github.com/unboxed/icuke

iCuke

http://github.com/unboxed/icuke

Frank

http://github.com/moredip/Frank

KIFhttp://github.com/square/KIF

KIF

http://github.com/square/KIF

KeepItFunctional

KIF

http://github.com/square/KIF

Continuous Integration

Command-Line Builds

Command-Line Execution

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!

Rake

http://gist.github.com/1017153

Over The Air Distribution

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/

What’s Missing?

Factories

Factories

Fixtures

CoreData Migrations

Auto-testingguard integration

https://github.com/guard/guard