XCode 4 - '包括单元测试'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5294309/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:29:04  来源:igfitidea点击:

XCode 4 - 'Include Unit Tests'

xcode

提问by Zrb0529

I just upgraded to XCode 4 and I was wondering if I need to 'include unit tests' when setting up an application? Also, what does that mean exactly?

我刚刚升级到 XCode 4,我想知道在设置应用程序时是否需要“包含单元测试”?另外,这到底是什么意思?

回答by Matt Ball

You do not needto include unit tests.

不需要包括单元测试。



What does "unit testing" mean? (from the unit-testingFAQ)

“单元测试”是什么意思?(来自单元测试常见问题解答

Unit testing is a method by which individual units of source code are tested to determine if they are fit for use. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual function or procedure. Unit tests are created by programmers or occasionally by white box testers.

Ideally, each test caseis independent from the others: substitutes like method stubs, mock objects, fakesand test harnessescan be used to assist testing a module in isolation. Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended.Wikipedia

Unit testing is closely related to Test Driven Development.

单元测试是一种测试单个源代码单元以确定它们是否适合使用的方法。单元是应用程序中最小的可测试部分。在过程编程中,一个单元可能是一个单独的函数或过程。单元测试由程序员或偶尔由白盒测试人员创建。

理想情况下,每个测试用例都独立于其他测试用例方法存根模拟对象伪造测试工具等替代品可用于帮助隔离测试模块。单元测试通常由软件开发人员编写和运行,以确保代码符合其设计并按预期运行。维基百科

单元测试与测试驱动开发密切相关。



@ToddHpoints out:

@ToddH指出:

It's easier to include [unit tests] when you setup the project. If you do it later there are quite a few steps involved in doing it correctly: http://twobitlabs.com/2011/06/...

在设置项目时包含 [单元测试] 会更容易。如果您稍后再做,正确执行需要很多步骤:http://twobitlabs.com/2011/06/...

Thanks for the protip, Todd!

谢谢你的提示,托德!