Posted by Jose Alcérreca, Android Developer Relations Engineer
As apps improve in performance and complexity, manually testing them to confirm conduct turns into tedious, costly, or inconceivable. Trendy apps, even easy ones, require you to confirm an ever-growing listing of check factors corresponding to UI flows, localization, or database migrations. Having a QA group whose job is to manually confirm that the app works is an possibility, however fixing bugs at that stage is dear. The earlier you repair an issue within the growth course of the higher.
Automating exams is one of the best method to catching bugs early. Automated testing (to any extent further, testing) is a broad area and Android presents many instruments and libraries that may overlap. For that reason, novices usually discover testing difficult.
In response to this suggestions, and to accommodate for Compose and new structure pointers, we revamped two testing sections on d.android.com:
Coaching
Firstly, there’s the brand new Testing coaching, which incorporates the basics of testing in Android with two new articles: What to check, an opinionated information for novices, and an in depth information on Take a look at doubles.
Faking dependencies in unit exams
After offering an outline of the idea, the information focuses on sensible examples of the 2 most important kinds of exams.
- Native exams that run on a workstation and are usually unit exams.
- Instrumented exams that run on a tool. This part consists of an introduction to UI exams and the AndroidX Take a look at libraries.
Faking dependencies in UI exams
Instruments Documentation
Secondly, we up to date the Testing part of the Instruments documentation that focuses on all of the instruments that show you how to create and run exams, from Android Studio to testing from the command line.
We included an article that describes Superior check setup options corresponding to working with totally different variants, the instrumentation manifest choices, or the Android Gradle Plugin settings.
These two new sections ought to provide you with a common notion of how and the place to check your Android app. To be taught extra about testing particular options and libraries, you need to take a look at their respective documentation pages. For instance: Testing Kotlin flows, Take a look at Navigation, or the Hilt testing information.
Sadly, machines cannot routinely confirm the correctness of our documentation, so when you discover errors or have recommendations, please file a bug on our documentation problem tracker.
Take a comment