Chapter 1 Software Quality and Testing PDF
Chapter 1 Software Quality and Testing PDF
Chapter 1 Software Quality and Testing PDF
wuchenni@qq.com
Contents
• What is Quality?
– The totality of features and
characteristics of a product or service
that bears on its ability to satisfy given
needs.
1.1 About Software Quality
• What is Quality?
– Quality from the
• Customer’s viewpoint fitness for use,
or other customer needs
• Producer’s viewpoint meeting
requirements
1.1 About Software Quality
Prevention
Detection
Cure
1.1 About Software Quality
Software Quality
1.满足用户需求;2.建立合理的进度、成本与功能的
关系; 3.具备扩展性和灵活性; 4.能有效的处理例
外情况; 5.保持成本和性能的平衡
Quality Control
为了达到产品的品质要求所采取的作业技术和活动。
1.1 About Software Quality
QC
Control
Product
Detective
Testing
1.1 About Software Quality
• Software is everywhere
1.2 About Software Testing
• 编程大师说:“任何一个程序,无论它多么小,总存在
着错误。”
• 初学者不相信大师的话,他问:“如果一个程序小得只
执行一个简单的功能,那会怎样?”
• “这样的一个程序没有意义,”大师说,“但如果这样
的程序存在的话,操作系统最后将失效,产生一个错
误。”
• 但初学者不满足,他问:“如果操作系统不失效,那么
会怎样?”
• “没有不失效的操作系统,”大师说,“但如果这样的
操作系统存在的话,硬件最后将失效,产生一个错误。”
• 初学者仍不满足,再问:“如果硬件不失效,那么会怎
样?”
• 大师长叹一声道:“没有不失效的硬件。但如果这样的
硬件存在的话,用户就会想让那个程序做一件不同的事,
这件事也是一个错误。”
1.2 About Software Testing
(99%) 10000
= 2.25 × 10 -44
1.2 About Software Testing
Ariane 5 (1996)
The rocket self-destructed 37 seconds
after launch.
• Why do we test ?
–Most security vulnerabilities are
due to faulty software.
–World-wide monetary loss due to
poor software is staggering.
–Stronger testing could solve most
of these problems.
1.2 About Software Testing
• Why do we test ?
– We want our programs to be reliable.
1.2 About Software Testing
软件产品中所存在的问题,最终表现为用户所需
要的功能没有完全实现,没有满足用户的要求。
1.2 About Software Testing
• Defect examples:
– Shortcoming: running slowly.
– Inconsistency: Ctrl+S can’t save all
applications.
– User interface design defect: an button
should show 5 words on it ,but only 3 words
could be seen.
1.2 About Software Testing
• Correct program
– No syntax error
– No obvious errors during running
– No improper statements
– Valid input - correct output
– Invalid input - correct output
– Any possible input - correct output
1.2 About Software Testing
• Attention:
–The essential function of software
testing is verification(验证)and
validation(确认).
•Verification(验证): The software
should conform to its specification (Are we
building the product right?)
•Validation(确认): The software should
do what the user really requires (Are we
building the right product?)
1.2 About Software Testing
• Attention:
– Verification: The process of determining
whether or not the products of a given phase
of the software development cycle fulfill the
requirements established during the previous
phase.
– Validation: The process of evaluating software
at the end of the software development
process to ensure compliance with software
requirements.
1.2 About Software Testing
• Attention:
– Test & debug
• Automated test vs. manual operate
• Don’t know details are OK vs. must know
details
• Correctness proof and how to do with
failure vs. correctness proof only
• Checking vs. reasoning
• Plan , under control vs. out of control
1.2 About Software Testing
• Types of testing
– C1:Source of test generation
– C2:Life cycle phase in which testing takes
place
– C3:Goal of a specific testing activity
– C4:Characteristics of the artifact under test
– C5:Test process models
1.2 About Software Testing
Artifact Technique
Requirements (informal) Black-box testing
Code White-box testing
Requirements and code Black-box testing and white-
box testing
Formal model: graphical or Model-based specification
mathematical specification
Component’s interface Interface testing
1.2 About Software Testing
Phase Technique
Coding Unit testing
Integration Integration testing
System integration System testing
Maintenance Regression testing
Post system, pre-release Beta-testing
Goal
1.2 About Software Testing Technique
Advertised features Functional
• C3:Goal-directed
Security testing Security
Invalid inputs Robustness
Vulnerabilities Vulnerability
Errors in GUI GUI
Operational correctness Operational
Reliability assessment Reliability
Resistance to penetration Penetration
System performance Performance
Customer acceptability Acceptance
Business compatibility Compatibility
Peripherals compatibility Configuration
Foreign language compatibility Foreign language
1.2 About Software Testing
Coding and
unit testing
Integration and
subsystem testing
System
testing
Acceptance
testing
Training and
delivery
Maintenance
1.2 About Software Testing
Requirements
analysis
Testing in the V-model Maintenance
Validate requirements
Develop system acceptance tests Acceptance testing
Design
System testing
Validate design
Develop integration tests
Cost
(Cost of test activities
increases with iterations)
Final test
Activities, application ready for
Intermediate test activities acceptance test
Time
(Prototype, evolves
Initial test over time)
Activities, early stages
of development
Spiral testing
1.2 About Software Testing
• Example
– Consider a Web service W to be tested. When
executed, W converts a given value of
temperature from one scale to another, for
example from Fahrenheit scale to the Celsius
scale.
• Regardless of the technique used for test
generation, we can refer to the testing of W as
Web-services testing(C4).
– Let’s examine various types of test-generation
techniques that could be used for testing W.
1.2 About Software Testing
• IBM研究结果表明:缺陷存在放大的趋势
需求阶段缺陷
概要设计阶段缺陷
放大
n1倍
详细设计阶段缺陷
放大
n2倍
放大 需求阶段缺陷
编码阶段缺陷
n3倍
1.2 About Software Testing
Subsystem Integration
Design Test
Unit
Implementation
Test
1.3 Software Testing Rules
X
Y
P Z
Unfound
Bug
Testing Cost
numbers
Best Testing Point
Excess Testing
Insufficient Testing
Testing Degree
1.3 Software Testing Rules
• Good-enough
• 80-20
1.3 Software Testing Rules
• Static testing
• Dynamic testing
1.3 Software Testing Rules