page.title=Compatibility Test Suite
doc.type=compatibility
@jd:body
<h3>How does the CTS work?</h3>
<div><img src="{@docRoot}images/cts-0.png"></div>
<div>The CTS is an automated testing harness that includes two major software components:</div>
<ul>
<li>The CTS test harness runs on your desktop machine and manages test execution.</li>
<li>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.</li>
</ul>

<h3>Workflow</h3>
<ol>
<li><a href="{@docRoot}compatibility/downloads.html">Download</a> the CTS.
<li>Attach at least one device (or emulator) to your machine.</li>
<li>For CTS 2.1 R2 and beyond, setup your device (or emulator) to run the accessibility tests:
    <ol>
        <li>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</li>
        <li>On the device, enable Settings &gt; Accessibility &gt; Accessibility &gt; Delegating Accessibility Service</li>
    </ol>
</li>
<li>Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:
    <ul>
    <li>The test harness pushes a .apk file to each device, executes the test through instrumentation, and records test results.</li>
    <li>The test harness removes the .apk file from each device.</li>
    </ul>
</li>
<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>
</ol>
<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>

<h3>Types of test cases</h3>
The CTS includes the following types of test cases:
<ul>
<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>
<li><i>Functional tests</i> test a combination of APIs together in a higher-level use-case.</li>
<li><i>Reference application tests</i> instrument a complete sample application to exercise a full set of APIs and Android runtime services</li>
</ul>
<div>Future versions of the CTS will include the following types of test cases:</div>
<ul>
<li><i>Robustness tests</i> test the durability of the system under stress.</li>
<li><i>Performance tests</i> test the performance of the system against defined benchmarks, for example rendering frames per second.</li>
</ul>

<h3>Areas Covered</h3>
The unit test cases cover the following areas to ensure compatibility <br>
<table><tbody>
<tr><td>Area</td><td>Description <br></td></tr>
<tr><td>Signature tests</td>
<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>
</tr>
<tr><td>Platform API Tests</td>
<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>
to ensure API correctness:
<ul>
<li>correct class, attribute and method signatures</li>
<li>correct method behavior</li>
<li>negative tests to ensure expected behavior for incorrect parameter handling</li>
</ul>
</td></tr>
<tr><td>Dalvik VM Tests</td><td>The tests focus on testing the Dalvik VM</td></tr>
<tr><td>Platform Data Model</td>
<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>
package:
<ul>
<li>contacts</li>
<li>browser</li>
<li>settings</li>
<li>more...</li>
</ul>
</td></tr>
<tr><td>Platform Intents</td>
<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>
</tr>
<tr><td>Platform Permissions</td>
<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>
</tr>
<tr><td>Platform Resources <br></td>
<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>
. This includes tests for:
<ul>
<li>simple values</li>
<li>drawables</li>
<li>nine-patch</li>
<li>animations</li>
<li>layouts</li>
<li>styles and themes</li>
<li>loading alternate resources</li>
</ul></td></tr>
</tbody></table>
