ST1-Introduction To Software Testing
ST1-Introduction To Software Testing
Testing
Content
2
What Is Software Testing
◼ Software testing is one of the methods to
assure software quality.
◼ Software quality assurance involves
validation and verification of software.
Validation: requirements specification
consistent
Do we build the right software?
Verification: specification implementation
consistent
Do we build the software right?
3
Software Verification
4
Software Testing
5
Error, Fault, Failure, and Incident
6
Test Cases
◼ Software testing is the act of executing
software with a suite of test cases so that it
can find faults in the program.
◼ A test case contains a list of test inputs and a
list of corresponding expected outputs.
◼ Each test case is associated with a specific
program behavior.
7
The Testing Life Cycle
error
Fault
Specification fault
Resolution
error
Fault
Design fault
Isolation
error
Fault
Coding fault Static verification
Classification
can be used to
incident
detect faults in
specification and
Testing
design early.
8
Why Do We Need Software Testing
9
Example: THERAC-25 Radiation Therapy
10
Example: Shooting down Airbus 320
11
Example: London Ambulance Service
◼ London Ambulance Service (LAS) Computer
Aided Dispatch automates many of the
human-intensive processes of manual
dispatch systems associated with ambulance
services in the UK.
◼ Failure of the LAS on 26 and 27 November
1992.
◼ At 23:00 on November 28 the LAS eventually
instigated a backup procedure, after the
death of at least 20 patients.
12
Example: Mars Climate Orbiter
◼ In 1999, the Mars Climate Orbiter is
supposed to relay signals from the Mars
Polar Lander once it reached the surface of
the planet.
◼ The Mars Climate Orbiter smashed into the
planet instead of reaching a safe orbit.
◼ A software bug that fails to convert English
measures to metric values.
◼ This incident costs $165 million.
13
Current Status
14
Comparison with Automobile Industry
15
Economic Impact
16
How Do We Do Software Testing
correct
faults of omission faults of comission
S I
Specification Implementation
(expected) (observed)
17
Specified, Implemented, and Tested
Program Behaviors
Specification Implementation
(expected) S I (observed)
2
5 6
1
4 3
7
T
Test Cases
(verified)
18
Test Cases
19
Test Case Execution
test input
20
Test Case Generation
21
Functional Testing
Specification Implementation
S I
A
T
Test Cases
Specification Implementation
S I
B
T
Test Cases
22
Structural Testing
Specification Implementation
S I
A
T
Test Cases
Specification Implementation
S I
B
T
Test Cases
23
Functional Testing v.s. Structural Testing
24
Tracking of Incidents
25
Tracking of Incidents
26
Regression Testing
27
Levels of Testing (V-Model)
verify
Acceptance
Requirements
Testing
verify System
Specification
Testing
verify Integration
Design
Testing
verify
Unit
Coding
Testing
28
Costs of Software Quality (Control Costs)
29
Costs of Software Quality (Failure of
Control Costs)
◼ Internal failure costs include costs of
correcting errors that have been detected by
design reviews, software tests and
acceptance tests and completed before the
software is installed at customer sites.
◼ External failure costs include all costs of
correcting failures detected by customers or
the maintenance team after the software
system has been installed.
30
Software Quality Levels v.s. Costs
Minimal
total Total control cost
cost
Total failure of
of
control cost
software
quality low Quality level high
Optimal software quality level
31
Test Coverage Criteria
32