软件测试课件 02_1 软件测试概述
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
// else return the number of occurrences of 0 in arr
int count = 0;
for (int i = 1; i < arr.length; i++)
{ if (arr [ i ] == 0) {
Error: i is 1, not 0, on the first iteration
Verification(验证) : The process of determining whether the products of a given phase of the software development process fulfill the requirements established during the previous phase 验证实现是否满足规格文档中的需求。
Expected: 1
Actual: 1
Test 2
[ 0, 2, 7 ]
Expected: 1
Actual: 0
软件缺陷的现象
功能、特性没有实现或部分实现 设计不合理,存在缺陷 实际结果和预期结果不一致 运行出错,包括运行中断、系统崩溃、
Validation & Verification
Test is verification! 验证最后系统是否满足当初的需求!
Static Testing & Dynamic Testing
Static Testing 静态测试 ➢ without executing programs 静态验证 ➢ 扫描程序、需求或设计文档
Faults in software are equivalent to design mistakes in hardware.
Software does not degrade.
➢ 程序员犯了一个错误( mistake) ➢ 这个错误(mistake)在程序或软件中就表现为缺陷
(defect/fault) ➢ 运行带有缺陷(defect/fault)的软件或程序,在运行过程
2.软件测试概述
软件测试的定义
Bill Hetzel博士:
软件测试就是一系列活动,这些活动是为了评估一个程序或软件系统的 特性与能力,并确定是否达到了预期效果。
IEEE 的定义 :
使用人工或自动手段,来运行或测试某个系统的过程。其目的在于检验 它是否满足规定的需求或弄清预期结果与实际结果之间的差别。
6
Software Fault, Failure & Error
Software Fault (缺陷) : A static defect in the software by human’s mistake Software Failure(失效): External, incorrect behavior with respect to the requirements or other description of the expected behavior Software Error(错误) : An incorrect internal state that is the manifestation of some fault
中出现与预期不同或不可接受的内部状态,出现故障(Error)
✓ Run-time error ✓ Syntax error ✓ Semantic error
➢ 运行带有缺陷(defect/fault)的软件或程序,就可能观察到 失效/失败(fail/failure)
Mistake
Fault
Failure
软件测试是以检验是否满足需求为目标。
Validation & Verification
Validation(确认):The process of evaluating software at the end of software development to ensure compliance with intended usage 确认规格文档是否是最终用户所需要的。
blood stream)
➢ Errors
Most medical problems result from external attacks (bacteria, viruses) or physical degradation as we age.
Software faults were there at the beginning and do not “appear” when a part wears out.
Failure: none
count++;
} } return count;
Error: i is 1, not 0
Error propagates to the variable count Failure: count is 0 at the return statement
}
Test 1
[ 2, 7, 0 ]
A Concrete Example
Fault: Should start searching at 0, not 1
public static int numZero (int [ ] arr)
{ // Effects: If arr is null throw NullPointerException
Dynamic Testing 动态测试 ➢ with executing programs动态验证 ➢设计输入来运行程序,观测结果来判断
5
Fault, Error & Failure Example
A patient gives a doctor a list of symptoms
➢ 来自百度文库ailures
The doctor tries to diagnose the root cause, the ailment
➢ Fault
The doctor may look for anomalous internal conditions
(high blood pressure, irregular heartbeat, bacteria in the