The Android test Framework (Android testing framework) is an integral part of the Android development environment and can be used to test all aspects of Android, from unit testing to framework testing to UI testing.
Its main functions are:
The Android test framework is based on JUnit, so you can use JUnit directly to test some classes that are not very relevant to the Android platform, or use the Android Juint extension to test the Android component, if you're just starting to touch the Android test, You can write generic test cases from androidtestcase before you write more complex test cases.
The android Juint extension provides test support for Android-specific components, such as Activity,service, which provide a number of helper methods to help create the "pile" class or method used by the test.
The test package that was created contains a test package in which the test package and the main application package have a similar structure, and the steps to create the test package are basically similar to the methods used to create the Android application.
Eclipse's ADT contains the SDK tools to create test cases and provides command-line tools for integrating with other Ides. These tools can read the required information from the application package being tested to create a build file for the test project, mainfest the file and file directory structure, and so on.
The SDK also provides a moneyrunner (a Python application) that simulates user key events to test the UI.
The following figure is a summary of the Android test framework:
See a full set of tutorials: http://www.bianceng.cn/OS/extra/201301/35252.htm