Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best and easy tool to unit test Android apps?

I have been developing Android application for a small company and during the development process we need to do repetitive testing of some modules, So i searched tools for doing automation testing (unit testing) of the app. Android has a unit test tool however to write those test cases will itself take more time then to actually test it by hand.

I found some apps which do some great stuff and provide good charts for example Robolectric, robotium, fonemonkey4android, but am confused to what to be used, any one with any experience with the same can help.

I checked for previous questions on the similar terms like below https://stackoverflow.com/questions/522312/best-practices-for-unit-testing-android-apps

But all the threads are very old and not so informative to decide on which to choose..

like image 961
nimittheinquister.in Avatar asked Feb 21 '12 11:02

nimittheinquister.in


1 Answers

I think first you need figure out which part of your code you want to test.

For codes which doesn't related to user interface, you can test them with Robolectric. With Robolectric, the unit test code is the same to those written for java application. But it's not suitable for test ui components.

If you want to test ui, then you can choose robotium. But i always doubt whether it's worth writing tests for ui, they change too often..

like image 151
Qiang Jin Avatar answered Nov 08 '22 10:11

Qiang Jin