2

I've been experimenting recently with Android applications.

I've developed the convention (which I've seen used elsewhere) of placing my unit tests in a parallel source folder within an Eclipse project. This works well because the Eclipse JUnit runner can find the tests easily and the project with it's tests are nicely contained in the project.

However, Android applications have a very specific structure, and I don't think that my normal unit tree design will work. Also, I don't really want my test code in the published app; it could effectively double the size on disk. How are Android unit tests usually organized?

asked Mar 21, 2011 at 14:44

1 Answer 1

4

You typically set up a separate project for Android unit tests. There's an article on the Android Developer's site called Testing Fundamentals that takes you through the steps of setting up a test project in Eclipse. Also, see the Activity Testing Tutorial for a somewhat more advanced (and detailed) guide to testing Android apps.

answered Mar 21, 2011 at 15:08
1
  • 1
    Note also that the Android SDK has support for running your unit tests against the simulator using Ant, so you can have continuous integration run those for you. Commented Mar 21, 2011 at 19:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.