Testing Process
Testing Process
3
Test, Test Case and Test Suite
•Test cases occupy a central position in testing.
•Test cases should have an identity .
•Need to record the execution history of a test case-
• When and by whom it was run,
• Pass/fail result of each execution
• Version (of software) on which it was run.
5
Life Cycle model for Testing
In the development phases, three opportunities arise for
errors to be made, resulting in faults that propagate
through the remainder of the development process.
Disadvantages:
•Significant redundancies may exist among test cases.
•Possibility of gaps of untested software.
Functional Test cases Identification
Functional methods are based on the specified behavior.
15
Functional Vs Structural Testing
Identification of test cases
Functional testing - Specification
Structural testing - program source code
•To find all errors in the program, the criterion is exhaustive input
testing, making use of every possible input condition as a test
case. 18
White Box Testing
•White-box or logic-driven testing, permits to examine the internal
structure of the program.
•Exhaustive path testing. is, if you execute, via test cases, all possible
paths of control flow through the program.
19
Quotes - The Art of Software Testing - Glenford Myers,
“A good test case is one that has a high probability of detecting an as-
yet undiscovered error.”
”One should start with the assumption that the program contains errors
and then test the program to find as many of the errors as possible. ”
20
Exhaustive Testing is Impossible
21
The domain of possible inputs is too large to test
We cannot test the program’s response to every possible input
Valid inputs
Invalid inputs
22
Too many possible paths through the program to test
23
Domain of Possible Tests
24
Exhaustive Testing is Impossible-Example
3 Equilateral- triangle test cases for the triangle program-No way
guarantees the correct detection of all equilateral triangles.
25
Exhaustive Testing is Impossible-Example
To be sure of finding all such errors, you have to test
using not only all valid inputs, but all possible inputs. Hence, to test the
triangle program exhaustively, you would have to produce virtually an
infinite number of test cases, which, of course, is not possible.
26
Effective Vs Exhaustive Testing
• Exhaustive or complete software testing means that every
statement in the program and every possible path combination
with every possible combination of data must be executed.
28
10 Software Testing Principles
29
Software Testing : Principle 1
Principle 1: A necessary part of a test case is a definition
of the expected output or result.
•If the expected result of a test case has not been predefined,
chances are that a plausible, but erroneous, result will be interpreted
as a correct result.
•Errors that are found on later tests are often missed in the results from
earlier tests.
33
Software Testing : Principle 5
Principle 5:Test cases must be written for input conditions
that are invalid and unexpected, as well as for those
that are valid and expected.
34
Software Testing : Principle 6
Principle 6: Examining a program to see if it does not do what
it is supposed to do is only half the battle; the other half is
seeing whether the program does what it is not supposed to do.
35
Software Testing : Principle 7
Principle 7: Avoid throwaway test cases unless the program is
truly a throwaway program.
•If test cases are not saved then whenever the program has to be tested
again the test cases must be reinvented.
• Saving test cases and running them again after changes to other
components of the program is known as regression testing.
36
Software Testing : Principle 8
Principle 8: Do not plan a testing effort under the tacit
assumption that no errors will be found.
37
Software Testing : Principle 9
Principle 9: The probability of the existence of more errors
in a section of a program is proportional to the number
of errors already found in that section.
•Errors tend to come in clusters and that, in the typical program, some
sections seem to be much more prone to errors than other sections.
38
Software Testing : Principle 10
Principle 10:Testing is an extremely creative and intellectually
challenging task.
•It is probably true that the creativity required in testing a large program
exceeds the creativity required in designing that program.
40
References