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. ...

Get Android in Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.