Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release, bukan aosp-main, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Compatibility Test Suite (CTS) adalah rangkaian pengujian dan
alat gratis kelas komersial yang digunakan untuk membantu memastikan perangkat Anda kompatibel dengan Android. CTS
dimaksudkan untuk diintegrasikan ke dalam alur kerja harian Anda, seperti melalui
sistem build berkelanjutan. CTS berjalan di komputer desktop dan menjalankan pengujian
langsung di perangkat yang terpasang atau di emulator. Untuk ringkasan kompatibilitas Android, lihat Ringkasan program kompatibilitas Android.
Gambar 1. Pengujian otomatis CTS.
Gambar 1 menunjukkan proses menjalankan pengujian otomatis CTS:
Download dan instal CTS. Langkah ini juga mencakup penyiapan lingkungan pengujian, workstation pengujian, dan perangkat yang Anda uji atau perangkat yang sedang diuji (DUT)
Menjalankan pengujian otomatis CTS.
Simpan dan tinjau hasilnya.
Memecahkan masalah dan menjalankan ulang pengujian.
Gunakan CTS untuk mengungkapkan ketidakcocokan lebih awal, dan untuk memastikan bahwa implementasi
Android Anda tetap kompatibel selama proses pengembangan.
Komponen CTS
CTS berisi komponen utama berikut:
Trade Federation
Framework dan harness pengujian memungkinkan eksekusi pengujian otomatis.
Pengujian otomatis CTS
Pengujian yang menggunakan framework Trade Federation dan dapat dijalankan menggunakan harness
pengujian Trade Federation.
Pengujian CTS Verifier (CTS-V)
Pengujian yang harus dijalankan secara manual.
Aplikasi CTS Verifier (CTS-V)
Aplikasi yang digunakan untuk melakukan pengujian CTS-V dan mengumpulkan hasil pengujian CTS-V.
Kasus pengujian
Pengujian individual yang dijalankan di DUT. Kasus pengujian otomatis
ditulis dalam Java sebagai pengujian JUnit dan file APK Android yang dipaketkan untuk dijalankan di
target perangkat.
Kasus pengujian dapat berupa pengujian unit atau pengujian fungsional. Pengujian unit menguji unit
atomik kode dalam platform Android. Misalnya, pengujian unit dapat menguji
satu class Android.
Pengujian fungsional menjalankan kombinasi metode dan class yang digunakan untuk
kasus penggunaan tertentu.
Konfigurasi pengujian
Kumpulan pengujian otomatis tertentu yang dijalankan di
DUT. Konfigurasi pengujian adalah file XML yang terletak di
WORKING_DIRECTORY/cts/tools/cts-tradefed/res/config.
Ada konfigurasi pengujian yang berisi semua kasus pengujian otomatis dan konfigurasi
pengujian yang berisi subset kasus pengujian.
Modul pengujian
Konfigurasi pengujian yang terdiri dari kumpulan kasus pengujian untuk area fitur
yang sama.
Rencana pengujian
Konfigurasi pengujian yang terdiri dari kumpulan modul pengujian.
Cakupan pengujian
Kasus pengujian mencakup area berikut untuk memastikan kompatibilitas:
Area
Deskripsi
Pengujian tanda tangan
Untuk setiap rilis Android, ada file XML yang menjelaskan tanda tangan semua
API publik yang terdapat dalam rilis. CTS berisi utilitas untuk memeriksa tanda tangan
API tersebut dengan API yang tersedia di perangkat. Hasil dari pemeriksaan
tanda tangan dicatat dalam file XML hasil pengujian.
Pengujian Platform API
Uji API platform (library inti dan Framework Aplikasi Android) seperti yang didokumentasikan
dalam Class Index SDK untuk
memastikan ketepatan API, termasuk tanda tangan class, atribut, dan metode yang benar,
perilaku metode yang benar, dan pengujian negatif untuk memastikan perilaku yang diharapkan untuk
penanganan parameter yang salah.
Pengujian Dalvik
Pengujian ini berfokus pada pengujian format file yang dapat dieksekusi Dalvik.
Model data platform
CTS menguji model data platform inti seperti yang ditampilkan kepada developer aplikasi
melalui penyedia konten, seperti yang didokumentasikan dalam
paket android.provider SDK (termasuk kontak, browser, dan setelan)
Intent platform
CTS menguji intent platform inti, seperti yang didokumentasikan dalam
Intent umum SDK.
Izin platform
CTS menguji izin platform inti, seperti yang didokumentasikan dalam
Manifest.permission SDK.
Referensi platform
CTS menguji penanganan yang benar terhadap jenis resource platform inti,
seperti yang didokumentasikan dalam
Ringkasan jenis resource SDK. Pengujian CTS mencakup pengujian untuk nilai sederhana, drawable, nine-patch,
animasi, tata letak, gaya, dan tema, serta memuat resource alternatif.
Langkah berikutnya
Setelah membaca dokumen ini, lanjutkan ke Menyiapkan CTS.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]