Join John Nastos for an in-depth discussion in this video Writing tests for app logic, part of iOS Address Book App: Hands On.
- [Voiceover] When writing an app, we all know…that it's important to test your code.…Obviously, you wouldn't write a bunch of code,…just assume that it works, and then submit…it to the app store without running it…to make sure that it's functional.…When in comes time to actually perform those tests though,…there are many possibilities for how…to accomplish the testing.…One possibility is just running the app in the simulator…and on the device and using the features by hand.…That's what we've done so far in the building of this app.…However, this tends to be an imprecise method.…
You may do things slightly differently…every time you test, for example,…or you may be unintentionally avoiding…testing certain parts of the app…because you're focused on a certain element…that you're working on.…By writing tests in code, you can have…a more robust, more precise,…and more reliable testing method.…This doesn't mean that you shouldn't test by hand as well,…but having tests in code will give you a great way…to be more confident that your app…
Build the project step-by-step and then use what you've learned to explore your own app ideas.
- Creating the project in Xcode
- Using Auto Layout to design the UI
- Attaching the interface to the code
- Creating the data model, including a Person class
- Adding stored data to the UI
- Displaying a contact's address with MapKit
- Linking contact info to other iOS apps
- Adding persistence
- Working with table views
- Writing tests
- Preparing to publish the app in the App Store