Transcript of "iPhone Application Testing"

2.
Who am I? Dan Pilone (dan@element84.com, @danpilone) Author of Head First Software Development and Head First iPhone and iPad Development Developed software for NASA, Raytheon, UPS, Hughes, and the Naval Research Laboratory Founder of Element 84, LLC iPhone App Testing - Copyright 2010 Element 84, LLCThursday, June 2, 2011

10.
Basic Unit Testing Support is built into Xcode Called Logic Tests by Apple Run as part of your build process Small scope for testing iPhone App Testing - Copyright 2010 Element 84, LLCThursday, June 2, 2011

18.
Notes... Run at build time and not easily debuggable Don’t run in the real context of the app Can’t run on a real device Fully automatable in a CI environment iPhone App Testing - Copyright 2010 Element 84, LLCThursday, June 2, 2011

21.
Test Driven Development works on a very simple cycle: First you write a test that checks whatever functionality you’re about to write. Obviously it fails, since you haven’t implemented the functionality yet. This is the red stage, since your test GUI probably shows the test in red (failing). Next, implement the functionality to get that test to pass. That’s it. No more. Nothing fancy. Write the simplest code you can to get your test to pass. This is the green stage. Finally, after your test passes, you can go back in and clean up some things that you may have noticed while implementing your code. This is the refactor stage. In the example for Starbuzz, you don’t have any other code to refactor, so you can go right on to the next test. iPhone App Testing - Copyright 2010 Element 84, LLCThursday, June 2, 2011

30.
Notes... Only run on the device Can tempt you to expose things publicly that might be best left private Let you perform full integration and load testing iPhone App Testing - Copyright 2010 Element 84, LLCThursday, June 2, 2011

34.
Notes... Use tune_up.js Provides a nice assertion and test wrapper around UIAutomation http://github.com/alexvollmer/tuneup_js Must run in Instruments making it difﬁcult to use in a CI environment iPhone App Testing - Copyright 2010 Element 84, LLCThursday, June 2, 2011