Compatibility Test Suite overview in the official documentation of Android CTS, Android cts

Source: Internet
Author: User

Compatibility Test Suite overview in the official documentation of Android CTS, Android cts

Https://source.android.com/compatibility/cts-intro.html

Compatibility Test Suite How does the CTS work? How does CTS work?

Figure 1. How to use CTS

Figure 1. CTS usage process

The CTS is an automatic testing harness that includes des two major software components:

CTS is an automated test suite that consists of two software components:

  • The CTS test harness runs on your desktop machine and manages test execution.

  • CTS Test Suite (framework) runs on your desktop to manage test execution

  • Individual test cases are executed on attached mobile devices or on an emulator. The test cases are written in Java as JUnit tests and packaged as Android. apk files to run on the actual device target.

  • Each test case is executed on an Android mobile device or simulator attached to the host. The test cases are all JUnit unit tests compiled by Java, and these test cases will be packaged into an excellent .apk file for execution on the real target machine.

(Tiandi Zhuhai sub-pilot note: this architecture is very similar to the MonekeyRunner and Appium UI automated testing frameworks. The code control side, that is, the policies that guide the execution of test cases, are implemented on the host side, when the target Android device needs to be operated, such as an injection event, a command request will be sent to the Service Running on the device for processing)
Workflow

This section summarizes CTS setup. Please refer to the CTS User Manual for detailed instructions.

This section provides an overview of how to create a CTS test. For detailed guidance documents, see the CTS user manual.

  1. Download the CTS and CTS media files./Download the CTS compatibility test suite and CTS compatibility test media files (Tiandi Zhuhai sub-pilot Note: Due to some compatibility API tests, the media playback function needs to be designed)

  2. Attach at least one device (or emulator) to your machine. /connect at least one Android device (or simulator) to your host (Tiandi will be at the helm of Zhuhai). Note: ensure that the SDK is not only correctly installed, you can use adb to operate the device)

  3. For CTS versions 2.1 R2 through 4.2 R4, set up your device (or emulator) to run the accessibility tests: /if your target machine version and the required CTS version are 2.1R2 to 4.2R4, follow the steps below to first install the target machine (or simulator) configure the run auxiliary function test on:

    1. adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
    2. On the device, enable Settings> Accessibility> Delegating Accessibility Service/start the configuration item in the following locations On the target device: Settings> auxiliary functions> Delegating Accessibility Service.

  4. For CTS 2.3 R4 and beyond, set up your device to run the device administration tests:/If the Android version of your test device is 2.3 R4 or later, follow these steps to run the device management test:

    1. adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk
    2. On the device, enable the twoandroid.deviceadmin.cts.CtsDeviceAdminReceiver*Device administrators under Settings> Location & security> Select device administrators/enable android at the following locations on your device. deviceadmin. cts. ctsDeviceReceiver * The two device managers: Settings> Security and Privacy> Device Manager

      Note: Make sureandroid.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiverStays disabled in the same menu ./Note:: Make sure thatAndroid. deviceadmin. cts. CtsDeviceAdminDeactivatedReceiver is disabled.

  5. For CTS 2.3 R12 and beyond, the CTS media files must be copied to the device's external storage. check section 4.2 of the latest CTS manual for further details on copying these files:/if you are using Android 2.3 R12 or a later version, the corresponding CTS media test file must be copied to the device's external storage (SD card. For more information about the exam, see section 4.2 of the recent CTS manual:

    1. Unzip the CTS Media zip file./unpack the CTS test Media file.

    2. Run the following command. If no resolution is specified, the default maximum resolution of 480x360 is assumed:/Run the following command. Note that if no resolution is specified, the maximum default resolution is 480x360:

      copy_media.sh [720x480|1280x720|1920x1080|all] [-s serial]
  6. Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:/run the CTS. The CTS test suite loads the test plan to all mounted test devices. For each test on the test suite:

    • The test harness pushes. apk file to each device, executes the test through instrumentation, and records test results. /The test kit pushes the corresponding. APK file of the test to the target test device, runs the test through the instrumentation framework, and records the test results.

    • The test harness removes the. apk file from each device./The test kit will be deleted from each test device.

  7. Once all the tests are executed, view the test results in your browser and use them to adjust your design. you can continue to run the CTS throughout your development process. /once all the tests are completed, you can view the corresponding test results in your browser and use them to check whether your design is correct. You can run CTS continuously throughout your development process to verify your design.

Types of test cases test Case Type

The CTS primary des the following types of test cases:

CTS includes the following test cases:

  • Unit testsTest atomic units of code within the Android platform; e.g. a single class, such as java. util. HashMap.

  • Unit test: tests the code of the original Sub-Unit Granularity on the Android platform. For example, test a class such as java. util. HashMap.

  • Functional testsTest a combination of APIs together in a higher-level use-case.

  • Function Test: test the combination of APIs in a higher level test case.

  • Reference application testsInstrument a complete sample application to exercise a full set of APIs and Android runtime services.

  • Application reference test: inject the instrumentation framework into a sample application to verify a complete set of APIs and excellent runtime services

Future versions of the CTS will include the following types of test cases:

Future CTS versions will include the following types of test cases:

  • Robustness testsTest the durability of the system under stress.

  • Robustness testing: Testing the durability of the target system under certain pressure

  • Performance testsTest the performance of the system against defined benchmarks, for example rendering frames per second.

  • Performance testing: tests the system's performance under a given benchmark, such as testing the frame rendering rate of Android.

Areas Covered coverage

The unit test cases cover the following areas to ensure compatibility:

Unit test cases cover the following areas to ensure compatibility

Area
Range
Description
Description
Signature tests
Signature Test
For each Android release, there are XML files describing the signatures of all public APIs contained in the release.
The CTS contains a utility to check those API signatures against the APIs available on the device. The results from
Signature checking are recorded in the test result XML file.
Each released Android version contains an XML file to describe the signature information of all public APIs.
CTS contains a tool to check and verify the API signature of the released version and the existing API signature on the target device.
The test results of the signature test are recorded in the test report document in xml format.
Platform API Tests
Platform API Test
Test the platform (core libraries and Android Application Framework) APIs as your ented in the SDK Class Index to ensure API correctness, including correct class, attribute and method signatures, correct method behavior,
And negative tests to ensure expected behavior for incorrect parameter handling.
Test the APIs of the Platform (core library and Android Application Framework) specified by Class Index in the SDK documentation, including the test Class,
The class member attributes and method signature are correct, and the class member methods are correct,
And the negative test is used to ensure that the processing of input parameter errors is as expected.
Dalvik VM Tests
Dalvik VM Test
The tests focus on testing the Dalvik Executable Format.
This test focuses on the Dalvik executable format test.
Platform Data Model
Platform Data Model
The CTS tests the core platform data model as exposed to application developers through content providers,
As incluented in the SDK android. provider package: contacts, browser, settings, etc.
This type of CTS test case test is the core data model that the platform exposes to application developers through the Content Provider component,
These data models are defined in the SDK android. provider package, such as contacts, browsers, settings, and so on.
Platform Intents
Platform Intents
The CTS tests the core platform intents, as your ented in the SDK Available Intents.
This type of CTS test case test is the Intens component at the platform's core, which is defined in the Available Intents of the SDK.
Platform Permissions
Platform Permissions
The CTS tests the core platform permissions, as supported ented in the SDK Available Permissions.
This type of CTS test cases test platform permission control, which is defined in SDK Available Permissions.
Platform Resources
Platform Resources
The CTS tests for correct handling of the core platform resource types, as supported ented in the SDK Available
Resource Types. This includes des tests for: simple values, drawables, nine-patch, animations, layouts, styles
And themes, and loading alternate resources.
These test cases test the correctness of the processing of the platform's core resource types,
These are defined in the Available Resource Types of the SDK.
The resource types of these test cases include: simple value types,
It can depict the resource type, nine-patch resource type, and animation resource type,
Layout type, style resource type, topic resource type, and loading of optional resources.
(Tiandi Zhuhai sub-Rudder: the translation of the last sentence cannot be completely determined. If there is a better translation version, please provide it. thank you first)



Item

Description

Warning

Author

Tiandihui Zhuhai sub-Rudder

Reprinted please indicate the source!

For more exciting articles, refer to my blog!

Blog Address

Http://blog.csdn.net/zhubaitian


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.