XCode4 单元测试和 UI 自动化
我希望在我的公司进行测试,但我对最佳开始方式有点模糊。
我知道我可以使用单元测试框架,例如 OCUnit、GHUnit 或 SenTestingKit...到目前为止一切顺利。我可以使用 Mock 对象等创建一个逻辑测试我的项目的目标。
我还知道使用 UIAutomation 和 javascript 来驱动和测试 GUI。
因此,现在如果我实现一个相当复杂的 GUI 功能,我想对我的代码进行逻辑测试,并使用 UIAutomation 测试 GUI。我如何结合这两种方法,或者将它们分开对待,在这种情况下,我是否假设我需要用两种不同的语言编写两组测试全面测试一个功能?
顺便说一句,如果有人可以提供良好的链接来获取有关在已经成熟且不太模块化的代码库上开始测试的建议,我们将不胜感激。
谢谢!
I'm looking to set up testing at my company, but I'm a little fuzzy on the best way to start.
I know that I can use a framework for unit testing, such as OCUnit, GHUnit or SenTestingKit... so far so good. I can make a target which logic tests my project, using Mock objects etc.
I'm also aware of using UIAutomation and javascript to drive and test the GUI.
So, now if I implement a fairly complex GUI feature, I would like to logic test my code and also test the GUI using UIAutomation. How do I combine these two methodologies, or are they to be treated separately, in which case am I to assume that I need to write two sets of tests in two different languages to fully test one feature?
On a side-note, if anybody can provide good links for advice on beginning testing on an already mature and not-so-modular codebase, that would be much appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIAutomation 基于 JavaScript。测试用例是 JavaScript 文件的集合,稍后由 Instruments 执行。
是的,您必须单独执行此操作:
这个视频可能对你有帮助。花一个小时,之后您应该能够自己做出决定(UIAutomation 会话)。
http://developer.apple.com/videos/wwdc/2010/ way:目前还没有令人满意的方法来自动化 UIAutomation 测试(对于逻辑和单元测试,有一些)。例如,将它们与持续代码集成结合起来。有人对此进行了讨论,但到目前为止我还没有看到解决方案。总而言之,您可以稍微尝试一下,但对于严格的测试,UIAutomation 仍然不适用:
UIAutomation is JavaScript based. Test cases are collections of JavaScript files, which are later executed by Instruments.
Yes you have to do that seperately:
This video might help you. Take an hour and afterwards you should be able to decide on your own (the UIAutomation session).
http://developer.apple.com/videos/wwdc/2010/
By the way: There is no satisfying way to automate UIAutomation tests at the moment (For logic and unit tests, there are some). For example to combine them with Continuous Code Integration. There are discussions about that, but I have not seen a solution so far. All in all you can play a little with that, but for serious testing UIAutomation is still not applicable: