为iPhone / iPad编写单元测试的最佳方法是什么? [英] What is the best approach for writing unit tests for iPhone / iPad?

查看:185
本文介绍了为iPhone / iPad编写单元测试的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个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.

你认为什么是最好的方法为iPhone / iPad编写单元测试?

What would you suggest as the best approach to writing unit tests for iPhone / iPad?

推荐答案

您将编写一次测试,但随着应用程序的发展,会多次运行。

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 ..

这篇关于为iPhone / iPad编写单元测试的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆