Xcode Unit & UI Test Strategy / How

I just started writing text tests with Xcode for the application I am writing, and so far it all seems pretty simple. However, this, unfortunately, is a small number of things to read about XCTestand related classes on the Internet, so I leave a couple of questions.

1) When testing massively complex structures such as a view controller, what are you testing? For example, my view controllers have outputs, view models, custom subclass classes, etc. For now, I'm just testing IBOutletsand can load the view controller from the storyboard instance.

2) Should I test custom view classes on my own? For some views, this makes sense (subclasses of buttons, text fields, etc.), since their view controller is independent, but as for high-standard classes, let's say OnboardingViewthat the property is in the instance OnboardingViewController.

3) Finally, what are the practical use cases XCTestSuite? My intuition would be if I wanted to combine similar tests together, say, for all my view controllers, and then run this particular test suite through some automation tool, for example, Jenkins.

+4
source share

Source: https://habr.com/ru/post/1607217/


All Articles