- ch17 Software testing strategies
- ch18 Testing conventional application
- ch19 Testing obiect-oriented application
- Note4 本章对应例题
ch17 Software testing strategies
17-1 software error types
- Algorithm error
- Precision error 精度错误
- Documentation error
- Pressure error 压力错误
- Throughput error 吞吐量错误
- Recovery error 恢复错误
- Timing error (coordination error) 计时错误
- Hardware and system software errors
Verification: A series of activities to ensure that software correctly implements specified functions
验证 (verification) :确保软件正确实现特定功能的一系列活动
Validation: A series of activities that ensure that developed software is traceable to user requirements, in part to evaluate the usefulness or effectiveness of a software product
确认 (validation) :确保开发的软件可追溯到用户需求的一系 列活动,某种程度上是评价软件产品的有用或有效性
Testing is an important part of verification and validation activities.
螺旋模型:
17-3 Test Strategies for Conventional Software
17-3-1 Unit testing 单元测试
- 接口
- 局部数据结构
- 独立路径
- 错误处理路径
- 边界条件
单元测试:指对软件中的最小可测试单元进行检查和验证。
Refers to the inspection and verification of the smallest testable unit in the software.
什么是测试用例?是为某个特殊目标而编制的一组测试输入 、执行条件以及预期结果,以便测试某个程序路径是否满足某个特定需求。
- Compile and run the program
- Static test
- Dynamic testing
17-3-2 Integration Testing 集成测试
- 功能正确性 Functional correctness
- 接口正确 Interface
- 系统性能 System performance
先单元测试,后集成测试
- One-Step testing 一步到位
- Top-down testing 自顶向下
- Bottom-up testing 自底向上
- Combination approach (sanwich) 组合方法-三明治法
自顶向下测试
- 可能要编写很多桩程序 stub programs
- 主控模块错误可能发现得比较早
自底向上测试
- 要写驱动程序 driver module
- The main control module error is found relatively late
Top-down vs. bottom-up
17-3-3 Regression Testing 回归测试
A test strategy to ensure that the original function is normal when the program is modified.
- This approach takes a top-down approach to testing the modified module and its submodules;
- Then treat this part as a subsystem and test it bottom-up.
17-3-4 Smoke Testing 烟幕测试
Smoke testing is a commonly used integration testing method, designed as a time-critical project stepping mechanism, allowing software teams to evaluate their software projects frequently.
- Improve the quality of the final product
- Simplify error diagnosis and correction
- Easy to assess progress.
17-4 Integration Testing in an Object-Oriented Environment
- Thread-based testing 基于线程的测试
- 对响应系统的一个输入或事件所需的一组类进行集成
- 每个线程单独地集成和测试
- 应用回归测试以确保没有产生副作用
- Use-based testing 基于使用的测试
- 通过测试很少使用服务类的那些类(称为独立类)开始构造系统
- 独立类测试完后,利用独立类测试下一层次的类 (称之为依赖类)
- 继续依赖类的测试直到完成整个系统
17-5 Validation Testing 确认测试
确认测试开始于集成测试的结束。
Alpha Testing vs. Beta Testing
17-6 系统测试 System Testing
- Recovery test
- Safety test
- Pressure test
- Performance test
- Deployment test 部署测试
系统测试实际上是对整个基于计算机的系统进行一系列不同考验的测试。虽然每个测试都有不同的目的,但所有测试都是为了验证系统成分已正确地集成在一起且完成了指派的功能。
17-7 The Art of Debugging (调试)
ch18 Testing conventional application
18-1 Software Testing Fundamentals (Testable software)
- Operability 可操作性
- Observability 可观察性
- Controllability 可控制性
- Decomposability 可分解性
- Simplicity 简单性
- Stability 稳定性
- Understandability 易理解性
18-2 Internal and External Views of Testing
18-3 Black-Box & White-Box Testing
- Black box testing
- Tests are performed at the software interface to check the functional aspects of the system without knowing the internal structure of the software.
- 不需要了解软件的内部结构
- White-Box Testing
- Examine the process details of the software, test the logical paths through the software and the collaboration between components.
- 检查软件的过程细节
18-3-1 While-Box
- 对模块的所有独立的执行路径至少测试一次;
- 对所有的逻辑判定,取“真”与取“假”的两种情况都至少测试一次;
- 在上下边界和可操作的范围内执行所有的循环;
- 测试内部数据结构的有效性。
18-3-2 Basis Path Testing 基本路径测试
2022年考点
Based on control flow graph
流图 Flow graph (重点)
注意区分Flow Graph(流图) 和 Flowchart(流程图)
域:由边和结点限定的区间,没有包围的就统一算成1个
简单题:
- 计算独立路径(重点):
- 计算环路复杂度(重点):
复合题
- 根据代码/设计框图,画出流图
- 计算环路复杂度
- 确定独立路径
- 根据独立路径,写出测试用例集
重要例题:
18-4 Control Structure Testing 控制结构测试
- Conditional test
- 语句测试
- 分支测试
- Data flow test
- Loop test
保证每条语句至少执行一次:
18-4-1 Conditional test
18-4-2 Data flow test
- 1 数据定义点
- 2 数据使用点
- 2-1 计算性使用 C-USE
- 2-2 判定性使用 P-USE
例子:变量i的定义与使用:
1-15这组不能用,因为a不能同时大于30,又小于b(因为b小于30)
18-4-3 Loop test 循环测试
18-5 Black-box test 黑盒测试
- 等价划分 Equivalent division
- 等价类是指某个输入域的子集合
- 有效等价类 equivalence class
- 无效等价类
- 边界值分析 Boundary value analysis
- 应当选取正好等于,刚刚大于,或刚刚小于边界的值做为测试数据
18-5-1 等价类划分
18-5-2 边界值分析
黑盒测试中:预估错误的数量
ch19 Testing obiect-oriented application
19.3 Object-Oriented Testing Strategies
经典软件测试策略从“小范围”开始,并逐步过渡到“软件整体”。
用软件测试的行话来说,就是先从单元测试开始, 然后过渡到集成测试,并以确认测试和系统测试结束。
最小的可测试单元不再是单独的模块,二是封装了的类 an encapsulated class
19.4 Object-Oriented Testing Methods
Note4 本章对应例题
1、语句测试:
2、分支测试:
3、条件测试:
最后的最后,祝你好运!——Lance于2023/01/03