Measure the flow of data between variable assignments (writes) and variable references (reads).
Examples: all-definitions, all-uses
Test Requirements
Generated by a coverage model
Easy to measure coverage
Condensation Graph
A node is either an Assignment block or a Boolean condition.
Satisfying a Coverage Model
Type 1: Control Flow
Node Coverage (NC)
Each reachable path p of length 1 in G is a test requirement.
覆盖每个点
Edge Coverage (EC)
Each reachable path p of length 2 in G is a test requirement.
覆盖每条边
Edge-Pair Coverage (EPC = EC2)
Each reachable path p of length <= 3
每种path可能性(2个if串联就有2*2=4种可能性)
Prime Path Coverage (PPC)
Each reachable prime path p in G is a test requirement
Prime Path: maximal simple path 最长简单路(除去首尾,中间不能重复)
满足: p cannot be extended without losing simplicity 再长一点就不是simple path
Complete Path Coverage (CPC)
Every reachable path in G is contained in some path p∈TR.
Type 2: Logic Coverage
重点: Different ways of taking the same branch
For logic coverage, a test requirement tr is a logical constraint on input data values
Predicate Coverage (PC)
For each predicate p∈P, the set TR contains:
a requirement that implies p is reached and evaluates to true
a requirement that implies p is reached and evaluates to false
Clause Coverage (CC)
比CC粒度更细,每个clause都要为true或false(这里clause指atomic表达式)
PC和CC互相independent(可能一个满足一个不满足)
Combinatorial Coverage (CoC)
For each predicate p∈P, and every possible truth assignment α to the clauses Cp of p the set TR contains a requirement which implies p is reached and the clauses evaluate to α.
Active Clause Coverage (ACC)
For each predicate p∈P and each clause c∈Cp which determines p (under some α), the set TR contains two requirements for c: c is reached and evaluates to true, and c is reached and evaluates to false.