Everyday Unit Testing book by Gil Zilberfeld

The book Everyday Unit Testing is about understanding unit testing (and some integration testing) in real-life applications. In the book, we’re going deep into understanding where and why unit tests help us, the nuances of writing and reading tests, and how code becomes testable or not, depending on our design. We also go into Test Driven Development to help with better design and tests.

  • Testing economics – the economic rationale behind unit testing, actual and perceived benefits, and implementation costs.
  • Testing strategy – how to think about testing, both personally and at the team level. How unit testing fits inside the organization’s quality strategy, and how to sell unit testing to an opposing organization.
  • Tools – there are all kinds of tools in the unit testing world: test frameworks, mocking, coverage, build integration. How to pick the right tools, and what are the considerations.
  • Unit test attributes – what are the different properties that unit tests have, and how can we measure if those are good or not.
  • What to test – and what not to test in unit tests. Criteria to decide on when code requires testing at all, and considerations for unit, integration, or manual tests.
  • Working with legacy code, – patterns for modifying hard-to-test code to make it easier to test. How to make sure that testability considerations continue to find their way into the design.
  • Test failure – short and long-term practices for dealing with a test failure. How to find and fix the failure, and use it to enhance the protection. How to follow up on the continuous failure of tests.
  • Test maintenance – what happens after a year of writing tests, and suites are getting larger and slower to run.
  • Test-Driven Development – how TDD fits into the testing process, and how to make the best of it.