(X> 5) & (Y> 0 ))
// {(6, 1), (1, 1)} -- DC
Int Foo (int x, int y ){
Int z = y * 2; \ Z = y;
If (x> 5) & (Y> 0 )){
Z = x ;}
Return x * z;
}
- Condition overwriting (CC): Each condition's true and false are executed at least once.
(X> 5): true and false
(Y> 0): true and false
// {(6, 0), (0, 1)} -- CC
Int Foo (int x, int y ){
Int z = y;
If (x> 5) & (Y> 0 )){
Z = x ;}
Return x * z;
}
----- Subsume Relation
C1 contains C2 (or C2 is contained by C1) and is recorded
A ≥ B: For any P: C1 (p )? C2 (P ).
DC ≥ SC
CC not ≥ SC
DC not ≥ CC, CC not ≥ DC
- Conditional decision coverage (C/DC ):Both DC and CC are supported.
C/DC (p) = Cc (p) ∩ DC (P)
C/DC ≥ CC
C/DC ≥ DC
//
Int Foo (int x, int y ){
Int z = y;
If (x> 5) & (Y> 0 )){
Z = x ;}
Return x * z;
}
- Modify condition determination overwrite (MC/DC): Each condition independently affects the determination of true and false each time.
MC/DC
(X> 5) & (Y> 0 ))
T
T f
F t f
F
MC/DC
Modified condition/demo-coverage
(MC/DC) is a C/DC enhanced version.
MC/DC is an important criterion of DO-178B standards
(Federal Aviation Administration)
MC/DC as the control software is the strictest (Level)
Logic test coverage criteria
3-1 conditions and Determination of logical coverage test