testing in xcode 5 - apple inc. · 2016. 7. 10. · these are confidential sessions—please...

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

Upload: others

Post on 16-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Why Test?

Page 3: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Why Test?

• Catch crashes

Page 4: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Why Test?

• Catch crashes• Catch logic errors

Page 5: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Why Test?

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

Page 6: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Why Test?

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

Page 7: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Overview

Page 10: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Overview

•What is a unit test?

Page 11: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Overview

•What is a unit test?• Introducing XCTest

Page 12: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Overview

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

Page 13: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Overview

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

Page 14: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Unit Testing

Page 16: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Where to start testingYour App

Page 21: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Where to start testingYour App

Model

Controller

View Server

Database

Page 22: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Where to start testingYour App

Model

Controller

View Server

Database

Page 23: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Introducing XCTest

Page 24: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

XCTest.framework

• iOS and OS X

Page 25: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

XCTest.framework

• iOS and OS X• Requires Xcode 5

Page 26: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

XCTest.framework

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

■ Modernized■ Migration tool

Page 27: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Test Code

Page 31: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@interface ExampleTests : XCTestCase@end

@implementation ExampleTests

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

@end

Test Code

Page 32: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

@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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Test Navigator

Page 39: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Test Navigator

Page 40: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

Test Navigator

Page 41: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run

Test Navigator

Page 42: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run

Test Navigator

Page 43: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run

Test Navigator

Page 44: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 45: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 46: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 47: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 48: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline

Test Navigator

Page 49: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline• Filter failures

Test Navigator

Page 50: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Test bundle targets■ Test classes

■ Test methods

• Click to run• Results inline• Filter failures

Test Navigator

Page 51: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Editor Test Indicators

Page 52: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Editor Test Indicators

Page 53: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Editor Test Indicators

Page 54: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Editor Test Indicators

Page 55: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

DemoMaking your first unit test in Xcode 5

Mike SwinglerXcode Engineer

Page 56: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

XCTestAssertions.hAssert the Expected

Page 63: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Expect the Unexpected

Page 69: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Expect the Unexpected

• Expected success

Page 70: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Expect the Unexpected

• Expected success■ Can come first

Page 71: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Expected success■ Can come first

• Regressions

Expect the Unexpected

Page 72: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Expected success■ Can come first

• Regressions• Expected failure

Expect the Unexpected

Page 73: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN

Expect the Unexpected

Page 74: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN■ Nil

Expect the Unexpected

Page 75: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Expected success■ Can come first

• Regressions• Expected failure

■ Overflow, ∞, NaN■ Nil■ Empty collections

Expect the Unexpected

Page 76: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• 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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

-setUpSet Up a Test

Page 79: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

-setUpSet Up a Test

• Runs before every test method

Page 80: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

-setUpSet Up a Test

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

Page 81: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

-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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

-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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

-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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

OCUnit

Page 96: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• Co-exists with XCTest

OCUnit

Page 97: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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

■ iOS 6

OCUnit

Page 98: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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

■ iOS 6

•Migration tool available

OCUnit

Page 99: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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

■ iOS 6

•Migration tool available

OCUnit

Page 100: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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

■ iOS 6

•Migration tool available

OCUnit

Page 101: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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

■ iOS 6

•Migration tool available

OCUnit

Page 102: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Debugging Tests

Page 103: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

DemoDebugging tests

Bino George Xcode Engineer

Page 104: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UI

• Test breakpoint

Overview

Page 105: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UI

• Test breakpoint

Overview

Page 106: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UI

• Test breakpoint• Test assistant categories

Overview

Page 107: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UI

• Test breakpoint• Test assistant categories

Overview

Page 108: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 109: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 110: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 111: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

New test debugging UIOverview

• Test breakpoint• Test assistant categories• Test Again command

Page 112: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Continuous Integration and Testing

Page 113: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Testing Using OS X Server

Page 114: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Many Configurations

Page 119: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• iOS devices

Many Configurations

Page 120: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• iOS devices• iOS simulator

Many Configurations

Page 121: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

• iOS devices• iOS simulator•Different OS versions

Many Configurations

Page 122: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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

Many Configurations

Page 123: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

DemoContinuous integration with OS X Server

Page 124: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Continuous integration with OS X ServerOverview

Page 125: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Continuous integration with OS X ServerOverview

• Setup shared schemes for bot

Page 126: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Command-line Testing

Page 129: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Command-line Testing

> xcodebuild test

Page 130: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Command-line Testing

> xcodebuild test-scheme MyLibrary

Page 131: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Command-line Testing

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

Page 132: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

'

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Wrap Up

Page 136: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Wrap Up

•What is a unit test?

Page 137: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Wrap Up

•What is a unit test?• Introducing XCTest

Page 138: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Wrap Up

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

Page 139: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Wrap Up

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

■ Test Navigator

Page 140: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

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. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Related Sessions

Continuous Integration with Xcode 5 PresidioTuesday 3:15PM

Page 148: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike

Related Labs

ç

Tools Lab Tools LabOngoing

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

Page 149: Testing in Xcode 5 - Apple Inc. · 2016. 7. 10. · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 409 Testing in Xcode 5 Mike