Tuesday, May 22, 2012

Analysing Android test frameworks


Searching for some Android test frameworks, I found, as most relevant, Roboeletric, Robotium and Calculon.

So I had to look inside them to define which one would fit my needs.

Roboeletric 

http://pivotal.github.com/robolectric/eclipse-quick-start.html
looks like the best one to use, because it runs tests in less time than the others. It runs in JVM without the need to use an emulator or a device. Besides it has clean and meaningful syntax and provides some kind of mock through shadow objects.

Good presentation:
http://www.slideshare.net/joemoore1/tdd-android-applications-with-robolectric

Robotium 

http://code.google.com/p/robotium/
is nice too, but it's slow because it needs an emulator or a device to run tests. It's the best option to run some specific tests that Roboeletric doesn't implement and to run on real devices. It shows the clicks on screen, edit fields being filled and screen navigation, which make things more realistic.

Reference:
http://www.slideshare.net/hugojosefson/robotium-at-android-only-2010-0929

Calculon

https://github.com/kaeppler/calculon
http://brainflush.wordpress.com/2010/01/10/introducing-calculon-a-java-dsl-for-android-activity-testing/
on the other hand, has it's own syntax to make more semantical tests , more readable. It also needs an emulator or a device to run tests, making it slow too.

Great presentation:
http://www.slideshare.net/matthiaskaeppler/calculon



Which I'll use


Roboeletric will be the one I'll choose, mostly because I'm doing TDD and really like faster response.

No comments:

Post a Comment