透過集合功能整理內容
你可以依據偏好儲存及分類內容。
測試應用程式是應用程式開發流程中不可或缺的一環。藉由持續測試應用程式,您可以在公開發布應用程式前,驗證應用程式的正確性、功能行為和可用性。
測試還有以下優點:
- 針對失敗狀況提供快速意見回饋。
- 在開發週期中及早偵測失敗情形。
- 更安全的程式碼重構,讓您在進行程式碼最佳化時,不必擔心回歸問題。
- 穩定的開發速度,協助您盡量減少技術債。
說明文件
說明文件涵蓋測試 Android 應用程式的最佳做法:
其他資源
如要進一步瞭解如何在 Android 裝置上測試,請參閱下列資源。
範例
程式碼研究室
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Test apps on Android\nPart of [Android Jetpack](/jetpack).\n=========================================================\n\nTesting your app is an integral part of the app development process. By running\ntests against your app consistently, you can verify your app's correctness,\nfunctional behavior, and usability before you release it publicly.\n\nTesting also offers the following advantages:\n\n- **Rapid feedback** on failures.\n- **Early failure detection** in the development cycle.\n- **Safer code refactoring**, allowing you to optimize code without worrying about regressions.\n- **Stable development velocity**, helping you minimize technical debt.\n\nDocumentation\n-------------\n\nThe documentation covers best practices around testing Android apps:\n\n- [Fundamentals of testing Android apps](/training/testing/fundamentals)\n- [Build local unit tests](/training/testing/local-tests) that run on the host\n- [Build instrumented tests](/training/testing/instrumented-tests) that run on devices or emulators\n- Verify UIs with [Behavior](/training/testing/ui-tests/behavior) and [Screenshot tests](/training/testing/ui-tests/screenshot)\n- [Test different screen sizes](/training/testing/different-screens)\n\nAdditional resources\n--------------------\n\nFor more information about testing on Android, consult the following resources.\n\n### Samples\n\n- [Android testing samples](https://github.com/android/testing-samples)\n- [Now In Android demo app](https://github.com/android/nowinandroid), which makes use of the Android testing libraries.\n\n### Codelabs\n\n- [Android Testing Codelab](/codelabs/advanced-android-kotlin-training-testing-basics)\n\nMedia\n-----"]]