Android Testing Guide
Android Testing Guide
Practical tips and techniques for testing real-world Android applications
About the Book
Have you gotten your hands dirty with Android application development, but lack a reliable test coverage? Does your application testing procedure consist of just a series of manual view clicks? Do you spend hours testing your entire app everytime you want to make a release? Or do you just cross your fingers and hope for the best that everything will just work?
Don't worry, everyone has been there at some point. The only problem is that testing can be a tricky thing (especially in the Android world). In fact, it's quite possible that your codebase, as it currently stands, is untestable! What you may not realize is that, while, yes, testing does help to ensure that your code works as expected, following this pattern will also make you a better developer. That messy, untestable spaghetti code that you might have snuck into your project in the past will never happen again. Trust me, as soon as you bring the phrase "how could I test this?" to the forefront of every new piece of code you write, you'll, with a smile on your face, look back to your former self, and laugh at your crazy, cowboy ways. Welcome to modern software development world.
I'll show you how I got past that hurdle, started writing robust and more maintainable code, increasing my code's trustworthiness and saving countless hours of debugging unforeseen bugs.
As the book progresses towards completion, the price may gradually increase. By buying early you not only provide motivation, but you also get a good deal because you get all updates for free. The target date for next version is end of November.
Table of Contents
- About the Author
- About the Reviewers
-
Welcome
- Exercises
- Errata
- How to Consume This Book
- Get in Touch
- Is this book for you?
- Intro
-
1 Test Everything
- 1.1 You already know testing
- 1.2 Takeaways from TDD
- 1.3 What Should I Test?
- 1.4 Signs of Untestable Code
- 2.2 Beyond JUnit basics
- 2.3 Rules
- 2.4 Assertions
- 2.5 Hamcrest
-
3 Easier Testing With Mockito
- 3.1 Why Mockito?
- 3.2 Test Doubles
- 3.3 Verify
- 3.4 ArgumentCaptor
-
4 Testing on Android
- 4.1 Local Tests
- 4.2 Instrumented tests
- 4.3 Android test rules
- 4.4 Rule to test Android Activity
- 4.5 Rule to test Android Service
- 4.6 Rule to test Android Intents
- 4.7 Android instrumented tests
- 4.8 Test filtering
-
5 Espresso
- 5.1 Basics
- 5.2 Testing RecyclerView
- 5.3 Testing Toast
- 5.4 Testing Intents
- 5.5 Testing Synchronisation with background jobs
- 5.6 Espresso utils
-
6 Robolectric
- 6.1 Testing Activities
- 6.2 Testing Fragments
- 6.3 Testing Sqlite
- 6.4 Testing Job Scheduler
-
7 REST API Testing on Android.
- 7.1 MockWebServer
- 7.2 RESTMock
- 7.3 WireMock
-
8 Testing Android Persistance
- 8.1 Testing Sqlite
- 8.2 Testing Realm
- 8.3 Testing Room
-
9 Practical Android Testing
- 9.1 Introduction to MVP, MVVM
- 9.2 Testing Presenters
- 9.3 Testing RxJava
-
10 Kotlin Android Testing
- 10.1 Issues
- 10.2 Spek
- 10.3 Mockito Kotlin
-
11 Code Quality
- 11.1 Checkstyle
- 11.2 PMD
- 11.3 Findbugs
- 11.4 Code coverage with Jococo
-
12 Continuous Integration
- 12.1 Travis CI
- 12.2 Circle CI
- 12.3 BuddyBuild
- 12.4 Bitrise
-
13 Extra concepts
- 13.1 Asserting with assertThat
- 13.2 Assertj
- 13.3 EasyMock
- 13.4 PowerMock
- 13.5 MonkeyRunner
- 13.6 Robotium
- 13.7 UI testing and UI Automator
-
14 Misc
- 14.1 Bad tests to Good tests
- 14.2 Behavior-driven development
- 14.3 Contributing to open-source
- References
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them