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

As Dijkstra used to say, “Program testing can be used to show the presence of bugs, but never to show their absence.” In other words, while we may find more bugs by simply testing more, our test suites, however large they may be, will never ensure that the software system is 100% bug-free. They will… Continue reading No matter what testing you do, it will never be perfect or enough

Bugs happen in some places more than others

As I said earlier, given that exhaustive testing is impossible, software testers have to prioritize the tests they perform. When prioritizing test cases, note that bugs are not uniformly distributed. Empirically, our community has observed that some components present more bugs than others. For example, a Payment module may require more rigorous testing than a Marketing module. As a… Continue reading Bugs happen in some places more than others

Variability is important (the pesticide paradox)

There is no silver bullet in software testing. In other words, there is no single testing technique that you can always apply to find all possible bugs. Different testing techniques help reveal different bugs. If you use only a single technique, you may find all the bugs you can with that technique and no more.… Continue reading Variability is important (the pesticide paradox)

Exhaustive testing is impossible

We do not have the resources to completely test our programs. Testing all possible situations in a software system might be impossible even if we had unlimited resources. Imagine a software system with “only” 300 different flags or configuration settings (such as the Linux operating system). Each flag can be set to true or false… Continue reading Exhaustive testing is impossible

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

A simplistic view of software testing is that if we want our systems to be well tested, we must keep adding tests until we have enough. I wish it were that simple. Ensuring that programs have no bugs is virtually impossible, and developers should understand why that is the case. In this section, I discuss… Continue reading Principles of software testing (or, why testing is so difficult)

The role of test automation

Automation is key for an effective testing process. Every test case we devise here is later automated via a testing framework such as JUnit. Let me clearly distinguish between test case design and test case execution. Once a test case is written, a framework runs it and shows reports, failures, and so on. This is all that these… Continue reading The role of test automation

The meaning of effective and systematic

I have been using two words to describe how I expect a developer to test: effectively and systematically. Being effective means we focus on writing the right tests. Software testing is all about trade-offs. Testers want to maximize the number of bugs they find while minimizing the effort required to find the bugs. How do we achieve this? By knowing… Continue reading The meaning of effective and systematic

The cost of testing

You may be thinking that forcing developers to apply rigorous testing may be too costly. Figure 1.4 shows the many techniques developers have to apply if they follow the flow I am proposing. It is true: testing software properly is more work than not doing so. Let me convince you why it is worth it:

The myth of “correctness by design”

Now that you have a clearer picture of what I mean by effective and systematic software testing, let me debunk a myth. There is a perception among software developers that if you design code in a simple way, it will not have bugs, as if the secret of bug-free code is simplicity. Empirical research in… Continue reading The myth of “correctness by design”