1 Effective and systematic software testing


This chapter covers

  • Understanding the importance of effective, systematic testing
  • Recognizing why testing software is difficult and why bug-free systems do not exist
  • Introducing the testing pyramid

The developer community no longer needs to argue about the importance of software testing. Every software developer understands that software failures may cause severe damage to businesses, people, or even society as a whole. And although software developers once were primarily responsible for building software systems, today they are also responsible for the quality of the software systems they produce.

Our community has produced several world-class tools to help developers test, including JUnit, AssertJ, Selenium, and jqwik. We have learned to use the process of writing tests to reflect on what programs need to do and get feedback about the code design (or class design, if you are using an object-oriented language). We have also learned that writing test code is challenging, and paying attention to test code quality is fundamental for the graceful evolution of the test suite. And finally, we know what the common bugs are and how to look for them.

1.1 Developers who test vs. developers who do not

1.2 Effective software testing for developers

1.2.1 Effective testing in the development process

1.2.2 Effective testing as an iterative process

1.2.3 Focusing on development and then on testing

1.2.4 The myth of “correctness by design”

1.2.5 The cost of testing

1.2.6 The meaning of effective and systematic

1.2.7 The role of test automation

1.3 Principles of software testing (or, why testing is so difficult)

1.3.1 Exhaustive testing is impossible

1.3.2 Knowing when to stop testing

1.3.3 Variability is important (the pesticide paradox)

1.3.4 Bugs happen in some places more than others

1.3.5 No matter what testing you do, it will never be perfect or enough