Mobile App测试时需要考虑的一些因素

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/seagal890/article/details/85083064

Mobile App测试时需要考虑的一些因素

1、设备选择

在开始Android应用程序测试过程之前,这是最关键的步骤之一。

  • 决定测试过程中要考虑哪些设备:使用模拟器还是使用真实的Mobile设备;
  • 选择是为了最大化目标客户的数量;
  • Android 操作系统版本、屏幕分辨率和表单因素 [Tablet 或 Smart Phone] 在选择阶段起着至关重要的作用;
  • 为了测试真实场景,物理设备是必须的。仿真器和物理设备都要以平衡的方式使用以获得优化的结果。

2、Android应用程序的Beta Testing及策略

  • Beta Testing 对于真实世界的用户、真实设备、实际网络和安装在广阔地理环境中的应用程序非常有效;
  • Beta Testing 清楚地说明了网络密度、网络变化 [Wi-Fi、4G、3G和2G] 以及对应用的影响。

在现实世界中的Beta测试就是其中之一,不能在受控环境中复制。

3、连接性(Connectivity)

  • 通常,Android应用程序连接到互联网中以满足各种需求;
  • 不同设备上的连接性在提出策略时起着关键作用;
  • 连接性主要由模拟器软件控制,该软件有助于在测试时调节网络速度、延迟和有限的连接;
  • 在真实数据网络连接下的测试对于实时结果/数据是及其有用的。

4、手工测试和自动化测试

  • 虽然自动化测试在第一次运行中需要大量的时间,但是当必须重复测试时,它就非常有用了。这也减少了在不同开发阶段进行测试的总时间跨度。
  • 当应用程序开发阶段的回归测试重复性很高时,Android Automation 应该支持手动测试,对于同一应用程序,必须在不同的 OS版本、向后兼容性检查点等上进行兼容性测试。

 

Android Application Testing Framework

1. Robotium

Robotium是一个Android测试自动化框架,它完全支持本地和混合应用程序。Robotium使得为Android应用程序编写强大而健壮的自动黑盒UI测试变得容易。在Robotium的支持下,测试用例开发者可以编写功能、系统和用户接受测试场景,跨越多个Android活动。

主要针对Android平台的应用进行黑盒自动化测试,它提供了模拟各种手势操作(点击、长按、滑动等)、查找和断言机制的API,能够对各种控件进行操作。

https://github.com/RobotiumTech/robotium

NEWS: Robotium 5.6.3 is released!

Robotium 5.6.3 is the fastest, most accurate and stable version of Robotium yet.

Robotium 的优点:

Robotium provides the following benefits:

  • Test Android apps, both native and hybrid.
  • Requires minimal knowledge of the application under test.
  • The framework handles multiple Android activities automatically.
  • Minimal time needed to write solid test cases.
  • Readability of test cases is greatly improved, compared to standard instrumentation tests.
  • Test cases are more robust due to the run-time binding to UI components.
  • Fast test case execution.
  • Integrates smoothly with Maven, Gradle or Ant to run tests as part of continuous integration.

2. Robolectric

这个框架有助于基于JUnit4框架在JVM上测试Android应用程序。它使用Android API。这有助于编写测试用例并在JVM上运行它们。

http://robolectric.org/blog/2018/10/25/robolectric-4-0/

Robolectric 4.0 brings support for the Android P (SDK 28) release, new and improved support and testing APIs for dozens of Android classes, initial support for some androidx-test APIs, and a complete rewrite of the resource handling code making it behave much more like a real Android device.

With the major version number bump to 4.0, we're making changes to some public APIs, detailed below. Check out the migration notes and use the new automated migration tool to help convert your existing tests to be compatible with Robolectric 4.0.

3. Appium Test Framework

这个框架适用于Android设备的本地、混合和移动网络应用。Appium可以免费使用实用程序。单个API既适用于Android也适用于iOS平台。这是支持跨平台测试的框架之一。它使用Selenium Web驱动程序与Android应用程序交互。AppIII支持使用很多编程语言编写脚本,如Java、C语言、Python、PHP、Ruby etc.

http://appium.io/

根据需要,Android应用程序自动化可以通过手动实现。但是,如果将Androind自动化测试添加到策略中,那么选择正确的工具是一项很大的任务。在选择自动化工具时,应考虑多平台支持、测试工作流程、工具价格、服务/支持等因素。

Android应用程序测试涉及几个挑战。在Android测试过程真正实现之前,需要考虑不同的因素,但是一旦完成,这将成为一个非常有趣的任务。

猜你喜欢

转载自blog.csdn.net/seagal890/article/details/85083064