Android Application Testing Guide

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.

Android Application Testing Guide

Diego Torres Milano

1 customer reviews
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.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.90
RRP $26.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.90
$44.99
$29.99p/m after trial
RRP $26.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781849513500
Paperback332 pages

Book Description

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.

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
Summary
Chapter 2: Testing on Android
JUnit
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
Summary
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
Instrumentation
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
Summary
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
Summary
Chapter 5: Android Testing Environment
Creating Android Virtual Devices
Running AVDs from the command line
Additional emulator configurations
Running monkey
Test scripting with monkeyrunner
Summary
Chapter 6: Behavior Driven Development
Brief history
Given, when, then
FitNesse
GivWenZen
Summary
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
Summary
Chapter 8: Continuous Integration
Building Android applications manually using Ant
Git—the fast version control system
Continuous Integration with Hudson
Summary
Chapter 9: Performance Testing and Profiling
Ye Olde Logge method
Performance tests in Android SDK
Using the Traceview and dmtracedump platform tools
Microbenchmarks
Summary
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
Summary

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

Authors

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
Summary
Chapter 2: Testing on Android
JUnit
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
Summary
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
Instrumentation
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
Summary
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
Summary
Chapter 5: Android Testing Environment
Creating Android Virtual Devices
Running AVDs from the command line
Additional emulator configurations
Running monkey
Test scripting with monkeyrunner
Summary
Chapter 6: Behavior Driven Development
Brief history
Given, when, then
FitNesse
GivWenZen
Summary
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
Summary
Chapter 8: Continuous Integration
Building Android applications manually using Ant
Git—the fast version control system
Continuous Integration with Hudson
Summary
Chapter 9: Performance Testing and Profiling
Ye Olde Logge method
Performance tests in Android SDK
Using the Traceview and dmtracedump platform tools
Microbenchmarks
Summary
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
Summary

Book Details

ISBN 139781849513500
Paperback332 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Android 4: New Features for Application Development Book Cover
Android 4: New Features for Application Development
$ 14.99
$ 10.50
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
Android Database Programming Book Cover
Android Database Programming
$ 23.99
$ 16.80
Android NDK Beginner’s Guide Book Cover
Android NDK Beginner’s Guide
$ 29.99
$ 21.00
Android User Interface Development: Beginner's Guide Book Cover
Android User Interface Development: Beginner's Guide
$ 26.99
$ 18.90