在 Android 平台上测试应用   Android Jetpack 的一部分。

测试应用是应用开发过程中不可或缺的一部分。通过持续对应用运行测试,您可以在公开发布应用之前验证其正确性、功能行为和易用性。

测试还具有以下优势:

  • 快速获得故障反馈
  • 在开发周期中尽早进行故障检测
  • 更安全的代码重构,让您可以优化代码而不必担心回归。
  • 稳定的开发速度,帮助您最大限度地减轻技术负担。

文档

本文档介绍了有关测试 Android 应用的最佳实践:

其他资源

如需详细了解如何在 Android 平台上进行测试,请参阅以下资源。

示例

Codelab

媒体

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