החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
תהליך העבודה לפיתוח בדיקות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי לשלב בדיקות בשירות של בדיקה רציפה בפלטפורמה, הן צריכות לעמוד בהנחיות שמפורטות בדף הזה ולפעול לפי התהליך המומלץ הזה.
- משתמשים במערכת ה-build של Soong להגדרת בדיקה פשוטה.
- שימוש במיפוי בדיקות כדי ליצור כללי בדיקה לפני שליחה ולאחר שליחה ישירות בעץ המקור של Android.
- להריץ בדיקות באופן מקומי באמצעות Atest.
סוגי בדיקות
סוגי הבדיקות הנתמכים הם:
בבדיקות פונקציונליות מתבצעות טענות נכוֹנוּת (assertions) לגבי מקרי בדיקה, בעוד שבבדיקות מדדים בדרך כלל מבוצעת פעולה שוב ושוב כדי לאסוף מדדי תזמון.
כשמשתמשים בפורמט סטנדרטי של קלט/פלט, אין צורך בניתוח מותאם אישית של תוצאות ובעיבוד פוסט-פרודקשן לכל בדיקה, וניתן להשתמש במערכות בדיקה כלליות לכל הבדיקות שתואמות למוסכמה. במאמר סקירה כללית על Trade Federation מוסבר על מסגרת הבדיקות הרציפות שכלולה ב-Android.
הנחיות למקרי בדיקה
מקרי הבדיקה שמבוצעים באמצעות שירות הבדיקה המתמשכת אמורים להיות אטומים, כלומר כל יחסי התלות צריכים להיות מוצהרים ולצורך כך הם צריכים להופיע בבדיקות. תוכלו לקרוא על העיקרון הזה במאמר שרתים אטומים בבלוג Google Testing. בקיצור, בבדיקות הרמטיות לא נדרשים:
- כניסה לחשבון Google
- קישוריות מוגדרת (טלפוניה/Wi-Fi/Bluetooth/NFC)
- העברת הפרמטרים של הבדיקה
- הגדרה או ניתוק שבוצעו על ידי ערכת בדיקה לתרחיש בדיקה ספציפי
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","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 (שעון 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"]]