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.
Flusso di lavoro di sviluppo dei test
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per integrare i test in un servizio di test continuo della piattaforma, devono soddisfare le linee guida riportate in questa pagina e seguire questo flusso consigliato.
- Utilizza il sistema di compilazione Soong per la configurazione di test semplice.
- Utilizza la mappatura dei test per creare regole di test prima e dopo l'invio direttamente nella struttura ad albero del codice sorgente di Android.
- Esegui i test localmente utilizzando Atest.
Tipi di test
I tipi di test supportati sono:
I test funzionali eseguono verifiche di superamento o fallimento sugli scenari di test, mentre i test delle metriche generalmente eseguono un'azione ripetutamente per raccogliere le metriche relative ai tempi.
Con il formato di input/output standardizzato, la necessità di analisi dei risultati personalizzata
e di post-elaborazione per test viene eliminata e possono essere utilizzati set di test generici
per tutti i test che rientrano nella convenzione. Consulta la Panoramica di Trade Federation per il framework di test continuo incluso in Android.
Linee guida per gli scenari di test
Gli scenari di test eseguiti tramite il servizio di test continui devono essere
ermetici, il che significa che tutte le dipendenze sono dichiarate e fornite con i
test. Per comprendere questo principio, consulta l'articolo Server ermetici nel blog di Google Testing. In breve, i test in isolamento non richiedono:
- Accesso all'Account Google
- Connettività configurata (telefonia/Wi-Fi/Bluetooth/NFC)
- Parametri di test passati
- Configurazione o smantellamento eseguiti dal test harness per un test case specifico
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,["# Test development workflow\n\nTo integrate tests into a platform continuous testing service, they should meet\nthe guidelines on this page and follow this recommended flow.\n\n1. Use the [Soong build system](https://android.googlesource.com/platform/build/soong/) for [Simple Test Configuration](/docs/core/tests/development/blueprints).\n2. Employ [Test Mapping](/docs/core/tests/development/test-mapping) to create pre- and post-submit test rules directly in the Android source tree.\n3. Run tests locally using [Atest](/docs/core/tests/development/atest).\n\nTest types\n----------\n\nSupported test types are:\n\n- [Instrumentation tests](/docs/core/tests/development/instrumentation) support both functional and metrics tests. See [Test your app](https://developer.android.com/studio/test/) for general app testing guidance.\n- [GoogleTest](/docs/core/tests/development/gtest) (GTest) supports the following test types:\n - [Functional GTests](/docs/core/tests/development/gtest-func-e2e) using the [GTest](https://github.com/google/googletest) framework\n - [Metric tests](/docs/core/tests/development/metrics) using [`google-benchmark`](https://github.com/google/benchmark)\n- [JAR host tests](/docs/core/tests/development/jar) using JUnit\n\nFunctional tests make assertions of pass or fail on test cases, while metrics\ntests generally perform an action repeatedly to collect timing metrics.\n\nWith standardized input/output format, the need for customized result parsing\nand post-processing per test is eliminated, and generic test harnesses can be\nused for all tests that fit into the convention. See the [Trade Federation\nOverview](/docs/core/tests/tradefed) for the continuous test framework\nincluded with Android.\n\nTest case guidelines\n--------------------\n\nTest cases executed through the continuous testing service are expected to be\n**hermetic** , meaning that all dependencies are declared and provided with the\ntests. See [Hermetic Servers on the Google Testing\nBlog](https://testing.googleblog.com/2012/10/hermetic-servers.html)\nfor an understanding of this principle. In short, hermetic tests require **no**:\n\n- Google Account sign-in\n- Connectivity configured (telephony/Wi-Fi/Bluetooth/NFC)\n- Test parameters passed in\n- Setup or tear down performed by test harness for a specific test case"]]