2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
テスト開発ワークフロー
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
プラットフォームの継続的なテストサービスにテストを統合するには、このページのガイドラインを遵守し、以下の推奨フローに沿って進める必要があります。
- シンプルなテスト構成の Soong ビルドシステムを使用します。
- テスト マッピングを使用すると、presubmit および postsubmit テストのルールを直接 Android ソースツリーに作成できます。
- Atest を使用してローカルでテストを実行します。
テストの種類
サポートされているテストの種類は次のとおりです。
機能テストは、テストケースの合否のアサーションを行いますが、指標テストは繰り返し実行してタイミング指標を測定します。
標準化された入出力形式により、テストごとにカスタマイズされた結果解析と後処理が不要になり、規則に適合するすべてのテストに一般的なテストハーネスを使用できます。Android に付属の継続的なテスト フレームワークについては、Trade Federation の概要をご覧ください。
テストケースのガイドライン
継続的なテストサービスを介して実行されるテストケースは、密閉型である(つまり、テストですべての依存関係が宣言され、用意される)ことが求められます。この原理を理解するには、Google テストブログの密閉型サーバーをご覧ください。つまり、密閉型テストでは以下のような作業は一切必要ありません。
- Google アカウントへのログイン
- 接続の設定(電話 / Wi-Fi / Bluetooth / NFC)
- テスト パラメータの引き渡し
- 特定のテストケースのテストハーネスによるセットアップまたは破棄
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 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-03-26 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"]]