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. You will need to make sure that the contents of your class are currently in focus in the editor for the keyboard shortcut to take effect.
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 at the top of the class, which will execute all the tests in the class.
Figure 10.2 – Running a group of tests
For an individual test, you can click the green icon next to the @Test
annotated methods.
Figure 10.3 – Icons for running individual...