Testing logic
Usually, the most straightforward tests you can write for your applications are unit tests. As the name indicates, each unit test should test a single unit or individual piece of the software and should be relatively simple. These types of tests are useful, for example, to check whether the logic or the business logic of your application is working as intended. If done right, logic should be isolated or abstracted from other components and even from Android SDK classes and methods. It could be run directly on the IDE, Android Studio, or even from the command line.
To show how to create some simple unit tests in your application, we will write a small and simple calculator application and write some tests for it. Later, we will add some more functionality so we will see other kinds of test in action.
Simple calculator application
The aim of this calculator application is to provide an example of how to create and run tests, so the functionality aspect will be very limited and we...