Monkeyrunner 与 Instrumentation - 功能测试哪个更好?

发布于 2024-11-29 23:29:03 字数 139 浏览 2 评论 0原文

我想为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

╰ゝ天使的微笑 2024-12-06 23:29:03

我喜欢使用 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.

从﹋此江山别 2024-12-06 23:29:03

根据我的经验,猴子测试非常适合检测应用程序在以下方面的缺陷:

  1. 内存泄漏:有时不可能跟踪产生过多内存使用的场景(例如基本的快速旋转、随后的按钮单击等)。
  2. Monkey 还可以帮助识别测试用例;对应用程序的意外、奇怪的使用最终会导致崩溃。
  3. 使用猴子测试,您还可以以某种方式测量应用程序在“重度”用户使用时的性能。

我想说,猴子测试并不反对单元/仪器测试,但它是测试您的应用程序是否按预期工作的另一种方法。

当然,这也取决于要测试的软件,但在我看来,确定如果单击按钮,然后触摸按钮上方 9 像素并最终运行手机活动会发生什么情况并不总是那么容易。 :) 这就是猴子测试的目的......

From my experience, monkey testing is really good for detecting flaws of the application in terms of:

  1. Memory leaks: sometimes it is impossible to track scenarios generating excessive memory usage (say basic fast rotation, subsequent button clicks etc.).
  2. Monkey also helps identifying test cases; unintended, strange uses of the applications that lead eventually to crashes.
  3. Using monkey tests you can also somehow mesure performance of the application, when used by "heavy" users.

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文