XCTest优于SenTestingKit有什么优势? [英] What are the advantages of XCTest over SenTestingKit?

查看:145
本文介绍了XCTest优于SenTestingKit有什么优势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iOS中进行单元测试。默认情况下,测试类是使用Xcode 5中的XCTest框架类创建的。我在早期版本的iOS中使用过SenTestingKit。这两个框架之间有什么区别? XCTest框架有哪些优点。我搜索相关文档,但我没有找到任何。我找到的只是在套件中使用的接口类。任何人都可以指向我相关的资源。

I want to do unit testing in iOS. By default test classes are created using XCTest framework classes in Xcode 5. I have used SenTestingKit in earlier versions of iOS. What are the differences between these two frameworks? What are the advantages of XCTest framework. I googled for related documentation but I did not find any. Only thing I found is the interface classes to use inside the kit. Can anyone point me to the related resources.

推荐答案

Apple的文档在测试方面尤其缺乏。这是一种耻辱,因为在XCTest上花了五分钟让我感到沮丧。所以,这里有一些你可能会觉得有用的文档。

Apple's documentation is notably lacking with regards to testing. It's a shame, because spending five minutes with XCTest made me fall for it. So, here are some docs that you may find useful.

首先,停下来观看有关测试的WWDC视频: https://developer.apple.com/wwdc/videos/?include=409#409 (必须是注册开发商)

First, stop and watch the WWDC video about testing: https://developer.apple.com/wwdc/videos/?include=409#409 (must be a registered developer)

然后,阅读Bots。它们是XCTest中真正的魔力。我目前正在建立一个运行Mavericks服务器的Mac Mini环境,该服务器连接到一小部分iPod Touch,iPhone和iPad,它们将同时运行我的单元测试并报告。它真是太神奇了。

Then, read about Bots. They're the real magic in XCTest. I'm currently setting up an environment of a Mac Mini running Mavericks Server connected to a small array of iPod Touches, iPhones and iPads that will simultaneously run my unit tests and report back. It's damn near magic.

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/000-About_Continuous_Integration/about_continuous_integration.html# // apple_ref / doc / uid / TP40013292

所有这些都说,我不太了解SenTest以便比较两者。但我正在学习XCTest,所以这里有一些关于我到目前为止正在挖掘它的想法。

All that said, I don't know SenTest well enough to compare the two. But I am learning XCTest, so here are a few thoughts on what I'm really digging about it so far.


  • 它已经存在。没有什么可下载的,您可以在制作要测试的对象的同时制作测试类对象。拉德。

  • 因为它与Xcode的集成非常深入,所以您可以在排水沟中看到测试覆盖率。您还可以使用Companion View从源查看测试人员,或从测试人员方法查看源。此外,它将永远是最新的 - 没有等待修复与Xcode的集成,因为苹果打破了一些东西。

  • 持续整合。机器人只是神奇的,它们很容易。你也得到Git托管,这是一个小的边缘特权,但如果你更喜欢你的Git内部托管但不想支付GitHub Enterprise更多。

还有一些衡量因素:


  • 缺乏文档。要求我阅读断言列表的标题是一个很好的举动。我毫不怀疑Apple很快会解决这个问题,但不会很快。

  • 你更深入地与Xcode联系在一起。对于开发来说并不是真正的骗局,但脚本XCTest并不像其他选项那样优雅。

  • 持续集成需要OS X Server。如果你真的想要它可以在同一台机器上,但即使你拥有Mountain Lion Server也需要20美元购买。我对这个(ha)一点都不苦。

我的两分钱。希望能帮助到你。我真的建议观看我链接的视频 - 他们会进行实时测试创建,并为一般的单元测试做一个非常引人注目的案例,无论你是否使用XCTest。

My two cents. Hope it helps. I'd really recommend watching that video I linked to - they do live test creation and make a really compelling case for unit testing in general, regardless of if you use XCTest.

这篇关于XCTest优于SenTestingKit有什么优势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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