What test coverage should we aim for?

Disregarding the fact that test coverage doesn’t say anything about the quality of your code, the quality of your tests, missing features, or failure to address one or more quality attributes, the question is quite simple.

If you apply testing techniques intentionally and systematically to the code that you write, or use test-driven development to design it, the test coverage will be above 90% as a side effect of those practices.

Book References
Read more about these topics in Developer Testing: Building Quality into Software:

  • Chapter 8: Specification-based Testing Techniques, pages 107-117
  • Chapter 15: Test-driven Development—Classic Style, pages 191, 204-205
  • Chapter 16: Duplication, page 226