ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
เวิร์กโฟลว์การพัฒนาการทดสอบ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากต้องการผสานรวมการทดสอบเข้ากับบริการทดสอบอย่างต่อเนื่องของแพลตฟอร์ม การทดสอบควรเป็นไปตามหลักเกณฑ์ในหน้านี้และทำตามขั้นตอนที่แนะนำ
- ใช้ระบบการบิลด์ Soong สำหรับการกำหนดค่าการทดสอบแบบง่าย
- ใช้การแมปการทดสอบเพื่อสร้างกฎการทดสอบก่อนและหลังการส่งในซอร์สทรีของ Android โดยตรง
- ทำการทดสอบในเครื่องโดยใช้ Atest
ประเภทการทดสอบ
ประเภทการทดสอบที่รองรับมีดังนี้
การทดสอบฟังก์ชันการทำงานจะยืนยันการผ่านหรือไม่ผ่านในเฟรมทดสอบ ส่วนการทดสอบเมตริกมักจะดำเนินการซ้ำๆ เพื่อรวบรวมเมตริกเกี่ยวกับเวลา
รูปแบบอินพุต/เอาต์พุตมาตรฐานจะช่วยลดความจำเป็นในการแยกวิเคราะห์ผลลัพธ์และหลังการประมวลผลที่ปรับแต่งตามการทดสอบแต่ละรายการ และสามารถใช้ชุดทดสอบทั่วไปกับการทดสอบทั้งหมดที่ตรงกับรูปแบบนี้ได้ ดูภาพรวมของ Trade Federation สำหรับเฟรมเวิร์กการทดสอบอย่างต่อเนื่องที่รวมอยู่ใน Android
หลักเกณฑ์เกี่ยวกับกรณีทดสอบ
เฟรมเวิร์กการทดสอบที่ดำเนินการผ่านบริการทดสอบอย่างต่อเนื่องควรปิดสนิท ซึ่งหมายความว่ามีการประกาศและระบุทรัพยากรทั้งหมดที่ต้องใช้กับการทดสอบ ดูเซิร์ฟเวอร์แบบปิดตายในบล็อกการทดสอบของ Google เพื่อทําความเข้าใจหลักการนี้ กล่าวโดยย่อคือ การทดสอบที่แยกต่างหากไม่ต้องมีสิ่งต่อไปนี้
- การลงชื่อเข้าใช้บัญชี Google
- กำหนดค่าการเชื่อมต่อแล้ว (โทรศัพท์/Wi-Fi/บลูทูธ/NFC)
- พารามิเตอร์การทดสอบที่ส่งเข้ามา
- การตั้งค่าหรือการรื้อถอนโดยชุดทดสอบสำหรับกรณีทดสอบที่เฉพาะเจาะจง
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 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"]]