Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
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. –  jjb Mar 21 '11 at 19:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.