What are different points to note down while testing android applications? What are different techniques or test cases used for android?
Best practices in Android TestingApplication developers should create the test cases at the same time when they are writing the code. All test cases should be stored in version control-together with source code. Use continuous integration and run tests every time the code is changed.
Good question. Here's some lists of things to consider, with links to tools that can help.
As for implementating tests, you can read some of the tutorials listed and use frameworks like Robotium to simplify the writing of tests.
Here is a non-exhaustive list of the types of tests that should be relevant for testing an Android application.
It depends on what exactly your application does, but it should be possible to test much of this automatically using some of the tools listed below.
Software and hardware features differ between the various Android devices.
You should test taking into account these, in conjunction with the types of devices your target market will be using.
Important is to make sure you support multiple screen types, particularly making sure you provide the right resources to support devices with different screen densities and physical screen sizes.
In general, you want to include as few graphics as possible, but make use of the various Android Drawable types, which often let you define the graphics you need via XML. Also make good use of layouts and images that automatically scale themselves no matter what device they're being used on.
Doing so will make testing across different devices simpler.
TestCase
classes for testing Android componentsAlthough Android provides a few mock objects that can be used to fake components for test purposes, many more would be useful.
For this reason (and in general), designing your application with testability in mind is a good idea. For example, don't directly access ConnectivityManager
, but instead create an interface that defines the method calls you need. Then write two implementations of that interface: one that wraps the Android ConnectivityManager
and another, mock version. Choose the implementation you want to use at runtime, depending on whether you're running unit tests or not.
InstrumentationTestRunner
— the default utility for running automated Android testsBeyond all the links above, here are a few specific articles available:
Activity
testsIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With