Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

IOS testing - functional

Hi I was just wondering, after finishing my ios app, is there a way to script up some automated tests to ensure that all the functions work as expected?

2 Answers

Xcode comes with native Unit Testing capability. It's still not fully mature but good enough to test some basic methods and test cases.

https://developer.apple.com/library/mac/documentation/ToolsLanguages/Conceptual/Xcode_Overview/UnitTestYourApp/UnitTestYourApp.html

Hi John, thanks for the reply!

Oh what I actually meant was not unit testing, but to actually run through the scenarios on the app. Ie, write some automated scripts (data driven probably), which then runs through the 'real world' scenarios through the app.

Because sometimes the unit test passes but when a 'user' goes through the app it may not behave as expected?

thanks again!

For mobile device, the only way to test out "real" scenario is to use it among yourself and your beta users, a lot. Of course, for specific things like route simulation can be done using a GeoJSON file + the iOS simulation or network conditioner on an iOS device, but currently there's no scriptable solution to test the app as a whole in general.

I have been doing some digging around and found appium which is more suited to what i am looking for. In some instances, test scenarios could be in the hundreds, this is something which may increase efficiency and test coverage by being able to automate rather than 'using the device' especially if there are time constraints.

Thanks for your responses, i wonder if treehouse would teach this kind of stuff some time soon?!

Nice find. Didn't know about that one.