Log In
Or create an account -> 
Imperial Library
  • Home
  • About
  • News
  • Upload
  • Forum
  • Help
  • Login/SignUp

Index
Android Application Testing Guide
Android Application Testing Guide Credits About the Author About the Reviewers www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe? Free Access for Packt account holders
Preface
What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support
Downloading the example code Errata Piracy Questions
1. Getting Started with Testing
Brief history Software bugs
How bugs severely affect your projects
Why, what, how, and when to test
What to test
Activity lifecycle events Database and filesystem operations Physical characteristics of the device
Types of tests
Unit tests
The test fixture The setUp() method The tearDown() method Test preconditions The actual tests
Mock objects UI tests Eclipse and other IDE support
Integration tests Functional or acceptance tests
Test case scenario
Performance tests System tests
Android testing framework
Instrumentation Test targets
Summary
2. Testing on Android
JUnit Creating the Android main project Creating the Android test project Package explorer Creating a test case
Special methods Test annotations
Running the tests
Running all tests from Eclipse Running a single test case from Eclipse Running from the emulator Running tests from the command line
Running all tests Running tests from a specific test case Running a specific test by name Running specific tests by category
Creating a custom annotation
Running performance tests Dry run
Debugging tests Other command-line options Summary
3. Building Blocks on the Android SDK
The demonstration application Assertions in depth
Custom messages Static imports
View assertions Even more assertions The TouchUtils class Mock Objects
MockContext overview The IsolatedContext class Alternate route to file and database operations The MockContentResolver class
The TestCase base class
The no-argument constructor The given name constructor The setName() method
The AndroidTestCase base class
The assertActivityRequiresPermission() method
Description Example
The assertReadingContentUriRequiresPermission method
Description Example
The assertWritingContentUriRequiresPermission() method
Description Example
Instrumentation
The ActivityMonitor inner class
Example
The InstrumentationTestCase class
The launchActivity and launchActivityWithIntent method The sendKeys and sendRepeatedKeys methods The runTestOnUiThread helper method
The ActivityTestCase class
The scrubClass method
The ActivityInstrumentationTestCase2 class
The constructor The setUp method The tearDown method The testPreconditions method
The ProviderTestCase2<T> class
The constructor Example
The ServiceTestCase<T>
The constructor
The TestSuiteBuilder.FailedToCreateTests class Using external libraries in test projects Summary
4. Test Driven Development
Getting started with TDD
Writing a test case Running all tests Refactoring the code What is the advantage? Understanding the requirements
Creating a sample project—the Temperature Converter
The list of requirements User interface concept design
Creating the projects
Creating the TemperatureConverterActivityTests project
Creating the fixture Test preconditions Creating the user interface Testing the existence of the user interface components Getting the IDs defined Translating requirements to tests
Empty fields View properties
Screen layout
Adding functionality
Temperature conversion The EditNumber class TemperatureConverter unit tests The EditNumber tests The TemperatureChangeWatcher class More TemperatureConverter tests The InputFilter tests
Viewing our final application Summary
5. Android Testing Environment
Creating Android Virtual Devices Running AVDs from the command line
Headless emulator Disabling the keyguard Cleaning up Terminating the emulator
Additional emulator configurations
Simulating network conditions Additional qemu options
Running monkey
Client-server monkey
Test scripting with monkeyrunner
Getting test screenshots Record and playback
Summary
6. Behavior Driven Development
Brief history Given, when, then FitNesse
Running FitNesse from the command line Creating a TemperatureConverterTests subwiki
Adding child pages to the subwiki Adding the acceptance test fixture Adding the supporting test classes
GivWenZen
Creating the test scenario
Summary
7. Testing Recipes
Android Unit tests Testing activities and applications
Applications and preferences
The RenamingMockContext class The TemperatureConverterApplicationTests class
Testing activities
Testing files, databases, and ContentProviders
The BrowserProvider tests
Testing exceptions Testing local and remote services Extensive use of mock objects
Importing libraries The testTextChanged test Introducing Hamcrest
Hamcrest matchers The hasToString matcher
Testing Views in isolation Testing parsers
Android assets The parser activity The parser test
Testing for memory leaks Summary
8. Continuous Integration
Building Android applications manually using Ant Git—the fast version control system
Creating a local git repository
Continuous Integration with Hudson
Installing and configuring Hudson Creating the jobs Obtaining Android test results
Summary
9. Performance Testing and Profiling
Ye Olde Logge method Performance tests in Android SDK
Launching the performance test
Creating the LaunchPerformanceBase instrumentation Creating the TemperatureConverterActivityLaunchPerformance class
Running the tests
Using the Traceview and dmtracedump platform tools Microbenchmarks
Caliper microbenchmarks
Creating the TemperatureConverterBenchmark project Running caliper
Summary
10. Alternative Testing Tactics
Building Android from source
Code coverage
EMMA features
System requirements Downloading the Android source code
Installing repo Creating the working copy The Building Steps
TemperatureConverter code coverage
Generating code coverage analysis report Covering the restoring the instance state Covering the exceptions Bypassing access restrictions Covering the options menu
The undocumented Ant coverage target Introducing Robotium
Downloading Robotium Configuring the project Creating the test cases
The testFahrenheitToCelsiusConversion() test The testOnCreateOptionsMenu() revisited
Testing on host's JVM
Creating the TemperatureConverterJVMTest project Comparing the performance gain Adding Android to the picture
Introducing Robolectric
Installing Robolectric Creating a new Java project Writing some tests
Summary
  • ← Prev
  • Back
  • Next →
  • ← Prev
  • Back
  • Next →

Chief Librarian: Las Zenow <zenow@riseup.net>
Fork the source code from gitlab
.

This is a mirror of the Tor onion service:
http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion