Let's talk about Unit Test
What Unit Test ?
Every Smallest Testable Part of Application it's Called Unit, Simply Unit Test functionality for Every unit in your App
Why Unit Test ?
Advantage :
- Debugging Process becomes easier ๐ฅณ
- Catch Problem Early ๐
- Make Change In Code Base ๐๐ปโโ๏ธ
- Makes you self-confident ๐ง๐ปโ๐ป
DisAdvantage :
- Unit Test Will Not Cover Bug In Your App
- Will Not Catch Error In an integration test
Let's Talk about Unit Test Pyramid
- Pyramid Base: Unit Test It's Fast Because it runs in fake Http Request Or Dummy data
Pyramid Middle: Integration Test it Tests Your Web Service OR Test individual modules
Pyramid Top: UI testing is an important element of the software testing cycle. To validate whether applications have the desired functionalities
Main Topic In Article How To Implement Your First Unit Test in Xcode :
1# First Open Your Xcode And Create New Project
1-
2-
3-
On the third Screen, We can See The Unit Test class All I Need is two function
- setup()
- tearDown()
I Will Talk About these two functions in another Article
Now We Can Write Our First Unit test Case
There is a way to write a test case function func test[YOUR CLASS NAME][YOUR TEST CASE] [What Should Return] () {}
I will Talk More about Unit Tests in other articles, Now You Can Implement Unit Test In Your Project and How-To implement Your First Test Case Thanks,