About the Book: Android Application Testing Guide 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. What you will learn from this book : 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
Recently I have fallen for Unit Testing. They are really cool. However, it is very hard to find good books covering this topic. When it comes to Android, it is even harder. Check out any on-line store. It will turn out that this book is the only one that covers this topic. Diego tries to provide you with the basic knowledge related to application testing at Android platform. At first chapter, you are presented various kinds of tests: Unit Tests, Mock objects and UI Tests, Integration tests, Functional tests, System test, Instrumentation, etc. Each of them are slightly different from others thus it is good to know what part of software development they cover. Second chapter covers different aspects of tests execution. You will learn here how to start test for single file for the whole suite, how to group tests using annotations and eventually, how to start tests from command line. At first glance, running tests from command line might seem to be not quite good idea - after all, you have an IDE. However, this may allow you to integrate test phase into your auto building process. This way, you can have your code build and tested at the same place. Third part makes you familiar with assertions and mock objects. Assertions make a lot of troubles for newcomers because they are slightly unintuitive at the very beginning. Diego explains this topic quite easily and provides description of most common used assertion related methods. Mock objects are something different. They allow you to pretend the actual objects. This is quite important especially in case of database related testing. Fourth chapter is devoted to Test Driven Development. This approach is really cool. At first it looks slightly awkward - you have to write something that tests things that do not exist. However, after you start using it, you won't be able to imagine any other way of development. Well, I exaggerate a little bit, but there is part of true in this statement. Keep in mind that each approach has its flaws and there is no silver bullet, how Mr. Brooks used to say. TDD may not be applicable to your particular use case. But still, it is worth considering. Chapter eight covers very interesting topic related to continuous integration. In any sufficiently large project it is more than required to have continuous integration provided by automatic build and automatic test processes. One issue here is that this topic is not covered very extensively. If you read the book, it might look like a quite easy thing to do. Believe me it is not. Usually it turns out that you have lots of exceptions from the general build rules and you have to deal with them. However, this is nice introduction to the topic. Profiling is not covered perfectly as well. This is a biggest issue of all the books that cover testing related contents. They tend to show you how to measure things but they doesn't explain how to interpret them. In fact it may end up with using R and some statistic related topics to get things well interpreted.
Drawbacks? There are always some. I think, in case of this book there are few but these are not the major flaws for the content. Book is slightly outdated, it doesn't cover most recent release of Eclipse and Android related SDKs. If you will use most recent Android SDK and most recent Eclipse release you will definitely be abel to tell the difference. Sometimes it is hard to follow the book because of these small differences. For example, you will notice that screen shoots represent something different from what you see on your screen. However, Diego provides you with detailed configuration he has used during book composition, this way you can install everything that is needed and you can configure environment exactly the same way as Diego did - this is a big plus for the author. Another issue are missing, so called, flavors of the topic. I miss here detailed description of how to test mock data from the database. This is really big topic. And it looks like everybody avoids it. How to create sample data, how to create good database related tests, how to combine artificial and real data during development. Diego doesn't cover this topic, however as an excuse for the author, I can say that there are very few places you can find description of this issue.