4 Tasty testing

 

This chapter covers

  • Why we hate testing and how we can love it
  • How to make testing more enjoyable
  • Avoiding TDD, BDD, and other three-letter acronyms
  • Deciding what to test
  • Doing less work using tests
  • Making tests spark joy

Many software developers would liken testing to writing a book: it’s tedious, nobody likes doing it, and it rarely pays off. Compared to coding, testing is considered a second-class activity, not doing the real work. Testers are subjected to a preconception that they have it too easy.

The reason for the dislike of testing is that we developers see it as disconnected from building software. From a programmer’s perspective, building software is all about writing code, whereas from a manager’s vantage point, it’s all about setting the right course for the team. Similarly, for a tester, it’s all about the quality of the product. We consider testing an external activity because of our perception that it’s not part of software development, and we want to be involved as little as possible.

Testing can be integral to a developer’s work and can help them along the way. It can give you assurances that no other understanding of your code can give you. It can save you time, and you don’t even need to hate yourself for it. Let’s see how.

4.1 Types of tests

4.1.1 Manual testing

4.1.2 Automated tests

4.1.3 Living dangerously: Testing in production

4.1.4 Choosing the right testing methodology

4.2 How to stop worrying and love the tests

4.3 Don’t use TDD or other acronyms

4.4 Write tests for your own good

4.5 Deciding what to test

4.5.1 Respect boundaries

4.5.2 Code coverage