paint-brush
Approaching Unit Testing in iOS Correctlyby@soniya8
479 reads
479 reads

Approaching Unit Testing in iOS Correctly

by soniya6mJuly 2nd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The XCTest library provides a common framework for writing unit tests in Swift for Swift packages and applications. Unit testing can be easily approached when starting for a new project using techniques like Test Driven Development, Protocol Oriented Programming and Dependency Injection. Unit test cases should be completely independent of one another because they execute asynchronously. Mocking is testing your code logic using dummy data or mocked data gives a near to real simulation of testing. Listing down pieces of code that need to be mocked: Data parsing and data manipulation: Data from APIs, files, cache, DB, local storage, user defaults, shared objects, globals, constants, constants and so on.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Approaching Unit Testing in iOS Correctly
soniya HackerNoon profile picture
soniya

soniya

@soniya8

L O A D I N G
. . . comments & more!

About Author

soniya HackerNoon profile picture
soniya@soniya8

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite