ST Mod1 CH1
ST Mod1 CH1
A perspective on
Testing
Basic Definitions:
Errors
• People make Errors.
• A synonym for error is mistake.
• When people make mistakes while coding , they are
called bugs.
• Errors tend to propagate.
Ex: a requirement error may be magnified during design
and amplified still more during coding.
Fault
• A fault is the result of an error.
• Defect is a good synonym for fault.
2 types of faults.
1. Faults of omission
2. Faults of commission
• Fault of omission occurs when we fail to enter correct
information.
• Fault of commission occurs when we enter something
into a representation that is incorrect.
• Usually, the set of all possible inputs is too large for the program to
be executed on each input.
Definition: Correctness
• A program is considered correct if it behaves as
expected on each element of its input domain.
1.3.2 Valid and Invalid Inputs:
• The input domains are derived from the
requirements. It is difficult to determine the input
domain for incomplete requirements.
integer x, y
input x, y
if(x<y) ->this condition should be x≤𝑦
{
print f(x, y)
}
else
{
print g(x, y)
}
• Suppose that function f produces incorrect result whenever it
is invoked with x=y and that f(x, y)≠ g(x, y), x=y.
• In its present form the program fails when tested with equal
input values because function g is invoked instead of function f.
Correctness Reliability
Binary Metric Continuous metric from 0 to 1
Purpose
Preconditions
Inputs
Expected Outputs
Post Conditions
Execution History
• The tests are generated using a mix of formal and informal methods
either directly from the requirements document serving as the source.
• Two types:
Requirement walkthrough
• Test team must review Requirements to match User needs and are
Free from ambiguities and inconsistencies