Mobile Testing 简明教程
Mobile Testing - Emulator Vs Simulator
在移动测试中有一点是不言自明的。要执行移动测试,你需要一个移动设备。这是为了了解我们的产品如何在给定的移动设备上运行和呈现。
One thing is self-explanatory in case of mobile testing. To perform mobile testing, you need a mobile device. This is to access that how our product will work and look like on a given mobile set.
假设我们要为机票预订系统开发一个应用程序。一旦产品完全开发出来,作为移动测试的一部分,我们需要检查应用程序能否在所有主要使用的设备(如 Android 手机、iOS、Blackberry 手机和其他不同类型的平板电脑和 iPad)上按预期工作。
Suppose we are developing an application for flight ticket booking system. Once the product is entirely developed, as a part of mobile testing, we need to check if the application is working as expected with all the majorly used devices like Android phones, iOS, Blackberry phones, and other different types of tablets and iPads.
为了执行这种检查,我们需要获取每一款此类设备,然后我们可以检查应用程序是否按照期望的那样执行。是的,你猜对了,作为一个产品所有者,肯定会觉得购买如此大量的移动设备并进行测试非常昂贵。那么是否有任何可行的智能替代方案?
To do this kind of check, we need to acquire each such device and then we can check if the application behaves as per expectation. Yes you thought right, as a product owner one will defiantly find this very expensive to procure such a large number of mobile devices and carry out testing. So is there any smart alternate available?
这个问题的解决方案是使用移动模拟器和移动仿真器。这些主要是软件程序,旨在为智能手机的重要功能提供模拟。它们在本质上非常相似,因此有时它们可以互换使用。
The solution to this problem is to use Mobile Simulators and Mobile Emulators. These are primarily software programs designed to provide simulation for important features of a smartphone. They are very similar in nature, so sometimes, they are used interchangeably.
让我们比较一下在仿真器/模拟器上测试与在真实设备上测试有何不同 −
Let’s compare how testing on an Emulator/Simulator is different from testing on a real device −
Real Device |
Emulator / Simulator |
|
Price |
Getting real devices will cost you a lot. |
It is almost free, we just need to download and install them |
Processing Speed |
It has faster processing; however network latency may be normal. |
It is slower as compared to actual devices. It has observed less latency than real devices connected to the local network or in the cloud. |
Debugging |
Debugging is not that easy. |
It provides step-by-step debugging of an application. Also, it provides an efficient way for capturing screenshots. |
Web-app Testing |
Web applications can be tested in a normal way. |
Testing a web application is much easier. |
Reliability |
Testing on a real device has a major advantage that it always gives accurate results. |
It cannot simulate all types of user interactions; hence it may lead to false results sometimes. So it scores low when it comes to reliability. |
模拟器/仿真器无法模拟以下功能 −
A simulator/emulator cannot mimic the following features −
-
Mobile device battery
-
Mobile device’s camera
-
Difficult to mimic interruptions like incoming calls and SMS.
-
Not so much realistic simulation for mobile device memory usage.
接下来我们深入了解移动模拟器和移动仿真器。两者之间存在着特定的差异。下表列出了模拟器和仿真器之间的主要区别。
Let us now understand more about mobile simulators and mobile emulators. There are specific differences between the two. The following table lists the major difference between a simulator and an emulator.
Emulator |
Simulator |
|
What it mimics |
Mobile device software Mobile device hardware Mobile operating system |
Internal behavior of the device. It does not mimic hardware. |
How to get it |
It is generally provided by the device manufacturer. |
It is generally provided by the device manufacturer or some other company. |
Internal structure |
It is written in machine-level assembly language. |
It is written in high-level language. |
Debugging |
It is more suitable for debugging. |
It is not suitable for debugging purpose. |
Performance |
Emulators are really slow. Emulating the actual hardware usually makes the software run slower than it would natively. |
Faster than emulators. |
Example |
Google’s Android SDK |
Apple’s iOS Simulator |
那么,移动测试的最佳选择是什么?最佳实践表明,在实际开发过程中,我们应该使用仿真器或模拟器。在完成产品之前,应该使用选定的真实设备进行健全性检查。例如,Android 智能手机用户数量庞大,因此明智的选择是对最新的 Android 设备进行健全性检查,并且可以在模拟器上进行回归测试。
So, what is the best choice for mobile testing? Best practice indicates that, while actual development is in progress, we should use an emulator or a simulator. Before finalizing the product, there should be a sanity check with chosen real devices. For example, there is a huge number of Android smartphone users, so the smart choice is to have a sanity check for the latest Android device and regression can be conducted over simulators.