Best testing practices

There are many standards used in the Android game development industry for testing. Testing ensures correctness, stability, functional behavior, and durability after an application is published. The most common approach for Android game testing is manual testing.

However, this process is definitely not the best. As an Android developer, a unit test is always a best practice to save time and get accurate test results.

Tools and APIs

There are several tools and Android APIs that can be used to carry out the testing procedure. Some of them are inbuilt, such as Android Test Support Library, Dumpsys, Monkeyrunner, and so on.

Most of these testing tools can be triggered through the command line and run through Android Debug Bridge.

The Monkey tools create a virtual environment to populate user actions such as click, touch, swipe and so on to determine real-time result. Monkey can be run with the following command:

adb shell monkey –p <Game Package Name> <Event Count>

Dumpsys provides status of the system during the runtime of an Android application. This can be triggered through the following command:

adb shell dumpsys <option>

Dumpsys is able to provide information on running services, input system, network status, RAM uses, and more.

Testing techniques

Mostly, two types of testing techniques are used in the game industry: automated testing and manual testing. We have already discussed the manual testing procedure in brief. Let's have a look at automated testing.

Automated testing requires tools and extra programming effort. Game UI, memory consumption, network connectivity, and input system testing can be automated. A separate test runs on a simulator or on an actual device to determine the test result, and it is saved at a given location of the development system.

Unit test code can be written to verify the logic of an individual module of a game. A unit test can be used for testing the smallest possible component of the application program, such as elements, classes, and methods. Unit tests are further categorized into two stages:

  • Local test
  • Instrumented test

Local test

This type of unit test works on a local machine and runs on the JVM. This saves a lot of testing time. A local test has either no dependency on the Android framework or limited dependency that can be satisfied with dummy objects.

Instrumented test

Instrumented tests have full dependency on the Android framework and must run on an Android emulator or on an Android device. This testing technique is used to test the runtime behavior of an Android game. It can provide all system and debug information of the running application. However, this technique cannot be used easily with dummy objects. The developer needs to define the testing object data before it can run the test in an Android environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.159.178