COEN 286: Software Quality Assurance and Testing -- fall, 2001
Testing Objectives
Prof. John Noll
Santa Clara University
Tue Nov 13 16:19:20 2001
1.1 What can be achieved?
- Complete testing is not possible.
- Testing ``completely'' means that there are no more undiscovered
errors. Not possible:
- too many inputs;
- too many paths;
- too complex ui.
1.2 The purpose of testing
The purpose of testing is to find problems.
- ``A test that reveals a problem is a success.''
- ``A test that did not reveal a problem was a waste of time.''
But, it does show that the specific problem is absent. Not a
complete waste of time.
The purpose of finding problems is to get them fixed.
2.1 Verification
- Inspection of specifications.
- Is the only kind of ``testing'' possible during early phases.
- Can be done by machines for certain kinds of inspection.
2.2 White box testing
Testing by execution using knowledge or design or implementation.
Coverage
if (A > B && C == 0) {
C = 1;
}
D = A / D;
- statement: all statements are executed at least once.
This is harder than it sounds: defensive programming makes some
code hard to get to.
if (f = fopen(path)) {
perror("fopen");
}
- branch: all branches are taken.
- condition: all conditions on branches are evaluated true and false.
Only this will catch bug above.
- cyclomatic.
- path: all paths are tested.
2.3 Black Box Testing
Functional testing of program features as specified.