Daily iOS
Testing

Replacing UI tests

You have dozens of UI tests that are slow and break often. How would you restructure the code and the tests to replace most of them with unit tests?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Break down what the UI tests were verifying. State transitions, input validation, and formatting move to view model or presenter unit tests, the look of the screen moves to snapshot tests, navigation moves to router unit tests, and only a few UI tests stay for the core flows.

Share a question