在iPhone上进行行为驱动开发最好的技术是什么?有哪些开源项目可以证明这些技术的合理使用呢?以下是我找到的一些选择:
单元测试
测试:单元的风格
OCUnit/SenTestingKit如iOS开发指南:单元测试应用程序和其他OCUnit参考中所述。 示例:iPhoneUnitTests, Three20 抓 GHUnit 谷歌工具箱Mac: iPhone单元测试
RSpec 风格
猕猴桃(也带有嘲讽和期待) 雪松 Jasmine与UI自动化显示在灵巧的ios -验收-测试规格
验收测试
硒的风格
UI Automation (works on device) UI Automation Instruments Guide UI Automation reference documentation Tuneup js - cool library for using with UIAutomation. Capturing User Interface Actions into Automation Scripts It's possible to use Cucumber (written in JavaScript) to drive UI Automation. This would be a great open-source project. Then, we could write Gherkin to run UI Automation testing. For now, I'll just write Gherkin as comments. UPDATE: Zucchini Framework seems to blend Cucumber & UI Automation! :) Old Blog Posts: Alex Vollmer's UI Automation tutorial O'Reilly Answers UI Automation tutorial Adi Saxena's UI Automation tutorial UISpec with UISpecRunner UISpec is open source on Google Code. UISpec has comprehensive documentation. FoneMonkey
黄瓜风格
Frank and iCuke (based on the Cucumber meets iPhone talk) The Frank Google Group has much more activity than the iCuke Google Group. Frank runs on both device and simulator, while iCuke only runs in simulator. Frank seems to have a more comprehensive set of step definitions than iCuke's step definitions. And, Frank also has a step definition compendium on their wiki. I proposed that we merge iCuke & Frank (similar to how Merb & Rails merged) since they have the same common goal: Cucumber for iOS. KIF (Keep It Functional) by Square Zucchini Framework uses Cucumber syntax for writing tests and uses CoffeeScript for step definitions.
添加
OCMock用于嘲弄 OCHamcrest和/或Expecta表示期望
结论
很明显,这个问题没有正确答案,但这是我目前的选择:
对于单元测试,我曾经在XCode 4中使用OCUnit/SenTestingKit。它简单而可靠。但是,比起TDD,我更喜欢BDD语言(为什么RSpec比Test::Unit好?),因为我们的语言创造了我们的世界。所以现在,我使用ARC和Kiwi代码完成/自动完成。比起雪松,我更喜欢Kiwi,因为它是建立在OCUnit之上的,并且带有rspec风格的匹配器和模拟/存根。更新:我现在正在寻找OCMock,因为,目前,Kiwi不支持存根免费桥接对象。
For acceptance testing, I use UI Automation because it's awesome. It lets you record each test case, making writing tests automatic. Also, Apple develops it, and so it has a promising future. It also works on the device and from Instruments, which allows for other cool features, like showing memory leaks. Unfortunately, with UI Automation, I don't know how to run Objective-C code, but with Frank & iCuke you can. So, I'll just test the lower-level Objective-C stuff with unit tests, or create UIButtons only for the TEST build configuration, which when clicked, will run Objective-C code.
你使用哪些解决方案?
相关问题
目前有没有一种BDD解决方案能在iOS4和Xcode4上很好地工作? SenTestingKit(与XCode集成)与XCode 4上的GHUnit进行单元测试? 使用OCunit在iOS上测试异步代码 SenTestingKit在Xcode 4:异步测试? iPhone上的单元测试是如何进行的?