blob: f1d2359a0d9a9d92f1a8b25464f3ab81affcbc01 [file] [log] [blame]
Dan Morrilla9788cd2009-11-15 11:49:30 -08001page.title=Compatibility Test Suite
Dan Morrill3cd199f2009-11-06 14:04:16 -08002doc.type=compatibility
3@jd:body
Dan Morrill3cd199f2009-11-06 14:04:16 -08004<h3>How does the CTS work?</h3>
5<div><img src="{@docRoot}images/cts-0.png"></div>
6<div>The CTS is an automated testing harness that includes two major software components:</div>
7<ul>
8<li>The CTS test harness runs on your desktop machine and manages test execution.</li>
Dan Morrill55de6812009-11-15 15:46:36 -08009<li>Individual test cases are executed on attached mobile devices or on an
10emulator. The test cases are written in Java as JUnit tests and packaged as
11Android .apk files to run on the actual device target.</li>
Dan Morrill3cd199f2009-11-06 14:04:16 -080012</ul>
13
14<h3>Workflow</h3>
15<ol>
Dan Morrill55de6812009-11-15 15:46:36 -080016<li>Obtain the CTS source code. The CTS is included in the Android source code available from the Android
17Open Source Project. (To get a copy of that source code, <a
18href="{@docRoot}source/download.html">read this page.</a></li>
Dan Morrill3cd199f2009-11-06 14:04:16 -080019<li>Attach at least one device (or emulator) to your machine.</li>
20<li>Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:
21 <ul>
22 <li>The test harness pushes a .apk file to each device, executes the test through instrumentation, and records test results.</li>
23 <li>The test harness removes the .apk file from each device.</li>
24 </ul>
25</li>
26<li>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.</li>
Dan Morrill3cd199f2009-11-06 14:04:16 -080027</ol>
28<div>When 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.</div>
29
30<h3>Types of test cases</h3>
31The CTS includes the following types of test cases:
32<ul>
33<li><i>Unit tests</i> test atomic units of code within the Android platform; e.g. a single class, such as java.util.HashMap.</li>
34<li><i>Functional tests</i> test a combination of APIs together in a higher-level use-case.</li>
35<li><i>Reference application tests</i> instrument a complete sample application to exercise a full set of APIs and Android runtime services</li>
36</ul>
37<div>Future versions of the CTS will include the following types of test cases:</div>
38<ul>
39<li><i>Robustness tests</i> test the durability of the system under stress.</li>
40<li><i>Performance tests</i> test the performance of the system against defined benchmarks, for example rendering frames per second.</li>
41</ul>
42
43<h3>Areas Covered</h3>
Dan Morrilla9788cd2009-11-15 11:49:30 -080044The unit test cases cover the following areas to ensure compatibility <br>
Dan Morrill3cd199f2009-11-06 14:04:16 -080045<table><tbody>
Dan Morrilla9788cd2009-11-15 11:49:30 -080046<tr><td>Area</td><td>Description <br></td></tr>
Dan Morrill3cd199f2009-11-06 14:04:16 -080047<tr><td>Signature tests</td>
48<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.
49</td>
50</tr>
51<tr><td>Platform API Tests</td>
Dan Morrilla9788cd2009-11-15 11:49:30 -080052<td>Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK <a href="http://code.google.com/android/reference/classes.html">Class Index</a>
Dan Morrill3cd199f2009-11-06 14:04:16 -080053to ensure API correctness:
54<ul>
55<li>correct class, attribute and method signatures</li>
56<li>correct method behavior</li>
57<li>negative tests to ensure expected behavior for incorrect parameter handling</li>
58</ul>
59</td></tr>
60<tr><td>Dalvik VM Tests</td><td>The tests focus on testing the Dalvik VM</td></tr>
61<tr><td>Platform Data Model</td>
Dan Morrilla9788cd2009-11-15 11:49:30 -080062<td>The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK <a href="http://code.google.com/android/reference/android/provider/package-summary.html">android.provider</a>
Dan Morrill3cd199f2009-11-06 14:04:16 -080063package:
64<ul>
65<li>contacts</li>
66<li>browser</li>
67<li>settings</li>
68<li>more...</li>
69</ul>
70</td></tr>
71<tr><td>Platform Intents</td>
Dan Morrilla9788cd2009-11-15 11:49:30 -080072<td>The CTS tests the core platform intents, as documented in the SDK <a href="http://code.google.com/android/reference/available-intents.html">Available Intents</a>.</td>
Dan Morrill3cd199f2009-11-06 14:04:16 -080073</tr>
74<tr><td>Platform Permissions</td>
Dan Morrilla9788cd2009-11-15 11:49:30 -080075<td>The CTS tests the core platform permissions, as documented in the SDK <a href="http://code.google.com/android/reference/android/Manifest.permission.html">Available Permissions</a>.</td>
Dan Morrill3cd199f2009-11-06 14:04:16 -080076</tr>
Dan Morrilla9788cd2009-11-15 11:49:30 -080077<tr><td>Platform Resources <br></td>
78<td>The CTS tests for correct handling of the core platform resource types, as documented in the SDK <a href="http://code.google.com/android/reference/available-resources.html">Available Resource Types</a>
Dan Morrill3cd199f2009-11-06 14:04:16 -080079. This includes tests for:
80<ul>
81<li>simple values</li>
82<li>drawables</li>
83<li>nine-patch</li>
84<li>animations</li>
85<li>layouts</li>
86<li>styles and themes</li>
87<li>loading alternate resources</li>
88</ul></td></tr>
89</tbody></table>