关于Fault Modeling using the Program Dependence Graph 的读书笔记(3)
MSE 2004,perdubug,2004.6.1
注:Fault Modeling using the Program Dependence Graph是一篇介绍关于软件故障分类和故障播撒技术的文献.
D.Dataflow testing(数据流测试)
11. Dataflow testing considers the associations between variable definitions and variable uses. A definition of a variable modifies a data item, whereas a use of a variable references a data item without modifying it. A definition of a variable reaches a use of that variable if there is a subpath in the program from the definition to the use on which the variable is not redefined. A definition-use pair is an association of a definition of a variable and a use of that variable that the definition reaches.
数据流测试(Datflow testing)被用来研究变量定义和变量使用之间的联系 。definition-use pair表示从变量的定义到变量的使用之间的联系。
12.Dataflow testing is a family of adequacy criteria that includes all-nodes, all-edges, and all-uses. A test set satisfies the all-nodes criterion if every node in the control flow graph is executed by some test in the test set. A test set satisfies the all-edges criterion if each edge in the control flow graph is executed by some test in the test set. A test set satisfies the all-uses criterion if each definition-use pair in the program is executed by some test in the test set.
数据流测试有一大家子的标准,什么完全结点式的,完全边式的,完全使用式的。所谓的全结点式的就是说控制流图中的所有的结点都被执行到了….其他的也是类似道理。
13.Figure 2 gives an example control flow graph for a partial program; only the definitions and uses for variables X and Y are shown. Definitions are shown with the variable on the left-hand side of assignments (X:=) and uses are shown with the variable on the right-hand side of assignments (:= X). The table to the right of the figure shows the program components and program paths that are traversed for each of the three dataflow criteria de_ned above, along with minimal adequate test sets for each criterion.
Figure2给出了一个针对某程序的控制流图,我们只列出了定义和使用了变量X和Y的部分,定义的形式是变量在左边,类似于(X:=),使用的形式是变量在右边,类似于(:=X)。下面的表
关于控制流图文章中的解释是:A control flow graph for a program consists of a node for each statement in the program and edges representing the flow of control between statements.
E. Mutation Testing(变异测试)
14.Mutation testing is a fault-based testing technique [10, 19] that is based on the assumption that a program is well tested if all simple faults are predicted and removed; complex faults are coupled to simple faults and are thus, detected by tests that detects simple faults [10, 28, 38]. Mutation operators introduce simple faults into the program. Each change or mutation that is performed by a mutation operator produces a mutant program or simply, a mutant. A mutant is killed by a test that forces it to produce output that is different from the original program.
变异测试是一种基于故障的测试技术,它是基于这样一种假设:如果一个程序中所有的简单故障被预判和解决那么这个程序就称为是经过良好测试的;复杂的故障是由简单的故障组成的,也就是说复杂的故障可以和简单故障一样被检测到。Mutation operators将简单故障导入到被测试程序中,此时程序也可以被称为是一个”变形(mutant)”,一个变形被测试程序kill然后会产生输出,这是变形和原始程序的不同之处。
15.Figure 3 shows an example program with four mutants, in which each mutant has exactly one mutation.Equivalent mutants are mutant programs that are functionally equivalent to the original program and therefore cannot be killed by any test. In Figure 3, mutant 3 is an equivalent mutant because, if the value of X is 8, it makes no difference whether we check X > 0 or X >= 0.
Figure 3显示了一个例子程序,它具有四种变形,每一种变形确切的只包含一种变化。Equivalent mutants指的是功能上和原始程序等价的变形,所以它不能被任何测试程序kill。在Figure 3中的变形3就是一个Equivalent mutants,因为如果X=8的话那么X>0和X>=0这两个判别式就没有区别了。
16.Budd[5] defined mutation analysis as a method for evaluating the degree to which a set of tests exercise a program. His suggested procedure extends the test set until all nonequivalent mutants have been killed.Because the method of test generation is not significant here, we use the terms mutation analysis and mutation testing interchangeably.
Budd定义了一种叫做mutation analysis(变形分析)的方法来评价测试程序。他的建议扩展
测试集合直到所有的非等价的变形都被kill。因为测试方法的发展对这篇文章没有很大的意义所以我们可以混用”变形分析”和”变形”这两个术语。