Tokyo iOS Meetup - 409 - Testing In XCode

Preview:

DESCRIPTION

 

Citation preview

409 - TESTING IN XCODE

Gavin Thomasippoippo-software@ippoippo-eco.com

@IppoippoSftware

www.ippoippo-software.com

Sunday, 20 October 13

WHO AM I?

• Previously an Enterprise Java developer for 15 years for my day job

• Now work as Ruby developer for my day job

• Mac user since 2006, iOS devices since 2008.

• Dabbled with Obj-C since 2008, but started investing more time from start of this year.

Sunday, 20 October 13

WHY?

Sunday, 20 October 13

WHY?

WARNING

Generalisation and

Stereotypes

Sunday, 20 October 13

WHY?

Sunday, 20 October 13

WHY?

• The Ruby development world has a strong testing ethos, typically ‘spec’ (or human readable) orientated. Leads the way, but sometimes tooling is fragile.

• Enterprise Java development world was slower to catch on, but JUnit is used heavily now. However, the tooling is solid.

• Despite xUnit coming from Smalltalk, historically Unit Testing was never big in ‘old’ Objective-C world.

• New generation of Obj-C devs are driving Unit Testing with 3rd party tools (Kiwi, Expecta, OCMock, OCMockito, Specta)

Sunday, 20 October 13

WHAT’S THE MAIN TOPIC IN THE VIDEO?

• Unit Testing basics (why and what) 04:14 to 07:15

• New Frameworks and Tools (XCTest and XCode updates) 07:15 to 33:20

• Continuous Integration 33:20 to 45:00

Sunday, 20 October 13

WHAT KIND OF VALUE FROM WATCHING IT?

• New Objective-C developers who have not experienced Unit Testing elsewhere get an overview of the ‘why’?

• Understand that Apple is adopting ‘best practice’ as used elsewhere in the industry.

• For experienced ‘unit testers’, understand what improvements Apple has added to tools (and to understand what is still missing)

Sunday, 20 October 13

MOST INTERESTING POINTS?

• 1:18 - “Why Test?” According to Apple

• Catch ‘crashers’ - No1 reason why apps are rejected.

• Helps development in teams

Sunday, 20 October 13

MOST INTERESTING POINTS?

• 7:09 - “Where to start testing”

• Using out of the box XCode tools, Models and Controllers are ‘easier’ to test.

Sunday, 20 October 13

MOST INTERESTING POINTS?

• 10:25 - Test Navigator

• For previous IntelliJ, RubyMine, Eclipse etc users... IDE tools

Sunday, 20 October 13

MOST INTERESTING POINTS?• 20:00 - Checklist for what

you should test for

• For people experience in Unit Testing in other languages, but new to Objective-C...

• The failures to check for list is very useful as Objective-C specific

Sunday, 20 October 13

MOST INTERESTING POINTS?• 21:22 - setUp

• ‘shim’ ==> Ohh, you mean a mock object!

• So, XCTest comes with Mocking support, No? Dammit!

• We rely on 3rd-parties still, like OCMock, or OCMockito (or Kiwi)

Sunday, 20 October 13

MOST INTERESTING POINTS?

• 23:35 - iOS6

• If you want to support iOS6, you need to use the older OCTest still!

Sunday, 20 October 13

MOST INTERESTING POINTS?• 33:20 - CI with an Apple

flavour

• Relies on OS X Server, rather than support for existing tools (like Jenkins etc).

• Allows testing of software on• Multiple connected iOS Devices

• Multiple iOS Sims

• Multiple iOS VersionsFailing on iPad mini iOS6,working on iPhone iOS7

Sunday, 20 October 13

MOST INTERESTING POINTS?

• 46:42 - Already have CI (example, company doing non Obj-C work as well as iOS Apps)?

• Use the command line tools, and integrate that way rather than rely on OS X Server

Sunday, 20 October 13

OTHER RESOURCES• http://iosunittesting.com

• http://qualitycoding.org

• http://pragprog.com/magazines/2012-10/its-not-about-the-unit-tests• “iOS developers generally don’t unit test. So why then do they as a community seem to

enjoy a reputation for quality? No unit tests. No continuous integration. No TDD.”

• An out of date quote now? Unit Testing does not guarantee quality. However, it’s a tool that helps you get there if you are already in the right ‘quality’ mindset.

Sunday, 20 October 13