Android Studio Testing Tips
Android Studio comes with a good set of shortcuts and visual tools to help with testing. If you want to create a new test for your class or go to existing tests for your class, you can use the Ctrl + Shift + T (Windows) or Command + Shift + T (Mac) shortcut. In order to run tests, there are multiple options: right-click your file or the package and select the Run Tests in...
option, or if you want to run a test independently, you can go to the particular test method and select the green icon either to the top of the class, which will execute all the tests in the class; or, for an individual test, you can click the green icon next to the @Test
annotated methods. This will trigger the test execution, which will be displayed in the Run
tab, as shown in the following screenshot. When the tests are completed, they will become either red or green, depending on their success state:
Another important...