Fundamentals of testing – Why is testing necessary?

Why is testing necessary?

Testing is necessary because we all make mistakes. Some of those mistakes are unimportant, but some of them are expensive or dangerous. We need to check everything and anything we produce because things can always go wrong.

Because we should assume our work contains mistakes, we all need to check our own work. However, some mistakes come from bad assumptions and blind spots, so we might make the same mistakes when we check our own work as we made when we did it. So we may not notice the flaws in what we have done. Ideally, we should get someone else to check our work – another person is more likely to spot the flaws.

Causes of software defects

Why is it that software systems sometimes do not work correctly? If someone makes an error or mistake in using the software, this may lead directly to a problem, the software is used incorrectly and so does not behave as we expected. However, people also design and build the software and they can make mistakes during the design and build. These mistakes mean that there are flaws in the software itself. These are called defects or sometimes bugs or faults.

When the software code has been built, it is executed and then any defects may cause the system to fail to do what it should do (or do something it shouldn’t), causing a failure. Not all defects result in failures; some stay dormant in the code and we may never notice them.

When we think about what might go wrong we have to consider defects and failures arising from:

    • errors in the specification, design and implementation of the software and system

 

    • errors in use of the system

 

    • environmental conditions

 

    • intentional damage

 

    • potential consequences of earlier errors, intentional damage, defects and failures

 

What is the cost of defects?

As well as considering the impact of failures arising from defects we have not found, we need to consider the impact of when we find those defects. The cost of finding and fixing defects rises considerably across the life cycle.

If an error is made and the consequent defect is detected in the requirements at the specification stage, then it is relatively cheap to find and fix. The specification can be corrected and re-issued. Similarly if an error is made and the consequent defect detected in the design at the design stage then the design can be corrected and re-issued with relatively little expense.

If however a defect is introduced in the requirement specification and it is not detected until acceptance testing or even once the system has been implemented then it will be much more expensive to fix. This is because rework will be needed in the specification and design before changes can be made in construction; because one defect in the requirements may well propagate into several places in the design and code; and because all the testing work done-to that point will need to be repeated in order to reach the confidence level in the software that we require.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.