News for hackers. Stuff that matters.

spindel

Re:IOS Integration Testing by Square on Monday July 18, 2011 @01:23AM (#2775216)
Our iOS team at Square is more comfortable and efficient writing tests (and test libraries) in Objective-C than JavaScript. We actually wouldn't gain much from the 'scripting language'-ness of JavaScript, and the additional language and tool (Instruments) would make writing tests more complicated and painful.
Re:IOS Integration Testing by Square on Friday July 15, 2011 @07:16PM (#2769518)
1. You can't automate running of the UIAutomation tests. Square really wanted this for continuous integration.

2. Writing the UIAutomation scripts is really tedious (though it's much better in iOS [redacted]).

3. The UIAutomation tests ran very slowly.

4. Having to write all the tests in JavaScript isn't very flexible.

That said, just like UIAutomation, KIF stands on the shoulders of the great accessibility features in iOS. In many ways KIF is like an Objective-C version of UIAutomation.

Re:IOS Integration Testing by Square on Friday July 15, 2011 @04:49PM (#2769034)
Kiwi is for unit testing, KIF is for integration testing. They don't do the same thing (nor try to). Since you said you're just starting to get into it, here's what that means:

Integration tests simulate a user using your app - tapping on controls, manipulating views, typing in text, etc (see the video in the blog post). As these steps run you have simple tests to make sure the app is behaving as you expect it to.

Unit tests exercise more discrete things like model objects, controller logic, validations. Tons of small tests like "when we add these money values together, is the sum what we expect?".

At Square we use KIF for integration tests and GHUnit for unit tests. We run both on a continuous integration system (CruiseControl.rb) that runs the tests whenever we push new code.