اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
مجموعة أدوات اختبار التوافق (CTS) هي مجموعة اختبارات وأدوات مجانية من المستوى التجاري تُستخدَم للمساعدة في التأكّد من توافق أجهزتك مع Android. يُقصد بدمج CTS
في سير عملك اليومي، مثل استخدام
نظام إنشاء مستمر. يتم تشغيل CTS على جهاز كمبيوتر مكتبي وتنفيذ الاختبارات
مباشرةً على الأجهزة المُرفَقة أو على محاكي. للحصول على نظرة عامة حول التوافق مع Android، يُرجى الاطّلاع على نظرة عامة حول برنامج التوافق مع Android.
الشكل 1: الاختبار الآلي لبرنامج CTS
يوضِّح الشكل 1 عملية تنفيذ الاختبارات المبرمَجة لمجموعة اختبار التوافق (CTS):
نزِّل أداة CTS (اختبار التوافق) وثبِّتها. تتضمّن هذه الخطوة أيضًا إعداد بيئة الاختبار ومحطة عمل الاختبار والجهاز الذي تختبره أو الجهاز الذي يتم اختباره (DUT).
تشغيل الاختبارات المبرمَجة لبرنامج CTS
تخزين النتائج ومراجعتها
تحديد المشاكل وحلّها وإعادة إجراء الاختبارات
استخدِم CTS للكشف عن حالات عدم التوافق في وقت مبكر، ولضمان استمرار توافق عمليات تنفيذ Android
طوال عملية التطوير.
مكوّنات مجموعة أدوات اختبار التوافق (CTS)
يحتوي CTS على المكوّنات الرئيسية التالية:
اتحاد التجارة
يسمح إطار العمل ومجموعة الاختبار بتنفيذ الاختبارات تلقائيًا.
الاختبارات التي تستخدِم إطار عمل Trade Federation ويمكن إجراؤها باستخدام حِزمة اختبار Trade
Federation
اختبارات أداة التحقّق في مجموعة أدوات اختبار التوافق (CTS-V)
الاختبارات التي يجب إجراؤها يدويًا:
تطبيق أداة التحقّق في مجموعة أدوات اختبار التوافق (CTS-V)
تطبيق يُستخدَم لإجراء اختبارات CTS-V وجمع نتائج اختبارات CTS-V
حالة الاختبار
اختبار فردي يتم تنفيذه على جهاز DUT يتم كتابة اختبارات الأداء المبرمَجة
باستخدام Java كاختبارات JUnit وتعبئة ملفات APK لنظام التشغيل Android لتشغيلها على
الجهاز المستهدَف.
يمكن أن تكون حالات الاختبار اختبارات وحدات أو اختبارات وظيفية. يختبر اختبار الوحدة وحدات برمجية أساسية
ضمن نظام Android الأساسي. على سبيل المثال، قد يختبر اختبار الوحدة
صفًا واحدًا من فئات Android.
يُجري الاختبار الوظيفي مجموعة من الطرق والفئات المستخدَمة في أحد حالات الاستخدام
المحدّدة.
إعداد الاختبار
مجموعة محدّدة من الاختبارات المبرمَجة التي يتم إجراؤها على
DUT إعدادات الاختبار هي ملفات XML موجودة في
WORKING_DIRECTORY/cts/tools/cts-tradefed/res/config.
هناك إعدادات اختبار تتضمّن جميع حالات الاختبار المبرمَجة وإعدادات
اختبار تتضمّن مجموعة فرعية من حالات الاختبار.
وحدة الاختبار
إعداد اختبار يتألف من مجموعة من حالات الاختبار لمنطقة الميزة
نفسها
خطة الاختبار
إعدادات اختبار تتألف من مجموعة من وحدات الاختبار
تغطية الاختبار
تتناول حالات الاختبار الجوانب التالية لضمان التوافق:
المنطقة
الوصف
اختبارات التوقيع
لكل إصدار من Android، تتوفّر ملفات XML تصف توقيعات كل واجهة برمجة تطبيقات
عامة مضمّنة في الإصدار. يحتوي CTS على أداة للتحقّق من توقيعات واجهات برمجة التطبيقات هذه مقابل واجهات برمجة التطبيقات المتاحة على الجهاز. يتم تسجيل نتائج التحقّق من التوقيع في ملف XML الخاص بنتائج الاختبار.
اختبارات Platform API
اختبِر واجهات برمجة التطبيقات الخاصة بالنظام الأساسي (المكتبات الأساسية وإطار عمل تطبيقات Android) كما هو موضّح في فهرس الفئات لحزمة تطوير البرامج (SDK) لضمان صحة واجهة برمجة التطبيقات، بما في ذلك صحة توقيعات الفئات والسمات والطُرق، وصحة سلوك الطُرق، والاختبارات السلبية لضمان السلوك المتوقّع عند التعامل مع المَعلمات غير الصحيحة.
اختبارات Dalvik
تركّز الاختبارات على اختبار تنسيق Dalvik القابل للتنفيذ.
نموذج بيانات النظام الأساسي
يختبر CTS نموذج بيانات النظام الأساسي الأساسي كما هو معروض لمطوّري التطبيقات
من خلال مقدّمي المحتوى، كما هو موضّح في حزمة IDE android.provider (بما في ذلك جهات الاتصال والمتصفّحات والإعدادات).
تختبر مجموعة أدوات اختبار التوافق (CTS) أذونات المنصة الأساسية، كما هو موضّح في مستندات
حزمة تطوير البرامج (SDK) Manifest.permission.
موارد النظام الأساسي
يُجري CTS اختبارات للتحقق من معالجة أنواع موارد النظام الأساسي الأساسية بشكل صحيح،
كما هو موضّح في
نظرة عامة على أنواع الموارد في حِزم تطوير البرامج (SDK). تشمل اختبارات CTS اختبارات للقيم البسيطة والعناصر القابلة للرسم وعناصر "التسعة أقسام"،
والرسوم المتحركة والتنسيقات والأنماط والمظاهر وتحميل الموارد البديلة.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)."]]