ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
เริ่มต้นใช้งาน TF
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Trade Federation เป็นโครงสร้างพื้นฐานการทดสอบขนาดใหญ่ที่ปรับให้เข้ากับ Use Case ต่างๆ ได้มากมาย และผู้ใช้ส่วนใหญ่อาจต้องใช้ฟังก์ชันการทำงานเพียงบางส่วนเท่านั้น ก่อนอื่น เราคาดหวังว่าผู้ใช้ TF จะทำหน้าที่ในบทบาทหลัก 3 บทบาท ได้แก่ นักพัฒนาซอฟต์แวร์ ผู้ผสานรวม และโปรแกรมทดสอบ บุคคลหนึ่งๆ อาจสวมหมวกทั้ง 3 แบบ (หรือทั้ง 3 แบบ) แต่เราคิดว่าการแยกแยะจะช่วยให้ไปยังส่วนต่างๆ ของเอกสารประกอบได้ง่ายขึ้น
นักพัฒนาแอป
นักพัฒนาซอฟต์แวร์ใช้เวลาส่วนใหญ่ไปกับการสร้างโมดูล TF ที่เขียนด้วย Java
ผู้ใช้อาจเขียนการกําหนดค่าและเรียกใช้การทดสอบ แต่โดยทั่วไปจะทําเพื่อยืนยันว่ามีการเรียกใช้ข้อบังคับอย่างถูกต้องและทํางานตามที่คาดไว้เท่านั้น
ผู้ผสานรวม
ผู้ผสานรวมใช้เวลาส่วนใหญ่ไปกับการสร้างการกำหนดค่าการทดสอบ XML หรือไฟล์คำสั่ง (ซึ่งเขียนด้วยภาษาที่คล้ายกับเชลล์อย่างง่าย) โดยจะเชื่อมโยงโมดูล TF ที่นักพัฒนาซอฟต์แวร์เขียนขึ้นกับการกําหนดค่าเฉพาะที่จําเป็นสําหรับข้อกําหนดและเป้าหมายการทดสอบ
ผู้ทดสอบ
Test Runner ใช้เวลาส่วนใหญ่ในการเรียกใช้การทดสอบ และโดยทั่วไปจะตรวจสอบว่าระบบกำลังสร้างผลการทดสอบ และผลการทดสอบที่สร้างขึ้นมีความเกี่ยวข้อง ซ้ำได้ และถูกต้อง โดยใช้เวลาส่วนใหญ่ในการโต้ตอบกับอินเทอร์เฟซบรรทัดคำสั่งของ Tradefed และตรวจสอบว่าผลลัพธ์สมเหตุสมผล
คุณจะต้องมีตัวแทนทั้ง 3 บทบาทจึงจะใช้ประโยชน์จาก Trade Federation ได้สูงสุด
นักพัฒนาซอฟต์แวร์และผู้ผสานรวมจะต้องทําให้ TF ทํางานร่วมกับโครงสร้างพื้นฐานอื่นๆ เช่น ระบบบิลด์และที่เก็บผลการทดสอบ จะต้องมีผู้ผสานรวมและผู้รันทดสอบเพื่อให้ TF ทำการทดสอบที่ต้องการและสร้างผลการทดสอบที่ต้องการ ผู้ใช้ Test Runner จะระบุผลลัพธ์ที่ไม่สมเหตุสมผล และทำงานร่วมกับนักพัฒนาซอฟต์แวร์และผู้ผสานรวมเพื่อหาจุดที่อาจเกิดข้อบกพร่องและแก้ไขข้อบกพร่อง
ขั้นต่อไปคืออะไร
บุคคลในบทบาททั้ง 3 บทบาทควรอ่านเอกสารที่เหลือทั้งหมดอย่างน้อยคร่าวๆ
การตั้งค่าเครื่องจะนำคุณไปยังจุดที่คุณเรียกใช้ TF ได้ (โดยการสร้างหรือดาวน์โหลด)
การทํางานกับอุปกรณ์จะอธิบายวิธีทําการทดสอบกับอุปกรณ์จริง โปรแกรมจําลอง หรือไม่มีอุปกรณ์เลย หน้าวงจรการทดสอบจะอธิบายจากมุมมองทางทฤษฎีว่าบทบาทของนักพัฒนาซอฟต์แวร์ ผู้ผสานรวม และผู้เรียกใช้การทดสอบทำงานร่วมกันอย่างไร จากนั้นการจัดการตัวเลือกจะสาธิตวิธีนำทฤษฎีดังกล่าวไปใช้จริง
สุดท้าย ตัวอย่างแบบต้นทางถึงปลายทางจะอธิบายการพัฒนา การผสานรวม และการใช้งานการทดสอบตัวอย่าง ซึ่งเกี่ยวข้องกับแง่มุมของบทบาทแต่ละบทบาท และควรให้คำแนะนำเกี่ยวกับวิธีทํางานที่ซับซ้อนมากขึ้นซึ่งไม่ได้กล่าวถึงในเอกสารประกอบโดยตรง
หากคุณอ่านทุกอย่างที่นี่แล้วแต่ยังมีคำถามที่ยังไม่ได้รับคำตอบ ให้ลองดูซอร์สโค้ดของ Trade Federation ก่อน นอกจากนี้ คุณยังลองถามใน Google Group ของ android-platform ได้ด้วย เพื่อให้ได้ผลลัพธ์ที่ดีที่สุด อย่าลืมพูดถึง "Trade Federation" (หรือ "tradefed" หรือ "TF") ในหัวเรื่องข้อความ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# Get started with TF\n\nTrade Federation is a large test infrastructure that can be adapted to a great variety of\ndifferent usecases, and most people will probably only need some subset of its functionality. First\noff, we envision that TF users will fulfill any of three primary roles: Developer, Integrator, and\nTest Runner. A particular individual might wear any (or all) of those three hats, but we feel the\ndistinction will help make it easier to navigate the documentation.\n\nDevelopers\n----------\n\nDevelopers spend the majority of their time creating TF modules that are written in Java.\nThey may write configurations and execute tests, but will typically only do so to verify that their\nmodules are being invoked properly and are functioning as expected.\n\nIntegrators\n-----------\n\nIntegrators spend the majority of their time creating XML test configurations, or command\nfiles (which are written in a simple shell-like language). They tie together TF modules written\nby the Developer with specific configurations that are required for particular test requirements and\ngoals.\n\nTest Runners\n------------\n\nTest Runners spend the majority of their time executing tests and generally making sure\nthat test results are being generated, and that the generated test results are relevant,\nreproducible, and accurate. They spend the majority of their time interacting with tradefed's\ncommand line interface, and will also verify that the results make sense.\n\nIn order to get the most out of Trade Federation, all three roles will need to be represented.\nIt will take Developers and Integrators to make TF interoperate with other pieces of infrastructure,\nlike build systems and test result repositories. It will take Integrators and Test Runners to get\nTF to actually run the desired tests and produce the desired test results. It will take Test\nRunners to identify results that don't make sense, and to work with the Developers and\nIntegrators to figure out where the bugs may lie and get them fixed.\n\nWhat's next\n-----------\n\nPeople in all three roles should at least glance through all the rest of the docs.\n[Machine Setup](/docs/core/tests/tradefed/fundamentals/machine_setup) will get you to the point where you can run TF (by building or downloading it).\n[Working with Devices](/docs/core/tests/tradefed/fundamentals/devices) will explain how to run tests with a physical device, with an emulator, or\nwith no device at all. The\n[Test Lifecycle](/docs/core/tests/tradefed/fundamentals/lifecycle) page will explain from a theoretical perspective how the roles of the\nDeveloper, Integrator, and Test Runner interact, and then\n[Option Handling](/docs/core/tests/tradefed/fundamentals/options) will demonstrate how to put that theory into practice.\n\nFinally, the [End-to-End Example](/docs/core/tests/tradefed/fundamentals/full_example) takes you through the development, integration, and deployment of a sample\ntest. It involves aspects of each role, and should offer hints at how to do more complicated\nthings that aren't directly discussed in the documentation.\n\nIf you've gotten through everything here and still have unanswered questions, first try taking\na look at the [Trade Federation source code](https://android.googlesource.com/platform/tools/tradefederation/+/main). Beyond that, feel free to try asking on the\n[android-platform](/docs/setup/community) Google Group. For best results, make\nsure to mention \"Trade Federation\" (or \"tradefed\", or \"TF\") in the message subject."]]