The notes of How We Test Software At Microsoft(5)
来源:互联网 发布:网络用语辣鸡什么意思 编辑:程序博客网 时间:2024/05/21 22:57
Combinatorial Analysis
To test the interactions between the variable states of several dependent parameters systematically combinatorial analysis is a best practice as compared to alternative approaches.
测试一些有依赖关系的参数的不同状态的交互,组合分析测试是最好的方法。
The benefits of the combinatorial analysis:
· Identifies most defects caused by variable interaction.(可以找到大部分由于变量交互导致的缺陷)
· Provides greater structural coverage.(更广泛的结构性覆盖)
· Has great potential to reduce overall testing costs(when used appropriately)(正确的使用组合分析可以降低测试成本)
要引起注意的是组合分析测试并不是能应用到所有的待测试的产品中,它并不适用于测试没有任何交互没有依赖关系的输入的参数。组合分析测试能有效的应用到测试的产品是它的输出是由输入参数的逻辑关系决定,并且输出的结果不依赖于输入参数的先后顺序。
有两种方法测试变量的交互,一种是结合错误猜测法进行ad hoc 测试,随机选择要测试的变量组合,第二种是科学系统的测试方法,包括每个变量或每个组合的测试(EC),base choice(BC),正交序列(OA),组合测试(结对测试等)以及穷尽测试(exhaustive testing-AC)。
EC-保证每个变量被遍历一次,同其它组合测试方法比较,EC提供了数量最少的测试,但不适用于复杂的测试系统。
BC-把某一个变量的组合作为base test,通常是以happy path 或是常用的变量状态的组合作为base test。一次只改变一个变量的状态。比如:有三个参数A,B,C,其中A的变量有1,2,3;B的变量4,5;C的变量是6,7。假设base test是1,4,6,那么基于BC的测试用例是:
First BC
1
4
6
2
4
6
3
4
6
Second BC
1
4
6
1
5
6
Third BC
1
4
6
1
4
7
-
Orthogonal Arrays (OA)- 参考http://blog.csdn.net/roger_ge/archive/2010/02/26/5329690.aspx。
PairWise Testing,类似PICT的工具http://cvg.codeplex.com/,只是添加了图形界面,更简单方便。
使用PICT或者是其它组合测试工具,并不是简单的把参数和变量的状态输入到工具即可,需要测试人员深入分析待测产品,确定独立的变量和半耦合关系的变量,并且对参数进行分解。系统的组合分析的步骤:
· Create an input matrix of BC tests
· Create an input matrix of common or probable scenarios and historical failure indicators
· Create an input model file of the variable states for each parameter
· Customize the model file to exclude mutually exclusive variable states of invariant parameter( 优化模型,去除参数的互斥状态)
· Apply all input files to the PICT Tool
· Review the tool output
· Refine and customize the model file if necessary
· Reapply all input file files to the PICT tool
· Revalidate output
· Execute test cases
组合测试的实践过程:
· 首先找出有依赖关系的参数
· 确定每个参数的取值(变量状态)
· 划分等价类,随机抽取每个等价类子集
· 制作BC matrix:BC matrix非常重要,研究表明BC结合组合的结对测试或是N维测试,可以更有效的暴露产品由于输入参数的组合关系导致的缺陷
· 找出用户常用的参数组合,或是BC matrix没有包含的,以及有些是基于风险分析或是历史数据表明易导致缺陷发生的组合,列出这些参数的组合,生成seed文件。输入seed文件到PICT,PICT的测试用例输出会包含seed文件所列出的所有参数组合。
· 生成一个参数的输入文件,包含所有参数及其参数的取值的信息
· 通过PICT生成测试用例:
命令行的格式为:
Pict.exe myModeFile.txt /e:mySeededInput.txt >output.xls
· 优化生成的测试用例
测试工具PICT/ Combinatorial Variation Generator,都可以定制参数的限制条件,PICT使用的命令行例子为:
IF [Font]=”BrushScript” AND [Italic]=”Uncheck” THEN [Bold] <>”Check”;
对于等价的变量可以在输入参数的文件中插入“|”, 比如Aril|Tahoma。
另外一个非常重要的功能是保持n维覆盖不变,使得输出的测试用例能够随机产生。因为如果每次都使用同样的测试用例,就不能提高测试的覆盖率和有效性。
最后建议,使用组合测试方法时,首先做BC和pairwise测试,然后利用PICT等工具,保持维数不变,改变测试用例,如果还需要更高的覆盖率,就增加组合测试的维数。一般二维就能达到相应的测试覆盖要求。
- The notes of How We Test Software At Microsoft(5)
- The notes of How We Test Software At Microsoft(5)
- The notes of How We Test Software At Microsoft(1)
- The notes of How We Test Software At Microsoft(2)
- The notes of How We Test Software At Microsoft(3)
- The notes of How We Test Software At Microsoft(4)
- The notes of How We Test Software At Microsoft(6)
- The notes of How We Test Software At Microsoft(7)
- Xmind of How We Test Software at Microsoft
- How We Test Software at Microsoft 读书笔记 (一)
- 转载:The Growth of Software Test
- microsoft software test
- How google test software
- How should we evaluate the performance of an DBA?
- How can we double the data rate of 802.11a?
- Test Experience Share: We should consider the impact of the hardware improvement to the test code
- Notes of Managing Software Projects
- 读书笔记 - How Google Test Software
- 各种格式图像经过DGI+获得CBitmap后在CImagelist中的透明问题
- 有些话,自己知道就好
- Android 0.9 API改变中文总结
- C语言面试题 4 (查找整数数组中第二大的数)
- Daemon线程 sleep()及yield()
- The notes of How We Test Software At Microsoft(5)
- WIN32限制程序执行时长功能的实现
- Oracle 递归查询
- HDFS架构和设计要点
- 回车键
- HTML 标签
- 延时提示框本质代码
- 获取联系人名称及全部电话的实例
- LAME参数大全(概述)