对于iPhone上的行为驱动开发,最好的技术是什么?有哪些开源示例项目展示了这些技术的合理使用?以下是我发现的一些选择:
单元测试
试验::单位样式
RSpec样式
验收试验
硒样式
- [UI Automation Instruments Guide](http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Built-InInstruments/Built-InInstruments.html#//apple_ref/doc/uid/TP40004652-CH6-SW75)
- [UI Automation reference documentation](http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/UIAutomationRef/_index.html)
- [Tuneup js](https://github.com/alexvollmer/tuneup_js) - cool library for using with UIAutomation.
- [Capturing User Interface Actions into Automation Scripts](http://developer.apple.com/library/ios/#documentation/AnalysisTools/Conceptual/WhatsNewInstruments/NewFeatures42/NewFeatures42.html#//apple_ref/doc/uid/TP40010950-CH4-SW8)可以使用黄瓜(用JavaScript写成)来驱动UI自动化。这将是一个伟大的开源项目。然后,我们可以编写格尔金来运行UI自动化测试。现在,我只写Gherkin作为评论。
更新:西葫芦框架似乎将Cucumber和UI自动化混合在一起!:)
旧博文:
- [Alex Vollmer's UI Automation tutorial](http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/)
- [O'Reilly Answers UI Automation tutorial](http://answers.oreilly.com/topic/1646-how-to-use-uiautomation-to-create-iphone-ui-tests/)
- [Adi Saxena's UI Automation tutorial](http://www.codeproject.com/KB/iPhone/UI_Automation_Testing.aspx)
- [UISpec is open source on Google Code](http://code.google.com/p/uispec/).
- [UISpec has comprehensive documentation](http://code.google.com/p/uispec/wiki/Documentation).
黄瓜样式
- The [Frank Google Group](http://groups.google.com/group/frank-discuss) has much more activity than the [iCuke Google Group](http://groups.google.com/group/icuke).
- 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](https://github.com/BlueFrogGaming/icuke/blob/master/lib/icuke/icuke_world.rb). And, [Frank also has a step definition compendium on their wiki](https://github.com/moredip/Frank/wiki/Step-Definition-compendium).
- [I proposed that we merge iCuke & Frank](http://groups.google.com/group/frank-discuss/browse_thread/thread/a2c76ede9476d3db/213880d0aceb14df?lnk=gst&q=icuke#213880d0aceb14df) (similar to how Merb & Rails merged) since they have the same common goal: Cucumber for iOS.
添加
结论
很明显,这个问题没有正确的答案,但我现在选择的是:
对于单元测试,我曾经在XCode 4中使用XCode 4,它简单而可靠。但是,我更喜欢BDD的语言,而不是TDD (为什么RSpec比测试更好::Unit?)因为我们的语言创造了我们的世界。所以现在,我使用猕猴桃与ARC & Kiwi代码完成/自动完成。比起雪松,我更喜欢猕猴桃,因为它建在OCUnit之上,带有RSpec风格的匹配器&模拟/存根。更新:我现在正在研究OCMock,因为,目前,Kiwi不支持顽固使用免费的桥接对象。。
对于验收测试,我使用UI自动化,因为它很棒。它允许您记录每个测试用例,使编写测试自动化。此外,苹果开发了它,因此它有着光明的未来。它也适用于设备和仪器,这允许其他酷的功能,如显示内存泄漏。不幸的是,使用UI自动化,我不知道如何运行Objective代码,但是使用Frank和iCuke可以。所以,我只需要用单元测试测试较低级别的Objective,或者只为构建配置创建构建配置s,当单击它时,它将运行Objective代码。
你用的是什么解决方案?
相关问题
发布于 2011-03-05 15:43:39
我将不得不将弗兰克加入到验收测试组合中。这是一个相当新的增加,但工作到目前为止对我很好。而且,它实际上是积极的工作,不像icuke和其他。
发布于 2010-11-06 20:40:33
对于测试驱动的开发,我喜欢使用GHUnit,它很容易设置,而且对调试也很有用。
发布于 2012-01-04 13:54:06
很棒的名单!
我为UI测试iOS应用程序找到了另一个有趣的解决方案。
西葫芦框架
它是基于UIAutomation的。该框架允许您以Cucumber类样式编写以屏幕为中心的场景。这些场景可以在模拟器和设备上从控制台执行(它是CI友好的)。
断言是基于屏幕截图的。听起来不灵活,但它给您提供了一个很好的HTML报告,通过高亮显示的屏幕比较,您可以提供掩码来定义想要精确断言像素的区域。
每个屏幕都必须用CoffeScript来描述,它自己编写的工具是用红宝石写的。这是一种多方位的噩梦,但是这个工具为UIAutomation提供了一个很好的抽象,当描述屏幕时,它甚至对QA人员来说也是可管理的。
https://stackoverflow.com/questions/4114083
复制相似问题