1.设计元素的图是基于不同软件组件之间的连接,这种连接被称为依赖关系,也被称为couplings(耦合)。
2.调用图(最常见的结构化设计测试图)
(1)Nodes:Units (2)Edges:Calls to units
①Node coverage:对于每个单元至少调用一次(method coverage)
②Edge coverage:执行每个调用至少一次(call coverage)
调用图在类上面的问题:每个类方法都是独立的,可能并不会互相调用
3.继承和多态
4.继承图上面的覆盖
(1) OO Call Coverage: TR contains each reachable node in the call graph of an object instantiated for each class in the class hierarchy.(一个实例化对象即可)
(2) OO Object Call Coverage: TR contains each reachable node in the call graph of every object instantiated for each class in the class hierarchy.(每个实例化对象)
5.一些定义:
(1)调用者(caller): A unit that invokes another unit
(2)被吊用着(callee): The unit that is called
(3)调用状态(callsite):Statement or node where the call appears
(4)Actual parameter:Variable in the caller
(5)Formal parameter: Variable in the callee
6.Inter - procedural DU Pairs
一般来说,我们只关注last-def 和 first -use,其定义如下:
·Last-def 调用状态前的最后一次定义
·First-use:调用状态后的初次使用
7.Data Flow at the design level
①All-Coupling-Def coverage:every last def to at least one first use
②All-Coupling-use Coverage:every last def to every first use
③All-Coupling-du-Paths Coverage: every simple path from every last def to every first use
△ 对于数组来说,对任意一个元素的引用视为对整个数组的引用
8.总结:
调用图是集成测试非常有用的方法,数据流相对容易计算,也常用在集成测试中