Better HN
topnewbestaskshowjobs
Log inSign up

spindel

11 karma · joined Jul 15, 2011 (15y ago) · 3 submissions

Submissions

comment 15y ago · link · parent

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.

comment 15y ago · link · parent

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.

comment 15y ago · link · parent

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.