ST Module1
ST Module1
By
Mr. Hemanth Kumar
Asst.Professor,
Dept of MCA,RNSIT
1
Basics of Software Testing
Basic Definitions
Error:
A good synonym is mistake.
When people make mistakes while coding, we call
these mistakes as bugs.
Errors tend to propagate and requirements error
may be magnified during design and amplified still
more during coding.
2
Basics of Software Testing(contd..)
Fault:
A fault is the result of an error
It is the representation of an error, where
representation is the mode of expression, such as
narrative text, data flow diagrams, hierarchy
charts, source code, and so on
Defect is a good synonym for fault.
3
Basics of Software Testing(contd..)
Types of Fault:
Fault of omission occurs when we fail to enter correct
information. (Some details are missed out in specifications
and additional details are implemented)
Fault of commission occurs when we enter something into
a representation that is incorrect. (Mentioned in
Specifications but missed out while implementing) or
Omission/commission:
Omission - neglecting to include some entity in a module
Commission - incorrect executable statement
4
Basics of Software Testing(contd..)
Failure:
A failure occurs when a fault executes
Two subtleties arise here: one is that failures only
occur in an executable representation, which is
usually taken to be source code, or loaded object
code
Second subtlety is that, this definition relates
failures only to faults of commission.
5
Basics of Software Testing(contd..)
Incident:
When a failure occurs, it may or may not be readily apparent to the user (or customer or tester)
An incident is the symptom associated with a failure that alerts the user to the occurrence of failure
Test:
Testing is concerned with errors, faults, failures, and incidents.
A test is the act of exercising software with test cases. A test has two distinct goals: to find failures or to demonstrate correct execution
Test Case:
Test case has an identity and is associated with a program behavior. A test case also has a set of inputs and a list of expected outputs.
6
Basics of Software Testing(contd..)
What is testing?
Software testing is a process used to identify the correctness,
completeness and quality of developed computer software.
The process of devising a set of inputs to a given piece of
software that will cause the software to exercise some
portion of its code.
The developer of the software can then check that the results
produced by the software are in accord with his or her
expectations.
7
A Testing life cycle
8
Test cases
9
Software quality
10
Requirements, Behavior and Correctness
11
Correctness versus Reliability
Correctness
Correctness is the process of testing a program on all
elements in the input domain. In most cases this is
impossible to accomplish. Thus, correctness is
established via mathematical proofs of programs.
While correctness attempts to establish that the
program is error free, testing attempts to find if there
are any errors in it.
Testing, debugging and the error removal processes
together increase our confidence in the correct
functioning of the program under test.
12
Correctness versus Reliability
Reliability
The reliability of a program P is the probability of
its successful execution on a randomly selected
element from its input domain. Example: Consider
a program P whose inputs are {< (0, 0) (-1, 1) (1, -
1)>}. If it is known that P fails on exactly one of
the three possible input pairs then the frequency
with which P will function correctly is 2/3.
13
Testing and debugging
14
Testing and debugging
15
Test- generation Strategies
16
Test- generation Strategies
17
Test- generation Strategies
The top row captures techniques that are applied directly to the
requirements.
Another set of strategies falls under the category of model-based test
generation.
These strategies require that a subset of the requirements be modeled using
a formal notation.
Languages based on predicate logic as well as algebraic languages are also
used to express subsets of requirements. This model is also known as
specification of the subset of requirements.
Finite State Machines, state charts, timed I/O automata and Petri nets are
some of the formal notations for modeling various subsets of the
requirements. Code based test generation generate tests directly from the
code.
18
Test Metrics
• Test metrics are indicators of the efficiency,
effectiveness, quality and performance of software
testing techniques. These metrics allow professionals
to collect data about various testing procedures and
devise ways to make them more efficient.
Benefits Of Software Testing Metrics
i) Save Time
ii) Improve Quality
iii) Measure Progress
Department of ISE,RNSIT 19
2021
The term metric refers to a standard of measurement. In software testing there exist a variety
of metrics
20
Test Metrics
There are four general core areas that assist in the design of metrics.
They are schedule, quality, resources and size.
Schedule related metrics: Measure actual completion times of
various activities and compare these with estimated time to
completion.
Quality related metrics: Measure quality of a product or a
process
Resource related metrics: Measure items such as cost, man
power and test execution.
Size-related metrics: Measure size of various objects such as
the source code and number of tests in a test suite.
21
Static and dynamic metrics
22