For my most recent project, a very large tablet app, I've been experimenting with the Android Testing Framework. My piece of the app is the backend integration consisting of a number of different API calls that send and receive JSON, handle login and more. The app will utilize content providers to enable other apps to access the database. I'm specifically using the test framework to exercise these content providers as well as the services that integrate with the backend.
While there is some overhead with learning the test framework. it's very useful. There's a few gotchas that slow down setting up your tests. A good one is why doesn't my test run? Test methods need to start with the word test. So testMyInsertCode() will run while doMyInsertCodeTest() won't. Content provider testing has some specific requirements to set up the mock statements as well. Be sure when testing queries that you don't forget to put the =? on the end of the where clauses....
No comments:
Post a Comment