• Advertisement
Sign in to follow this  

Android TDD

This topic is 2041 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a big fan of tdd I've got a lot of good tests around my core framework and shared code base. But I'm really struggling to crack tdd within an android application. And I'm curious how have other people dealt with automated testing for android apps. Are there any useful tools that you've used?

I've given monkey runner a try and its useful for injecting random events into the application. And I believe it can be used to script up selenium style regression tests but I haven't tried that.

The android instrumentation classes seem like they offer a lot and and are powerful, but sadly like all aspects of android I've found the documentation lacking and missing crucial details. For instance it took a few minute to realize that test methods only got picked up if the method name starts with the word test.

I've been trying to build my unit tests using the android test cases pattern they show on dev site but I've been finding it very slow going. And I've spent a couple of hours struggling hopelessly to find out how to get any kind of activity state information which I need to build my behaviour tests. For instance I have one test that I want to check that pressing the save button has successfully persisted data to a db and finished the activity. And another that checks that a dialog window has opened and populated correctly when the user touches a certain text box. But there doesn't seem to be any obvious way of getting that information, calling an applications different lifecylce methods is easy but how you find out what state it currently is in or what the orientation currently is I have no idea.

What about other developers have you managed to crack building quality tests around your android apps?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement