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?
1 Answer 1
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.
-
1Note 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– jjb2011年03月21日 19:38:21 +00:00Commented Mar 21, 2011 at 19:38
Explore related questions
See similar questions with these tags.