Tip:
Highlight text to annotate it
X
Testing just means checking a program to gain confidence that it's correct.
More formally, in a software engineering class we'd say that we want to gain confidence
that the implementation adheres to the specification as refined from the requirements.
I'm not going to spend much time on these words in this class.
You may have a chance to learn about them later.
But the implementation is your source code and the specification and requirements
come from the problem statements--whatever you were told to do in the quiz
or in the homework or by your boss or some such.
This is a bit of a personal aside, but in my mind,
one of the most important things about testing is noticing that it only gains you confidence.
It's not a proof.
If you have a big program like a web browser and you try it on 10 web pages
and it seems good, that is not a proof that it's always going to work perfectly in the future,
but it does give you more confidence than only trying it on 1 web page.
Probably. It depends on how cool that web page is.
So typically, programs are very big and accept an infinite set of inputs.
There are an infinite number of possible web pages out there.
We know that because the grammar for web pages is recursive
and allows for infinite creativity.
We could write down any work of literature and have it be a web page.
So we're not going to test them all in finite time;
we're only going to gain confidence by testing a few.
And because we can't test everything, we have to pick the things to test well.
Just like in the previous quiz, we don't want to waste time on test cases
that aren't going to get us a debug.
In the real world, in commercial software engineering
testing is a huge cost.
In fact, maintenance often accounts for 90% of the life cycle cost of software.
We spend very little time writing a program originally
and a huge amount of time maintaining it, refactoring it,
making it better in the face of changing ideas of what the users want,
all that sort of thing.
So testing is massive.