Learning Android™ Application Programming: A Hands-On Guide to Building Android Applications
by James Talbot, Justin McLean, Jorge Hernandez
Summary
Testing your Android application code is essential, because you want to know whether changes to your code have been successful and whether they’ve introduced any new errors.
Writing test scripts using the JUnit testing framework gives you a better method of testing your application. Your scripts can be used repeatedly for testing whenever you make changes to your code. You can use the Eclipse IDE to assist with the tests.
You create new classes to contain the annotated methods for each of your tests, and inside each test method you write code to test and assert what you expect to be true (or false). If an assertion fails, an exception will be thrown and the test will fail. Best practice for speeding up your tests and making testing easier ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access