Learning Android™ Application Programming: A Hands-On Guide to Building Android Applications
by James Talbot, Justin McLean, Jorge Hernandez
Testing with JUnit
When you make changes to your code, how do you know they’ve worked and have been successful? Throughout this book you’ve made changes, fixed any errors, and then tested the On Your Bike app in the emulator or on your device to see whether the changes worked. But this practice can be prone to error. For example, you may miss errors or, even worse, introduce new errors.
There is a better way to test your app: by writing test scripts that test the entire app. These test scripts can be run over and over again, as needed, and can even be run automatically.
To test Android applications, you can use JUnit, an open source testing framework. It’s licensed under the Eclipse Public License and based on the many other xUnit unit-testing ...
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