blob: 842a58341494b62fb4370ccddf9678de65d1c71b [file] [log] [blame] [view]
Skyler Kaufman44436912011-04-07 15:11:52 -07001<!--
2 Copyright 2010 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070017# Compatibility Test Suite #
18
19## How does the CTS work? ##
20
21<div style="float: right">
22 <img src="/images/cts-0.png">
23</div>
24
25The CTS is an automated testing harness that includes two major software components:
26
27- The CTS test harness runs on your desktop machine and manages test execution.
28
29- Individual test cases are executed on attached mobile devices or on an
30emulator. The test cases are written in Java as JUnit tests and packaged as
31Android .apk files to run on the actual device target.
32
33## Workflow ##
34
Keun young Park0fc4d1d2012-02-02 13:55:00 -0800351. [Download](downloads.html) the CTS and CTS media files.
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070036
371. Attach at least one device (or emulator) to your machine.
38
391. For CTS 2.1 R2 and beyond, setup your device (or emulator) to run the accessibility tests:
40
Brian Muramatsu3cda8a62011-07-01 11:52:15 -070041 2. adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070042
Brian Muramatsu3cda8a62011-07-01 11:52:15 -070043 2. On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service
44
451. For CTS 2.3 R4 and beyond, setup your device to run the device administration tests:
46
47 2. adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk
48
49 2. On the device, enable all the android.deviceadmin.cts.* device administrators under Settings > Location & security > Select device administrators
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070050
Keun young Park26d7fd02012-02-03 13:10:10 -0800511. 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:
Keun young Park0fc4d1d2012-02-02 13:55:00 -080052
Keun young Park26d7fd02012-02-03 13:10:10 -080053 2. Unzip the CTS Media zip file.
Keun young Park0fc4d1d2012-02-02 13:55:00 -080054
Keun young Park26d7fd02012-02-03 13:10:10 -080055 2. Run copy_media.sh [720x480|1280x720|1920x1080|all] [-s serial]. If no resolution is specified, the default maximum resolution of 480x360 is assumed.
Keun young Park0fc4d1d2012-02-02 13:55:00 -080056
Skyler Kaufman991ae4d2011-04-07 12:30:41 -0700571. Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:
58
59 - The test harness pushes a .apk file to each device, executes the test through instrumentation, and records test results.
60
61 - The test harness removes the .apk file from each device.
62
631. Once all the tests are executed, you can view the test results in your browser and use the results to adjust your design. You can continue to run the CTS throughout your development process.
64
65When you are ready, you can submit the report generated by the CTS to cts@android.com. The report is a .zip archived file that contains XML results and supplemental information such as screen captures.
66
67## Types of test cases ##
68
69The CTS includes the following types of test cases:
70
71- *Unit tests* test atomic units of code within the Android platform; e.g. a single class, such as java.util.HashMap.
72
73- *Functional tests* test a combination of APIs together in a higher-level use-case.
74
75- *Reference application tests* instrument a complete sample application to exercise a full set of APIs and Android runtime services
76
77Future versions of the CTS will include the following types of test cases:
78
79- *Robustness tests* test the durability of the system under stress.
80
81- *Performance tests* test the performance of the system against defined benchmarks, for example rendering frames per second.
82
83## Areas Covered ##
84
85The unit test cases cover the following areas to ensure compatibility:
86
87Area | Description
88-----|-------------
89Signature tests | 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.
Jean-Baptiste Queru60c81412012-04-19 15:00:44 -070090Platform API Tests | Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK [Class Index](https://developer.android.com/reference/classes.html) 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.
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070091Dalvik VM Tests | The tests focus on testing the Dalvik VM
Jean-Baptiste Queru60c81412012-04-19 15:00:44 -070092Platform Data Model | The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK [android.provider](https://developer.android.com/reference/android/provider/package-summary.html) package: contacts, browser, settings, etc.
93Platform Intents | The CTS tests the core platform intents, as documented in the SDK [Available Intents](https://developer.android.com/guide/appendix/g-app-intents.html).
94Platform Permissions | The CTS tests the core platform permissions, as documented in the SDK [Available Permissions](https://developer.android.com/reference/android/Manifest.permission.html).
95Platform Resources | The CTS tests for correct handling of the core platform resource types, as documented in the SDK [Available Resource Types](https://developer.android.com/guide/topics/resources/available-resources.html). This includes tests for: simple values, drawables, nine-patch, animations, layouts, styles and themes, and loading alternate resources.
Skyler Kaufman991ae4d2011-04-07 12:30:41 -070096