为 iPhone / iPad 编写单元测试的最佳方法是什么?
我正在开发一个 iPad 应用程序。我不确定是否应该为此应用程序编写单元测试,如果是,我应该如何编写它们。
您建议为 iPhone / iPad 编写单元测试的最佳方法是什么?
I am developing an iPad application. I'm not sure if I should write unit tests for this application, and if so, how I should go about writing them.
What would you suggest as the best approach to writing unit tests for iPhone / iPad?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,这里提出两个问题:
答:当然可以。我数不清有多少次它为我节省了数小时的痛苦和磨难。
回答:对于我自己来说,我跳过了 sen,转向了 GHUnit 和 OCMock。 GHUnit 允许在模拟器中进行测试和调试,而 sen 则不允许。仅此一点就使其成为 iPhone/iPad 开发的更好建议。
Ok, there are two questions being raised here:
Answer: Definitely. I cannot count the times it has saved me hours of pain and suffering.
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.
Regardless what OS/platform your application targets, regardless of what size it has today ..