Monkeyrunner 与 Instrumentation - 功能测试哪个更好?
我想为 Android 应用程序创建几个功能测试,以便在持续集成服务器上运行它们。据我了解,有两种主要方法:monkeyrunner 和通过仪器测试用例。
目前,我看不到 Monkeyrunner 的任何优点,但我可能会错过一些东西。它有什么用呢?
I want to create a couple of functional tests for an Android application to run them on a continuous integration server. As far as I understand, there are two main approaches: monkeyrunner and test cases via instrumentation.
At the moment, I can't see any advantages of monkeyrunner, but I might be missing something. What is it good for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我喜欢使用 MonkeyRunner,因为它非常便携(Linux、Mac 和 Windows)、易于设置并且可以在许多不同的设备和模拟器上轻松工作。此外,有时使用仪器时,您会遇到与应用程序无关的崩溃,而是由于仪器实现而导致的。使用 MonkeyRunner,您将知道导致崩溃的原因。
I like to use MonkeyRunner because its really portable (Linux, Mac and Windows), easy to setup and can work easily across many different devices and emulators. Also, sometimes with instrumentation you get crashes that are unrelated to the app, but are rather because of the instrumentation implementation. With MonkeyRunner you will know what caused the crash.
根据我的经验,猴子测试非常适合检测应用程序在以下方面的缺陷:
我想说,猴子测试并不反对单元/仪器测试,但它是测试您的应用程序是否按预期工作的另一种方法。
当然,这也取决于要测试的软件,但在我看来,确定如果单击按钮,然后触摸按钮上方 9 像素并最终运行手机活动会发生什么情况并不总是那么容易。 :) 这就是猴子测试的目的......
From my experience, monkey testing is really good for detecting flaws of the application in terms of:
I would say, that monkey testing does not stand in opposition to unit/instrumenation testing, but it is yet another way to test, that your application is working as intended.
Of course it also depends on the software is about to be tested, but in my opinion it is not always that easy to determine what happens if your button is clicked, then 9px above the button is touched and eventually a phone activity is run. :) That what monkey tests are for...