在 Android 上測試應用程式   Android Jetpack 的一部分。

測試應用程式是應用程式開發流程中不可或缺的一環。藉由持續測試應用程式,您可以在公開發布應用程式前,驗證應用程式的正確性、功能行為和可用性。

測試還有以下優點:

  • 針對失敗狀況提供快速意見回饋
  • 在開發週期中及早偵測失敗情形
  • 更安全的程式碼重構,讓您在進行程式碼最佳化時,不必擔心回歸問題。
  • 穩定的開發速度,協助您盡量減少技術債。

說明文件

說明文件涵蓋測試 Android 應用程式的最佳做法:

其他資源

如要進一步瞭解如何在 Android 裝置上測試,請參閱下列資源。

範例

程式碼研究室

媒體

You can test a ViewModel by simply creating an instance using its constructor in your test code. However, this approach has limitations — there is no straightforward way to: With ViewModelScenario, these are now easy to test, helping you catch errors

Keep your UI delightful by testing it! Previews allow quickly verifying components during development, which can be automated with the preview screenshot testing Gradle plugin to create visual regression tests. Behavior tests can use

We work closely with many teams and one thing they all have in common is a justified growing focus on automated testing. More features, more form factors, and more supported Android releases make tests increasingly important. These guides don’t focus

Compared to phone apps, developing high quality health and fitness experience for Wear — and especially performing manual QA — can be a bit tricky. Capabilities vary between devices, and running (or swimming!) over and over to test a user journey is