Android Testing DSL Reprise

Posted: October 12, 2010 in Android, Java
Tags: , , , ,
Android robot logo.
Image via Wikipedia

I did some hacking yesterday with Calculon in a attempt to see if it could be extended similar to robotium. Not possible, robotium is the best option..sorry MK(Calculon developer). Thus, we have a IDE plugin or build that runs all the tests at one time and completes a code coverage report along with a DSL syntax to reduce the complexity of writing unit tests.

It will not be as pretty as say Spock, but still it reduces test writing expertise to something manageable.

But Android emulation is unique in that we have to start up anew AVD to test a different device model. The obvious next step is to get some way to start and stop the AVDs in your emulator inventory and run install-app and tests each time and produce test reports for each device model.

Apache ANT is too brittle of DSL to be flexible enough to work as a work-flow testing scenario. This might be an ideal situation to use Gradle in as it uses Groovy’ DSL with the ability to run/execute ant tasks/targets, maven stuff, ivy, etc.

Dependency Injection vs Mock wise I do not see a need in testing to resort to DI if you have Android-Mock available. But maybe some developers prefer to use DI rather Android-Mock, it just seems that yuo are moving your focus away from  tests up the DI chain if you pursue that route.

Enhanced by Zemanta
  1. Christopher says:

    Have a look at the Android Emulator Plugin for Hudson, regarding automated creation and execution of AVDs, which can be used in conjunction with all the usual Hudson plugins like reporting code coverage, JUnit test results, Checkstyle results etc..

  2. You do know about the Maven Android Plugin and its ability to start and stop Android AVD devices and with a bit of a hack even create new ones.

    There is also the Hudson Android Emulator Plugin that can it as well. So dont reinvent the wheel. Help us out with your ideas 😉

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s