A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release anziché aosp-main per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Compatibility Test Suite (CTS) è una suite di test e strumenti di livello commerciale senza costi utilizzati per garantire che i tuoi dispositivi siano compatibili con Android. CTS è pensato per essere integrato nel tuo flusso di lavoro quotidiano, ad esempio tramite un sistema di compilazione continua. CTS viene eseguito su un computer esegue i test direttamente sui dispositivi collegati o su un emulatore. Per una panoramica della compatibilità con Android, consulta la panoramica del Programma di compatibilità Android.
Figura 1. Test automatici CTS.
La Figura 1 mostra la procedura di esecuzione dei test automatici CTS:
Scarica e installa CTS. Questo passaggio prevede anche la configurazione dell'ambiente di test, della stazione di lavoro di test e del dispositivo in test o device under test (DUT).
Esegui i test automatici CTS.
Memorizza ed esamina i risultati.
Risolvi i problemi e esegui di nuovo i test.
Utilizza CTS per rilevare in anticipo le incompatibilità e assicurarti che le implementazioni di Android rimangano compatibili durante tutto il processo di sviluppo.
Componenti CTS
CTS contiene i seguenti componenti principali:
Federazione commerciale
Un framework e un harness di test consentono l'esecuzione automatica dei test.
Test automatici CTS
Test che utilizzano il framework Trade Federation e possono essere eseguiti utilizzando l'ambiente di test Trade Federation.
Test di CTS Verifier (CTS-V)
Test che devono essere eseguiti manualmente.
App CTS Verifier (CTS-V)
Un'app utilizzata per eseguire i test CTS-V e raccogliere i risultati dei test CTS-V.
Scenario di test
Un singolo test eseguito sul DUT. Gli scenari di test automatici vengonoscritti in Java come test JUnit e pacchettizzati in file APK Android da eseguire sul
dispositivo di destinazione.
I casi di test possono essere test di unità o test funzionali. Un test di unità testa unità di codice atomiche all'interno della piattaforma Android. Ad esempio, un test di unità potrebbe testare
una singola classe Android.
Un test funzionale esegue una combinazione di metodi e classi utilizzati per un caso d'uso specifico.
Configurazione del test
Un insieme specifico di test automatici eseguiti sul
DUT. Le configurazioni di test sono file XML che si trovano in
WORKING_DIRECTORY/cts/tools/cts-tradefed/res/config.
Esistono configurazioni di test che contengono tutti gli scenari di test automatici e configurazioni di test che contengono un sottoinsieme di scenari di test.
Modulo di test
Una configurazione di test composta da una raccolta di casi di test per la stessa area di funzionalità.
Piano di test
Una configurazione di test composta da una raccolta di moduli di test.
Copertura test
Gli scenari di test coprono le seguenti aree per garantire la compatibilità:
Area
Descrizione
Test di firma
Per ogni release di Android sono disponibili file XML che descrivono le firme di tutte le API pubbliche contenute nella release. Il CTS contiene un'utilità per verificare le firme delle API rispetto alle API disponibili sul dispositivo. I risultati del controllo della firma vengono registrati nel file XML del risultato del test.
Test dell'API Platform
Testa le API della piattaforma (librerie di base e Android Application Framework) come descritto
nel Class Index dell'SDK per verificarne la correttezza, incluse le firme di classi, attributi e metodi corretti, il comportamento corretto dei metodi e i test negativi per verificare il comportamento previsto per la gestione dei parametri non corretti.
Test Dalvik
I test si concentrano sul formato eseguibile Dalvik.
Modello di dati della piattaforma
Il CTS testa il modello di dati della piattaforma di base come esposto agli sviluppatori di applicazioni tramite i fornitori di contenuti, come documentato nel pacchetto SDK android.provider (inclusi contatti, browser e impostazioni)
Intent della piattaforma
Il CTS testa gli intent della piattaforma di base, come descritto nella sezione
Intent comuni dell'SDK.
Autorizzazioni della piattaforma
Il CTS testa le autorizzazioni di base della piattaforma, come descritto nell'SDK Manifest.permission.
Risorse della piattaforma
Il CTS verifica la gestione corretta dei tipi di risorse della piattaforma di base, come documentato nella
panoramica dei tipi di risorse dell'SDK. I test CTS includono test per valori semplici, drawable, nine-patch, animazioni, layout, stili e temi e caricamento di risorse alternative.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# The Compatibility Test Suite (CTS) overview\n\n*Compatibility Test Suite (CTS)* is a free, commercial-grade test suite and\ntools used to help ensure that your devices are Android compatible. CTS is\nintended to be integrated into your daily workflow, such as through a\ncontinuous build system. CTS runs on a desktop machine and executes tests\ndirectly on attached devices or on an emulator. For an overview of Android compatibility, see [Android compatibility program overview](/docs/compatibility).\n\n**Figure 1.** CTS automated testing.\n\nFigure 1 shows the process of executing CTS automated tests:\n\n1. Download and install CTS. This step also involves setting up the test environment, the testing workstation, and the device you are testing or *device under test (DUT)*\n2. Run CTS automated tests.\n3. Store and review the results.\n4. Troubleshoot issues and rerun tests.\n\nUse CTS to reveal incompatibilities early, and to ensure that your Android\nimplementations remain compatible throughout the development process.\n\nCTS components\n--------------\n\nCTS contains the following major components:\n\n*Trade Federation*\n: A test harness and framework allow for the automated execution of tests.\n\n*CTS automated tests*\n: Tests that use the Trade Federation framework and can be run using the Trade\n Federation test harness.\n\n*CTS Verifier (CTS-V) tests*\n: Tests that must be run manually.\n\n*CTS Verifier (CTS-V) app*\n: An app used to conduct CTS-V tests and collect CTS-V test results.\n\n*Test case*\n\n: An individual test executed on the DUT. Automated test cases are\n written in Java as JUnit tests and packaged Android APK files to run on the\n device target.\n\n Test cases can be *unit tests* or *functional tests*. A unit test tests atomic\n units of code within the Android platform. For example, a unit test might test\n a single Android class.\n\n A functional test exercises a combination of methods and classes used for a\n specific use case.\n\n*Test configuration*\n\n: A specific set of automated tests that are run on the\n DUT. Test configurations are XML files located in\n \u003cvar translate=\"no\"\u003eWORKING_DIRECTORY\u003c/var\u003e`/cts/tools/cts-tradefed/res/config`.\n There are test configurations that contains all automated test cases and test\n configurations that contain a subset of test cases.\n\n*Test module*\n\n: A test configuration consisting of a collection of test cases for the same\n feature area.\n\n*Test plan*\n\n: A test configuration consisting of a collection of test modules.\n\n| **Note:** The Android Open Source Project accepts contributions to improve CTS just as for any other component. Improving the coverage and quality of CTS tests is one of the best ways to contribute to Android. To make contributions to CTS, follow the same process in [Submit code changes](/docs/setup/contribute/submit-patches).\n\nTest coverage\n-------------\n\nTest cases cover the following areas to ensure compatibility:\n\n| Area | Description |\n|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Signature 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. |\n| Platform 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) 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. |\n| Dalvik tests | The tests focus on testing the Dalvik executable format. |\n| Platform 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) package (including contacts, browsers, and settings) |\n| Platform intents | The CTS tests the core platform intents, as documented in the SDK [Common intents](https://developer.android.com/guide/appendix/g-app-intents). |\n| Platform permissions | The CTS tests the core platform permissions, as documented in the SDK [`Manifest.permission`](https://developer.android.com/reference/android/Manifest.permission). |\n| Platform resources | The CTS tests for correct handling of the core platform resource types, as documented in the SDK [Resource types overview](https://developer.android.com/guide/topics/resources/available-resources). The CTS tests include tests for simple values, drawables, nine-patch, animations, layouts, styles and themes, and loading alternate resources. |\n\nWhat's next\n-----------\n\nAfter reading this document, continue to [Set up CTS](/docs/compatibility/cts/setup)."]]