Free Sample
+ Collection

Android Application Testing Guide

Diego Torres Milano

This book assumes no prior experience of testing your Android applications and introduces you to all the most effective techniques and tools. It digs deep with real-life examples to make learning easy and interesting.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849513500
Paperback332 pages

About This Book

  • The first and only book that focuses on testing Android applications
  • Step-by-step approach clearly explaining the most efficient testing methodologies
  • Real world examples with practical test cases that you can reuse

Who This Book Is For

If you are an Android developer looking to test your applications or optimize your application development process, then this book is for you. No previous experience in application testing is required.

Table of Contents

Chapter 1: Getting Started with Testing
Brief history
Software bugs
Why, what, how, and when to test
Types of tests
Android testing framework
Chapter 2: Testing on Android
Creating the Android main project
Creating the Android test project
Package explorer
Creating a test case
Running the tests
Debugging tests
Other command-line options
Chapter 3: Building Blocks on 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
The InstrumentationTestCase class
The ActivityTestCase class
The ActivityInstrumentationTestCase2 class
The ProviderTestCase2<T> class
The ServiceTestCase<T>
The TestSuiteBuilder.FailedToCreateTests class
Using external libraries in test projects
Chapter 4: Test Driven Development
Getting started with TDD
Creating a sample project—the Temperature Converter
Creating the TemperatureConverterActivityTests project
Adding functionality
Viewing our final application
Chapter 5: Android Testing Environment
Creating Android Virtual Devices
Running AVDs from the command line
Additional emulator configurations
Running monkey
Test scripting with monkeyrunner
Chapter 6: Behavior Driven Development
Brief history
Given, when, then
Chapter 7: Testing Recipes
Android Unit tests
Testing activities and applications
Testing files, databases, and ContentProviders
Testing exceptions
Testing local and remote services
Extensive use of mock objects
Testing Views in isolation
Testing parsers
Testing for memory leaks
Chapter 8: Continuous Integration
Building Android applications manually using Ant
Git—the fast version control system
Continuous Integration with Hudson
Chapter 9: Performance Testing and Profiling
Ye Olde Logge method
Performance tests in Android SDK
Using the Traceview and dmtracedump platform tools
Chapter 10: Alternative Testing Tactics
Building Android from source
TemperatureConverter code coverage
The undocumented Ant coverage target
Introducing Robotium
Testing on host's JVM
Introducing Robolectric

What You Will Learn

  • Apply testing techniques and utilize tools to improve Android application development
  • Learn the nuances of Unit and Functional testing and apply them to your Android projects
  • Create sample Android test projects to try out your testing techniques
  • Understand different development methodologies such as Test Driven Development and Behavior Driven Development
  • Test different components such as Activities, ContentProvider, Services, and so on that make up an Android application
  • 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

In Detail

It doesn't matter how much time you invest in Android design, or even how careful you are when programming; mistakes are inevitable and bugs will appear. This book will help you minimize the impact of these errors in your Android project and increase your development productivity. It will show you the problems that are easily avoided, to help get you quickly to the testing stage.

Android Application Testing Guide is the first and only book providing a practical introduction to the most common available techniques, frameworks, and tools to improve the development of your Android applications. Clear, step-by-step instructions show how to write tests for your applications and assure quality control using various methodologies.

The author's experience in applying application testing techniques to real world projects enables him to share insights on creating professional Android applications.

The book starts by introducing Test Driven Development, which is an agile component of the software development process and a technique where you will tackle bugs early on. From the most basic unit tests applied to a sample project to more sophisticated performance tests, this book provides a detailed description of the most widely used techniques in the Android testing world in a recipe-based approach.

The author has extensive experience of working on various development projects throughout his professional career. All this research and knowledge has helped create a book that will serve as a useful resource to any developer navigating the world of Android testing.


Read More