Xcode unit testing

前端 未结 4 1371
甜味超标
甜味超标 2020-12-02 23:56

I have never used Unit Testing and I understand the uses of it but I don\'t really know when and how to use it.

I would like to know when it\'s worth it to use Unit

4条回答
  •  甜味超标
    2020-12-03 00:19

    Any time your writing an application that has classes, that are not your own. That is a good time to add unit tests, to test those classes.

    All but the most basic apps will have their own classes, so its almost always a good idea to unit test.

    If you are creating libraries that other programmers will use, or that you will use in multiple projects, those should always have unit tests.

    Unit tests save you a lot of time when things change, for instance, a new version of the OS comes out, it is much better to test with the unit tests then to just test the app.

提交回复
热议问题