Top Banner
These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike Swingler Xcode Engineer
149

Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Feb 06, 2018

Download

Documents

phamxuyen
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

These are confidential sessions—please refrain from streaming, blogging, or taking pictures

Session 409

Testing in Xcode 5

Mike SwinglerXcode Engineer

Page 2: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

Page 3: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

• Catch crashes

Page 4: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

• Catch crashes• Catch logic errors

Page 5: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

• Catch crashes• Catch logic errors•Help you write your code

Page 6: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

• Catch crashes• Catch logic errors•Help you write your code• Catch regressions

Page 7: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

• Catch crashes• Catch logic errors•Help you write your code• Catch regressions• Cover more configurations

Page 8: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Why Test?

• Catch crashes• Catch logic errors•Help you write your code• Catch regressions• Cover more configurations• Cover everyone, all the time

Page 9: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Overview

Page 10: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Overview

•What is a unit test?

Page 11: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Overview

•What is a unit test?• Introducing XCTest

Page 12: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Overview

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

Page 13: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Overview

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests• Continuous integration

Page 14: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Overview

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests• Continuous integration•Advanced setups

Page 15: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Unit Testing

Page 16: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Tests ONE thing■ Single “unit” of functionality■ Pass/Fail■ Small, fast, isolated 1

What Is a Unit Test?

Page 17: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Tests ONE thing■ Single “unit” of functionality■ Pass/Fail■ Small, fast, isolated

•Unit tests don’t cover■ Performance 1

What is a Unit Test?

Page 18: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Tests ONE thing■ Single “unit” of functionality■ Pass/Fail■ Small, fast, isolated

•Unit tests don’t cover■ Performance■ UI interaction 1

What is a Unit Test?

Page 19: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Tests ONE thing■ Single “unit” of functionality■ Pass/Fail■ Small, fast, isolated

•Unit tests don’t cover■ Performance■ UI interaction■ Whole system integration 1

What is a Unit Test?

Page 20: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Where to start testingYour App

Page 21: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Where to start testingYour App

Model

Controller

View Server

Database

Page 22: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Where to start testingYour App

Model

Controller

View Server

Database

Page 23: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Introducing XCTest

Page 24: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTest.framework

• iOS and OS X

Page 25: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTest.framework

• iOS and OS X• Requires Xcode 5

Page 26: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTest.framework

• iOS and OS X• Requires Xcode 5•Derived from OCUnit

■ Modernized■ Migration tool

Page 27: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTest.framework

• iOS and OS X• Requires Xcode 5•Derived from OCUnit

■ Modernized■ Migration tool

• Builds .xctest bundles

Page 28: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTest.framework

• iOS and OS X• Requires Xcode 5•Derived from OCUnit

■ Modernized■ Migration tool

• Builds .xctest bundles• Test runner injected in your app

Page 29: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTest.framework

• iOS and OS X• Requires Xcode 5•Derived from OCUnit

■ Modernized■ Migration tool

• Builds .xctest bundles• Test runner injected in your app• Test rig loads libraries and test bundles

Page 30: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test Code

Page 31: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

Test Code

Page 32: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

Test Code

• Subclass XCTestCase XCTestCase

Page 33: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

- (void) testExample {

}

Test Code

• Subclass XCTestCase• test = method

Page 34: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

Test Code

• Subclass XCTestCase• test = method• Prefixed “test”

test

Page 35: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

Test Code

• Subclass XCTestCase• test = method• Prefixed “test”•No arguments, returns void void

Page 36: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

XCTAssertTrue(2 + 2 == 4)

Test Code

• Subclass XCTestCase• test = method• Prefixed “test”•No arguments, returns void•Makes assertions

Page 37: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

- (void) testExample { XCTAssertTrue(2 + 2 == 4);}

@end

Test Code

• Subclass XCTestCase• test = method• Prefixed “test”•No arguments, returns void•Makes assertions• Built into test target

Page 38: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test Navigator

Page 39: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test Navigator

Page 40: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

Test Navigator

Page 41: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run

Test Navigator

Page 42: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run

Test Navigator

Page 43: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run

Test Navigator

Page 44: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 45: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 46: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 47: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 48: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 49: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline• Filter failures

Test Navigator

Page 50: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline• Filter failures

Test Navigator

Page 51: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Editor Test Indicators

Page 52: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Editor Test Indicators

Page 53: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Editor Test Indicators

Page 54: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Editor Test Indicators

Page 55: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

DemoMaking your first unit test in Xcode 5

Mike SwinglerXcode Engineer

Page 56: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Creating a test target is easy•Add a new test by adding a method• Easy to run tests

■ Test navigator■ Editor

Making your first unit test in Xcode 5Overview

Page 57: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Creating a test target is easy•Add a new test by adding a method• Easy to run tests

■ Test navigator■ Editor

Making your first unit test in Xcode 5Overview

Page 58: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Creating a test target is easy•Add a new test by adding a method• Easy to run tests

■ Test navigator■ Editor

Making your first unit test in Xcode 5Overview

Page 59: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Creating a test target is easy•Add a new test by adding a method• Easy to run tests

■ Test navigator■ Editor

Making your first unit test in Xcode 5Overview

Page 60: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Creating a test target is easy•Add a new test by adding a method• Easy to run tests

■ Test navigator■ Editor

Making your first unit test in Xcode 5Overview

Page 61: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Creating a test target is easy•Add a new test by adding a method• Easy to run tests

■ Test navigator■ Editor

Making your first unit test in Xcode 5Overview

Page 62: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTestAssertions.hAssert the Expected

Page 63: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTestAssertions.hAssert the Expected

XCTFail

XCTAssertNil

XCTAssertNotNil

XCTAssertTrue

XCTAssertTrueNoThrow

XCTAssertFalse

XCTAssertFalseNoThrow

XCTAssertEqualObjects

XCTAssertEquals

XCTAssertEqualsWithAccuracy

XCTAssertThrows

XCTAssertThrowsSpecific

XCTAssertThrowsSpecificNamed

XCTAssertNoThrow

XCTAssertNoThrowSpecific

XCTAssertNoThrowSpecificNamed

Page 64: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTestAssertions.hAssert the Expected

XCTFail

XCTAssertNil

XCTAssertNotNil

XCTAssertTrue

XCTAssertTrueNoThrow

XCTAssertFalse

XCTAssertFalseNoThrow

XCTAssertEqualObjects

XCTAssertEquals

XCTAssertEqualsWithAccuracy

XCTAssertThrows

XCTAssertThrowsSpecific

XCTAssertThrowsSpecificNamed

XCTAssertNoThrow

XCTAssertNoThrowSpecific

XCTAssertNoThrowSpecificNamed

Page 65: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTestAssertions.hAssert the Expected

XCTFail

XCTAssertNil

XCTAssertNotNil

XCTAssertTrue

XCTAssertTrueNoThrow

XCTAssertFalse

XCTAssertFalseNoThrow

XCTAssertEqualObjects

XCTAssertEquals

XCTAssertEqualsWithAccuracy

XCTAssertThrows

XCTAssertThrowsSpecific

XCTAssertThrowsSpecificNamed

XCTAssertNoThrow

XCTAssertNoThrowSpecific

XCTAssertNoThrowSpecificNamed

Page 66: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTestAssertions.hAssert the Expected

XCTFail

XCTAssertNil

XCTAssertNotNil

XCTAssertTrue

XCTAssertTrueNoThrow

XCTAssertFalse

XCTAssertFalseNoThrow

XCTAssertEqualObjects

XCTAssertEquals

XCTAssertEqualsWithAccuracy

XCTAssertThrows

XCTAssertThrowsSpecific

XCTAssertThrowsSpecificNamed

XCTAssertNoThrow

XCTAssertNoThrowSpecific

XCTAssertNoThrowSpecificNamed

Page 67: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

XCTestAssertions.hAssert the Expected

XCTFail

XCTAssertNil

XCTAssertNotNil

XCTAssertTrue

XCTAssertTrueNoThrow

XCTAssertFalse

XCTAssertFalseNoThrow

XCTAssertEqualObjects

XCTAssertEquals

XCTAssertEqualsWithAccuracy

XCTAssertThrows

XCTAssertThrowsSpecific

XCTAssertThrowsSpecificNamed

XCTAssertNoThrow

XCTAssertNoThrowSpecific

XCTAssertNoThrowSpecificNamed

Page 68: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Expect the Unexpected

Page 69: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Expect the Unexpected

• Expected success

Page 70: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Expect the Unexpected

• Expected success■ Can come first

Page 71: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions

Expect the Unexpected

Page 72: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions• Expected failure

Expect the Unexpected

Page 73: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN

Expect the Unexpected

Page 74: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN■ Nil

Expect the Unexpected

Page 75: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN■ Nil■ Empty collections

Expect the Unexpected

Page 76: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN■ Nil■ Empty collections■ Unexpected types in collections

Expect the Unexpected

Page 77: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN■ Nil■ Empty collections■ Unexpected types in collections■ NSError

Expect the Unexpected

Page 78: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

-setUpSet Up a Test

Page 79: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

-setUpSet Up a Test

• Runs before every test method

Page 80: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

-setUpSet Up a Test

• Runs before every test method• Create “shim” objects

Page 81: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

-setUpSet Up a Test

• Runs before every test method• Create “shim” objects• Load data from .xctest bundle

■ [NSBundle bundleForClass:[MyTestClass class]]

Page 82: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

-setUpSet Up a Test

• Runs before every test method• Create “shim” objects• Load data from .xctest bundle

■ [NSBundle bundleForClass:[MyTestClass class]]

•…anything you need to setup “the world”

Page 83: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

-setUpSet Up a Test

• Runs before every test method• Create “shim” objects• Load data from .xctest bundle

■ [NSBundle bundleForClass:[MyTestClass class]]

•…anything you need to setup “the world” •Use -tearDown to perform any cleanup

Page 84: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 85: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

XCTestCase

- (void) test

- (void) test

Page 86: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 87: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 88: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 89: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 90: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 91: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 92: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 93: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 94: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Test class and methods

@interface ExampleTests : XCTestCase@implementation ExampleTests

+ (void) setUp { /* Class set-up. */ }

+ (void) tearDown { /* Class tear-down. */ }

- (void) setUp { /* Test set-up. */ }

- (void) tearDown { /* Test tear-down. */ }

- (void) testExamplePassing { XCTAssertTrue(YES);}

- (void) testExampleFailing { XCTAssertTrue(NO);}

How XCTest Works

Page 95: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

OCUnit

Page 96: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Co-exists with XCTest

OCUnit

Page 97: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Co-exists with XCTest• You may still need it

■ iOS 6

OCUnit

Page 98: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Co-exists with XCTest• You may still need it

■ iOS 6

•Migration tool available

OCUnit

Page 99: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Co-exists with XCTest• You may still need it

■ iOS 6

•Migration tool available

OCUnit

Page 100: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Co-exists with XCTest• You may still need it

■ iOS 6

•Migration tool available

OCUnit

Page 101: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• Co-exists with XCTest• You may still need it

■ iOS 6

•Migration tool available

OCUnit

Page 102: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Debugging Tests

Page 103: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

DemoDebugging tests

Bino George Xcode Engineer

Page 104: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UI

• Test breakpoint

Overview

Page 105: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UI

• Test breakpoint

Overview

Page 106: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UI

• Test breakpoint• Test assistant categories

Overview

Page 107: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UI

• Test breakpoint• Test assistant categories

Overview

Page 108: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 109: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 110: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 111: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 112: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Continuous Integration and Testing

Page 113: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Testing Using OS X Server

Page 114: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Testing Using OS X Server

• Xcode service Bots perform integrations■ Every time your commit code■ On the hour

Page 115: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Testing Using OS X Server

• Xcode service bots perform integrations■ Every time your commit code■ On the hour

• Create a Scheme■ Bots run shared schemes

Page 116: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

SHARED

Testing Using OS X Server

• Xcode service bots perform integrations■ Every time your commit code■ On the hour

• Create a Scheme■ Bots run shared schemes

Page 117: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Testing Using OS X Server

• Xcode service bots perform integrations■ Every time your commit code■ On the hour

• Create a Scheme■ Bots run shared schemes

• Brings results to you

Page 118: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Many Configurations

Page 119: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• iOS devices

Many Configurations

Page 120: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• iOS devices• iOS simulator

Many Configurations

Page 121: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• iOS devices• iOS simulator•Different OS versions

Many Configurations

Page 122: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

• iOS devices• iOS simulator•Different OS versions•OS X

Many Configurations

Page 123: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

DemoContinuous integration with OS X Server

Page 124: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Continuous integration with OS X ServerOverview

Page 125: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Continuous integration with OS X ServerOverview

• Setup shared schemes for bot

Page 126: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Continuous integration with OS X ServerOverview

• Setup shared schemes for bot• Covers multiple configurations

■ Devices, OS versions, simulators

Page 127: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Continuous integration with OS X ServerOverview

• Setup shared schemes for bot• Covers multiple configurations

■ Devices, OS versions, simulators

• Bot and test results summary

Page 128: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Command-line Testing

Page 129: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Command-line Testing

> xcodebuild test

Page 130: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Command-line Testing

> xcodebuild test-scheme MyLibrary

Page 131: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Command-line Testing

> xcodebuild test-scheme MyLibrary-destination 'platform=OS X,arch=x86_64'

Page 132: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Command-line Testing

> xcodebuild test-scheme MyLibrary-destination 'platform=OS X,arch=x86_64'-destination 'platform=iOS,name=My Development iPod Touch’

Page 133: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

'

Command-line Testing

> xcodebuild test-scheme MyLibrary-destination 'platform=OS X,arch=x86_64'-destination 'platform=iOS,name=My Development iPod Touch’-destination 'platform=iOS Simulator,name=iPhone

Page 134: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Command-line Testing

> xcodebuild test-scheme MyLibrary-destination 'platform=OS X,arch=x86_64'-destination 'platform=iOS,name=My Development iPod Touch’-destination 'platform=iOS Simulator,name=iPhone,OS=6.1'

Page 135: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

Page 136: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?

Page 137: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest

Page 138: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

Page 139: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator

Page 140: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator■ Editor indicators

Page 141: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator■ Editor indicators■ Test failure breakpoint

Page 142: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator■ Editor indicators■ Test failure breakpoint■ Assistant categories

Page 143: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator■ Editor indicators■ Test failure breakpoint■ Assistant categories■ Test Again command

Page 144: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator■ Editor indicators■ Test failure breakpoint■ Assistant categories■ Test Again command

• Continuous integration, advanced setups

Page 145: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Wrap Up

•What is a unit test?• Introducing XCTest•Writing, running and debugging tests

■ Test Navigator■ Editor indicators■ Test failure breakpoint■ Assistant categories■ Test Again command

• Continuous integration, advanced setups• Testing helps you write better, high quality apps

Page 146: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

More Information

Dave DeLongDeveloper Tools [email protected]

Xcode Documentationhttp://developer.apple.com/

Apple Developer Forumshttp://devforums.apple.com

Page 147: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Related Sessions

Continuous Integration with Xcode 5 PresidioTuesday 3:15PM

Page 148: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking

Related Labs

ç

Tools Lab Tools LabOngoing

Xcode and Continuous Integration Lab Tools Lab AThursday 9:00AM

Page 149: Testing in Xcode 5 - Apple Inc.devstreaming.apple.com/videos/wwdc/2013/409xdx4x4adcwca5ok0rts… · These are confidential sessions—please refrain from streaming, blogging, or taking