Software Testing 03 - Coverage-Based Testing 基于覆盖的测试

本文介绍了基于覆盖的测试,包括控制流测试、数据流测试和突变分析。控制流测试关注程序的路径覆盖,如语句、分支和路径覆盖;数据流测试涉及变量的定义、引用和未定义状态,以及静态数据流异常的识别。突变分析用于衡量测试用例的有效性。文章深入讲解了不同覆盖标准,并提供了实例分析。
摘要由CSDN通过智能技术生成

Coverage-Based Testing 基于覆盖的测试

学习关键:

1.Select test inputs for a program based on its control-flow graph, using the various control-flow coverage
criteria.

根据不同的控制流覆盖标准: 提供控制流图,选择测试用例。

2.Identify when a variable in a program is defined, referenced, and undefined.
识别变量状态: 被定义,未被定义,被引用。

3.Select test inputs from a control-flow graph annotated with variable information, using the various data-flow coverage criteria.
根据不同的控制流覆盖标准: 提供带有变量注释的控制流图,选择测试用例。

4.Identify static data-flow anomalies from the variable information in a control-flow graph.
识别静态数据流异常:根据控制流图中的变量信息

5.Compare and contrast the different control-flow and data-flow coverage criteria.
理解和区分: 不同控制流的覆盖标准

6.Describe the process of mutation analysis and apply it to a small-scale program.
理解突变分析过程

7.Argue why you think mutation analysis is useful or not.
突变分析的意义

8.Define equivalence mutants, and their impact on mutation analysis.
等价突变体在突变分析的影响

9.Describe the importance of and motivate the use of coverage metrics in testing.
理解覆盖度量方法的重要性

学习内容笔记:

内容概括:

白盒测试

覆盖测试的三种软件测试技术:目标在于生成测试用例

if statement: true or false
while loop :n times or indefinitely

覆盖:the test inputs are selected to execute each statement, branch, or path in the program itself
测试程序中的每个语句、分支或者路径。

覆盖的三种技术:
control-flow testing: 控制流测试
data-flow testing:数据流测试
mutation analysis:突变分析

1.control-flow testing 控制流测试

Control-flow strategies select test inputs to exercise paths in the control-flow graph.
They select paths based on the control information in the graph, typically given by predicates in if statements and while loops.

控制流覆盖策略指的是在控制流图中选择合适的测试用例执行路径
控制流图的控制信息通常为if或者while语句的谓语

根据覆盖标准选择测试用例:
覆盖标准有:
(i) Path coverage; 路径覆盖
(ii) Branch coverage; 分支覆盖
(iii) Condition coverage; 条件覆盖
(iv) Statement coverage. 语句覆盖

2.data-flow testing 数据流测试

Data-flow strategies select inputs to exercise paths based on the flow of data between variables; for example, between the definition of a variable, such as assigning a value to a variable, and the use of that variable in the program.

数据流覆盖策略:基于变量选择测试用例
给变量赋值、使用变量

数据流覆盖标准有:
(i) Execute every definition; 执行所有定义变量的路径
(ii) Execute every use;执行所有使用变量的路径
(iii) Execute every path between every definition and every use.执行在定义变量和使用变量路径中的所有路径

3.mutation analysis 突变分析

Mutation analysis is a technique for measuring the effectiveness of test suites, with the side effect that test cases are created and added

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值