Published on

The 7 Principles of Software Testing

5 min read | 886 words
Authors
7 testing principles thumbnail

Intro

Software Testing is an important part of software development and maintenance. It’s a process that can be applied to any system, product, or service where the goal is to detect bugs before they are released into the world. Software testing includes static testing (checking for errors in code), dynamic testing (testing by executing programs), alpha-beta testing (where users test pre-release versions), and many other types of testing.

There are seven principles of software testing that provide a framework for quality assurance. These principles are important for any tester to know and understand.

1. Testing shows the presence of defects, not their absence

Reducing the chance of hidden flaws isn't proof of perfection, but testing does reduce the possibility of new flaws. For example, a test for the password requirements of a login system would check that the requirements are met. If the requirements aren't met, it would return an error. The tester can then investigate and determine if there's a problem with the code or if the requirements were incorrect. However, if all the problems are resolved, this still doesn't guarantee the prevention of future errors. A new requirement might be added that wasn't originally considered, or a change in technology could create new opportunities for error.

2. Exhaustive Testing is Impossible

It’s impossible to test every input, output, condition, and decision for every program. Instead, testers must select representative samples. For example, for a form input designed to only accept ages from 15 - 80, a tester could enter the values 14, 15, 80, and 81 to test the boundary conditions. On the other hand, if a select element provides two choices, "true" or "false", the tester could test both values.

3. Early Testing saves Time & Money

It’s cheaper and faster to fix errors when they are first introduced into the code. The later an error is found, the more expensive it is to fix. For example, if a bug is found during design, it may only require a change in the code. However, if the same bug is found during testing after code completion, it may require changes to the code, documentation, and user interface. The result is increased time and effort to resolve the issues.'/

4. Defects Cluster Together

Bugs tend to cluster together in certain areas of the code. The Pareto Effect (80/20) states that a small number of modules, 20% usually contain 80% of the defects. Therefore, testers should focus their attention on these areas to find the most defects. For example, if a tester is testing a login system where the team knows the authentication module is prone to frequent errors, they should focus their efforts on the authentication module since this is where most of the defects are likely to be found.

5. Beware of Pesticide Paradox

The pesticide paradox is the observation that the more you use a pesticide, the more resistant pests become to it. The same is true for software testing. The more you test, the more resistant defects become to detection. The reason why is because, if the same tests are done over and over again, they will no longer discover any new problems. To overcome this, testers must constantly adapt their testing techniques.

6. Testing is Context Dependent

The context in which a system is used affects the way it should be tested. For example, a system that is designed for use in a hospital will need to be tested differently than a system that is designed for use in a bank. The hospital system will need to be tested for things like patient safety and data privacy. The bank system will need to be tested for things like security and fraud prevention. Therefore, it’s important to consider the context in which a system will be used when determining how to design effective tests.

7. Absence of Error is a Fallacy

The goal of testing is to find as many errors as possible so they can be fixed before release. However, it’s impossible to find all errors. There will always be some defects that remain undetected. It is a misconception to believe that the success of a system can be guaranteed by finding and correcting a large number of faults. For example, a system with no faults may still be unusable if it does not meet the needs of the user. A real-life example is the failure of Google+ to compete with Facebook. Google+ had no major security flaws, but it was not successful because it did not meet the needs of users.

Conclusion

The seven principles of software testing provide a framework for quality assurance. They are important for any tester to know and understand. By following these principles, testers can find and fix defects before they are released into the world.