blob: f78e115ed167db51f6eab7ebd5d289c8ee77de8c [file] [log] [blame]
Robert Ly35f2fda2013-01-29 16:27:05 -08001page.title=Compatibility Test Suite
2@jd:body
3
4<!--
Clay Murphy768b82a2013-11-12 11:32:41 -08005 Copyright 2013 The Android Open Source Project
Robert Ly35f2fda2013-01-29 16:27:05 -08006
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18-->
19
20<h2 id="how-does-the-cts-work">How does the CTS work?</h2>
21<div style="float: right">
Clay Murphya69844e2013-05-30 17:56:38 -070022 <img src="{@docRoot}images/cts-0.png">
Robert Ly35f2fda2013-01-29 16:27:05 -080023</div>
24
25<p>The CTS is an automated testing harness that includes two major software components:</p>
26<ul>
27<li>
28<p>The CTS test harness runs on your desktop machine and manages test execution.</p>
29</li>
30<li>
31<p>Individual test cases are executed on attached mobile devices or on an
32emulator. The test cases are written in Java as JUnit tests and packaged as
33Android .apk files to run on the actual device target.</p>
34</li>
35</ul>
36<h2 id="workflow">Workflow</h2>
37<ol>
38<li>
39<p><a href="downloads.html">Download</a> the CTS and CTS media files.</p>
40</li>
41<li>
42<p>Attach at least one device (or emulator) to your machine.</p>
43</li>
44<li>
Clay Murphyea9a7962013-10-08 16:56:55 -070045<p>For CTS versions 2.1 R2 through 4.2 R4, set up your device (or emulator) to run the accessibility tests:</p>
Robert Ly35f2fda2013-01-29 16:27:05 -080046<ol>
47<li>
48<p>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</p>
49</li>
50<li>
51<p>On the device, enable Settings &gt; Accessibility &gt; Accessibility &gt; Delegating Accessibility Service</p>
52</li>
53</ol>
54</li>
55<li>
Clay Murphy0a920542013-09-13 13:39:33 -070056<p>For CTS 2.3 R4 and beyond, set up your device to run the device administration tests:</p>
Robert Ly35f2fda2013-01-29 16:27:05 -080057<ol>
58<li>
59<p>adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk</p>
60</li>
61<li>
Clay Murphy0a920542013-09-13 13:39:33 -070062<p>On the device, enable the two android.deviceadmin.cts.CtsDeviceAdminReceiver* device administrators under Settings &gt; Location &amp; security &gt; Select device administrators</p>
Robert Ly35f2fda2013-01-29 16:27:05 -080063</li>
64</ol>
65</li>
66<li>
67<p>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:</p>
68<ol>
69<li>
70<p>Unzip the CTS Media zip file.</p>
71</li>
72<li>
73<p>Run copy_media.sh [720x480|1280x720|1920x1080|all] [-s serial]. If no resolution is specified, the default maximum resolution of 480x360 is assumed.</p>
74</li>
75</ol>
76</li>
77<li>
78<p>Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:</p>
79<ul>
80<li>
81<p>The test harness pushes a .apk file to each device, executes the test through instrumentation, and records test results.</p>
82</li>
83<li>
84<p>The test harness removes the .apk file from each device.</p>
85</li>
86</ul>
87</li>
88<li>
89<p>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.</p>
90</li>
91</ol>
Robert Ly35f2fda2013-01-29 16:27:05 -080092<h2 id="types-of-test-cases">Types of test cases</h2>
93<p>The CTS includes the following types of test cases:</p>
94<ul>
95<li>
96<p><em>Unit tests</em> test atomic units of code within the Android platform; e.g. a single class, such as java.util.HashMap.</p>
97</li>
98<li>
99<p><em>Functional tests</em> test a combination of APIs together in a higher-level use-case.</p>
100</li>
101<li>
102<p><em>Reference application tests</em> instrument a complete sample application to exercise a full set of APIs and Android runtime services</p>
103</li>
104</ul>
105<p>Future versions of the CTS will include the following types of test cases:</p>
106<ul>
107<li>
108<p><em>Robustness tests</em> test the durability of the system under stress.</p>
109</li>
110<li>
111<p><em>Performance tests</em> test the performance of the system against defined benchmarks, for example rendering frames per second.</p>
112</li>
113</ul>
114<h2 id="areas-covered">Areas Covered</h2>
115<p>The unit test cases cover the following areas to ensure compatibility:</p>
116<table>
117<thead>
118<tr>
119<th>Area</th>
120<th>Description</th>
121</tr>
122</thead>
123<tbody>
124<tr>
125<td>Signature tests</td>
126<td>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.</td>
127</tr>
128<tr>
129<td>Platform API Tests</td>
130<td>Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK <a href="https://developer.android.com/reference/classes.html">Class Index</a> 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.</td>
131</tr>
132<tr>
133<td>Dalvik VM Tests</td>
134<td>The tests focus on testing the Dalvik VM</td>
135</tr>
136<tr>
137<td>Platform Data Model</td>
138<td>The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK <a href="https://developer.android.com/reference/android/provider/package-summary.html">android.provider</a> package: contacts, browser, settings, etc.</td>
139</tr>
140<tr>
141<td>Platform Intents</td>
142<td>The CTS tests the core platform intents, as documented in the SDK <a href="https://developer.android.com/guide/appendix/g-app-intents.html">Available Intents</a>.</td>
143</tr>
144<tr>
145<td>Platform Permissions</td>
146<td>The CTS tests the core platform permissions, as documented in the SDK <a href="https://developer.android.com/reference/android/Manifest.permission.html">Available Permissions</a>.</td>
147</tr>
148<tr>
149<td>Platform Resources</td>
150<td>The CTS tests for correct handling of the core platform resource types, as documented in the SDK <a href="https://developer.android.com/guide/topics/resources/available-resources.html">Available Resource Types</a>. This includes tests for: simple values, drawables, nine-patch, animations, layouts, styles and themes, and loading alternate resources.</td>
151</tr>
152</tbody>
153</table>