Book description
Improve your Android applications through intensive testing and debugging
In Detail
This book is a practical introduction to readily available techniques, frameworks, and tools to thoroughly test your Android applications and improve project development.
You will learn the Java testing framework, how to create a test case and debug it. Next, you'll be walked through using the Android SDK to test using the ActivityTestCase and ActivityUnitTest classes as well as discussing popular testing libraries. Through examples you will test files, databases, ContentProviders, exceptions, services, and test your app using Espresso. You will discover how to manage your Android testing environment using Android emulators, deep dive into how adb and the emulator can super charge your testing automation, and also test user interactions with monkeyrunner. You will be guided through different testing methodologies including Test-driven Development and Behavior-driven Development and will learn how to perform Unit and Functional testing applying them to your Android projects. You will also use continuous integration techniques for ultimate application quality control using Gradle and Jenkins.
By the end of the book, you'll be looking through alternative testing tactics including Fest and Spoon to build upon and expand your Android testing range and finesse.
What You Will Learn
- Apply testing techniques and utilize tools to improve Android application development
- Get to grips with the nuances of testing on Android, including how to architect an application to facilitate better testing
- Explore the Android instrumentation testing framework to optimize your activities, services, content providers, and usage of other Android components
- Understand different development methodologies including Test-driven Development and Behavior-driven Development
- Apply the continuous integration technique for ultimate application quality control
- Improve application performance by analyzing the results returned from performance tests
- Expose your application to a wide range of conditions and configurations to simulate real-life network conditions and detect problems in the application
- Explore further tools to improve application quality such as micro benchmarks and code coverage
Table of contents
-
Learning Android Application Testing
- Table of Contents
- Learning Android Application Testing
- Credits
- About the Authors
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Getting Started with Testing
- Why, what, how, and when to test?
- Types of tests
- Java testing framework
- Android testing framework
-
Creating the Android project
- Package explorer
- Creating a test case
- Test annotations
- Running the tests
- Debugging tests
- Other command-line options
- Summary
-
2. Understanding Testing with the Android SDK
- The demonstration application
- Assertions in depth
- View assertions
- Even more assertions
- The TouchUtils class
- Mock objects
- The TestCase base class
- The AndroidTestCase base class
- Instrumentation
- The InstrumentationTestCase class
- The ActivityTestCase class
- The ActivityInstrumentationTestCase2 class
- The ProviderTestCase2<T> class
- The ServiceTestCase<T>
- The TestSuiteBuilder.FailedToCreateTests class
- Using libraries in test projects
- Summary
- 3. Baking with Testing Recipes
- 4. Managing Your Android Testing Environment
- 5. Discovering Continuous Integration
- 6. Practicing Test-driven Development
- 7. Behavior-driven Development
- 8. Testing and Profiling Performance
- 9. Alternative Testing Tactics
- Index
Product information
- Title: Learning Android Application Testing
- Author(s):
- Release date: March 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784395339
You might also like
video
Debugging and Testing Android Applications
In this Debugging and Testing Android Applications training course, expert author Chris Stanley will teach you …
book
Kotlin for Android App Development
Write More Robust and Maintainable Android Apps with Kotlin “Peter Sommerhoff takes a practical approach to …
book
Android Best Practices
Android Best Practices by Godfrey Nolan shows you how to make your Android apps stand out …
video
Gradle for Android
Whether you’re new to Gradle or an experienced Android developer, Java consultant Ken Kousen will help …