Introduction to the compatibility test suite for the official Android CTS document

Source: Internet
Author: User

Official English document Original: https://source.android.com/compatibility/cts-intro.html

Compatibility Test SuiteCompatibility test SuiteHow do does the CTS work?How does the CTS work?

Figure 1. How to use CTS

Figure 1. CTS usage Process

The CTS is a automated testing harness that includes, major software components:

The 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 (frame) run at your desk

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

    • Each test case is performed on an Android mobile device or emulator that is attached to a host on which the connection is mounted. Test cases are JUnit unit tests written in Java, and these tests are packaged cheer APK files to be executed on the real target machine.

(Heaven Zhuhai Branch Rudder Note: This architecture is very similar to the two UI Automation test frameworks of Monekeyrunner and Appium, and the code control side, which is the policy that directs test case execution, is implemented on the host side, When a target Android device such as an injection event is required, a command is sent to request the service running on the device for processing.
WorkflowWork Flow

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

This section provides an overview of how CTS testing is established. Please refer to the CTS user manual If you require detailed guidance documentation .

  1. Download the CTS and CTS media files. /download CTS compatibility test suite and CTS compatibility Test media file (Heaven Zhuhai Branch rudder Note: Because some compatibility API tests need to design the media playback function)

  2. Attach at least a device (or emulator) to your machine./ connect at least one Android device (or simulator) to your console (Heaven Zhuhai Branch Rudder Note: Note that it's not just a connection, Also make sure the SDK is properly installed, and 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 desired CTS version are between 2.1R2 and 4.2R4, follow these steps to configure the Run accessibility test on your target machine (or emulator) First:

    1. adb install-r android-cts/repository/ testcases/ctsdelegatingaccessibilityservice.apk
    2. on The device, enable Settings > Accessibility > Accessibility > Delegating accessibility Serv Ice/

  4. For CTS 2.3 R4 and beyond, set up your device to run the device administration tests:/ If your test device's Android version is 2.3 R4 and above, please follow Steps to run the Device Management test:

    1. adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk
    2. On the device, enable the both android.deviceadmin.cts.CtsDeviceAdminReceiver* device administrators under Settings > location & Security > Select Device A Dministrators/ android.deviceadmin.cts.ctsdevicereceiver* These two device managers in the following location on your device: Settings > Security and Privacy > Device Manager

      Note: Make sure the android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver stays disabled in the same menu./ Note : ensure that theandroid.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver是在关闭状态的。

  5. For CTS 2.3 R12 and beyond, the CTS media files must is 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 a device that is Android 2.3 R12 and above, the corresponding CT The S media test file must be copied to the device's external memory (SD card) above. Please see section 4.2 of the latest CTS manual for more information on this test:

      1. unzip the CTS Media zip file. / 

      2. run the following Command. If No resolution is specified, the default maximum resolution of 480x360 are assumed:/  run the following command. Note If you do not specify a resolution, you will assume that the highest default resolution of 480x360 is used:

        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:/ 

    • the test harness pushes an. apk file to each device, executes the test through instrumentation, and Rec Ords test Results. /  The test suite pushes an. apk file corresponding to the test onto 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. / 

  7. Once all the tests is 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 of the above tests have been completed, you can view the test results on your browser and use them to review your design correctly. You can verify your design by running the CTS continuously throughout your development process.

Types of test Casestest Case Type

The CTS includes the following types of test cases:

The CTS contains several test cases:

  • Unit tests test 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 Atomic unit granularity in the android. For example, test a class like Java.util.HashMap.

  • functional tests test a combination of APIs together in a higher-level use-case.

  • Functional testing: Test the combination of APIs on a higher-level test case

  • Reference Application tests instrument a complete sample application to exercise a full set of APIs and Android R Untime Services.

  • Apply a reference test: inject a instrumentation framework into a sample application to validate a complete set of APIs and the Android runtime service

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

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

    • Robustness tests test the durability of the system under stress.

    • Robustness test: Test the durability of the target system under certain pressure

    • Performance tests test the performance of the system against defined benchmarks, for example rendering frames per Second.

    • Performance testing: Test the performance of the system at a given benchmark point, such as testing the frame rendering rate of Android.

Areas CoveredCover Range

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

Unit test cases will cover the following scopes to guarantee compatibility

Area
range
Description
Describe
signature tests
signature test
for Each Android release, there is XML files describing the signatures of all public APIs conta Ined 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 is recorded in the test result XML file.
in each published version of Android, there is an XML file that describes the signature information for all the exposed APIs that are included. The
CTS contains a tool to check the API signatures that verify the release and the API signatures that are already on the target device. The test results for 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 documented in the S Dk class index to ensure API correctness, including correct Class, attribute and method signatures, correct meth OD behavior,
 and negative tests to ensure expected behavior for incorrect parameter handling.
The platform (Core library and Android application framework) APIs specified by class index in the Test SDK documentation, including test classes, the correctness of
Class member properties and method signatures, correctness of class member methods,
and a negative test to ensure that the processing when an input parameter error occurs is the expected
dalvik vm Tests
dalvik VM test
the tests focus on testing the Dalvik executable Format.
This test is focused on testing the Dalvik executable format
platform data Model
platform database models
the CTS tests the core platform data model as exposed to application developers through content providers, 
as documented in the Sdk android.provider package:contacts, browser, settings, etc.
This type of CTS test case tests the core data model that the platform exposes to the application developer through the content provider component,
These data models are in the SDK   The android.provider  package has a corresponding definition, such as: Contacts, browsers, settings, and so on.
platform Intents
platform Intents
the CTS tests the core platform intents, as documented in the sdk available intents.
This type of CTS test case tests the Intens components of the platform core, which are defined in the available intents of the SDK.
platform Permissions
platform permissions
the CTS tests the core platform permissions, as documented in the Sdk available permissions . The
This type of CTS test case tests the permissions control of the platform, which is defined in the SDK's available permissions.
Platform Resources
Platform Resources
The CTS tests for correct handling of the core platform resource types, as documented in the SDK Available
Resource Types. This includes tests for:simple values, Drawables, nine-patch, animations, layouts, styles
and themes, and loading alternate resources.
Such test cases test the correctness of the platform's core resource type processing,
These are defined in the available Resource types of the SDK.
The resource types for these test case tests include the following: simple value types,
Can depict resource type, Nine-patch resource type, animation resource type,
The layout type, the style resource type, and the subject resource type and the load on the optional resource.
(Heaven Zhuhai Branch Rudder: The translation of the latter sentence is not entirely certain, if there is a better translation version of the Please provide, first thanked)



Item

Description

Warning

Author

Heaven Zhuhai Branch Rudder

Reprint please specify the source!

More articles please check my blog!

Blog Address

Http://blog.csdn.net/zhubaitian


Introduction to the compatibility test suite for the official Android CTS document

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.