Chapter 13. Testing and instrumentation

 

In this chapter

  • Unit testing
  • Testing activities with instrumentation
  • Mock objects and stubs
  • Input testing with the Monkey tool

I tread paths by moonlight that others fear to speak of during day.

Patrick Rothfuss, The Name of the Wind

If there’s one topic that polarizes the software development community, it must be testing. Though testing is commonly understood as a true development task, as opposed to being a duty of “the QA guys,” many programmers still try to avoid it like the plague. (If you don’t fall into that group, feel free to skip the initial motivation that follows.)

Why is that? From our experience, there are two main reasons why programmers don’t write tests: ignorance and arrogance. Ignorance, the unwitting kind, is most often found with programmers who don’t come from a development background where test-oriented or test-driven development are commonplace, and who aren’t familiar with the benefits of testing methodologies (unfortunately, mobile application developers often fall into that category). Even if they’re familiar with the concepts, they often don’t cherish the value of software tests, and therefore perceive writing tests as cumbersome, something “you know you should be doing but aren’t in the mood for just now.” After all, you need to get that milestone done and report progress to your senior, so why waste time writing tests, right?

13.1. Testing the Android

 
 

13.2. Pulling strings: Android instrumentation

 

13.3. Beyond instrumentation: mocks and monkeys

 
 
 
 

13.4. Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest