What is the best approach for writing unit tests for iPhone / iPad?

戏子无情 提交于 2019-11-30 16:24:57

Ok, there are two questions being raised here:

  1. Is unit testing worth it?

Answer: Definitely. I cannot count the times it has saved me hours of pain and suffering.

  1. What's the best way to unit test in the iPhone/iPad environment?

Answer: for myself I skipped sen and moved onto GHUnit and OCMock. GHUnit allows in simulator testing and debugging where as sen doesn't. This alone makes it a better proposition for iPhone/iPad development.

You will write the test once, but run it many times as your application evolves.

If the tests pass, you know you didn't break anything. If the tests fail, you know where to fix. If the tests pass and the application fails, you know you need more tests.

  • In the long run writing the test will SAVE time.
  • In the short run you can validate you know what your individual routines do, and thus gain confidence in the correctness of your code, by writing the tests.

Regardless what OS/platform your application targets, regardless of what size it has today ..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!