Better HN
topnewbestaskshowjobs
Log inSign up

jam510

3 karma · joined Feb 11, 2015 (11y ago) · 11 submissions

Joe is the lead developer for BeerMenus.com. He loves clean code, craft beer, and chicken sandwiches.
Submissions

1.

Script that emails you transcript when your mentioned in a meeting(github.com ↗)

2 points · by jam510 · 10y ago · discuss

2.

Testing NSURLSession with Swift (and UI Testing)(masilotti.com ↗)

1 points · by jam510 · 10y ago · discuss

3.

UI Testing Cheat Sheet for iOS(github.com ↗)

1 points · by jam510 · 11y ago · discuss

4.

Three Ways UI Testing Just Made Test-Driven Development Even Better(masilotti.com ↗)

3 points · by jam510 · 11y ago · discuss

5.

Better Dependency Injection on iOS(masilotti.com ↗)

1 points · by jam510 · 11y ago · discuss

6.

UI Testing documentation now available online (unofficial)(joemasilotti.github.io ↗)

1 points · by jam510 · 11y ago · discuss

comment 11y ago · link · parent

Totally agree with you there. I try to have a few levels of testing:

- Unit - everything is mocked but the object under test - Integration - common flows are worked through in code (eg. showing populated cells from a fixture JSON file) - Feature - tapping through the app with the server mocked out (via recorded server responses) - Smoke - spinning up a dev server with known data and hitting a few endpoints by tapping around the app (to ensure the "wires" or working like API keys, headers, routes, etc.)

The second two are where I see UI Testing helping the most. My comment was mostly related to the level of testing I've identified as "Smoke".

comment 11y ago · link · parent

Author here! Happy to answer any questions here or in the comment section of the post.

comment 11y ago · link · parent

I agree; of the third party libraries KIF was the nicest to work with. The biggest issue is that it doesn't run reliably enough. When we moved our code to our CI box tests would false-negative almost 25% of the time.

I tried ticking the run loop a few different ways. But the test suite will crash and burn if you start to mess with the timing of the test host or application under test.

One issue with the XCTestExpectation note is that you can't wait for something if you don't know exactly how long it will take. Hard-coding in a timeout, essentially, can make your tests very brittle. Take, for instance, testing loading content from a local web server.