Base and mixed state coverage

I am trying to figure out the differences between the two coverage criteria, and I cannot understand how they differ. I think I do not understand what coverage of solutions is. My software testing tutorial states that complex coverage of solutions can be expensive (2 n for n basic conditions).

I would have thought that covering the ground state would be more expensive.

Consider a && b && c && d && e. I understand that under the basic condition condition, each of these atomic variables must have the value TRUE and FALSE in the test case, so that the test case has a sufficient basic situation - these are 32 different test cases.

So what is the actual difference, and what is called the “basic condition”. Is there a abasic condition in the above example ?

Thank.

+1
source share
2 answers

, , " " " ". Binder " - " " " " ". Everett McLeod " " " " " ". , " ", - " ". .

, ​​ , .

if a && b && c
  # do stuff
else
  # do other stuff
end

a && b && c : a, b c. : , , - , . , .

, . a && b && !c, - , .

, , . . , , - , . . , a, b c, .

+1

-, .

A - , . : a ( a ).

A . . : (a or b) and c, a and b a.

if(decision)  {
  //branch 1
} else {
  //branch 2
}

. . , (.. a), , .

decision .

, ,

decision = (a or b) and c

  • a, b, c = 0
  • a, b, c = 1

), :

| a | b | c |
| 0 | 0 | 1 |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| 1 | 1 | 0 |

, , . / (MC/DC), .

MC/DC , . ( 0 1) , c , a b 0 b , a c 1.

, , , R 1 0.

  | a | b | c | a or b | c | R |  eq
1 | 0 | 0 | 0 |    0   | 0 | 0 |  A
2 | 0 | 0 | 1 |    0   | 1 | 0 |  B
3 | 0 | 1 | 0 |    1   | 0 | 0 |  A
4 | 0 | 1 | 1 |    1   | 1 | 1 |  C
5 | 1 | 0 | 0 |    1   | 0 | 0 |  A
6 | 1 | 0 | 1 |    1   | 1 | 1 |  D
7 | 1 | 1 | 0 |    1   | 0 | 0 |  A
8 | 1 | 1 | 1 |    1   | 1 | 1 |  D

:

  • A: c = 0, 0, a, b
  • B: a, b = 0, 0, c
  • C: b, c = 1, 1, a
  • D: a, c = 1, 1, b

B C , , A D. , , , → , → , (). , . , .

  • A: (0 / 0) / 0 →
  • A: (0 1) vs (0 1) → ! →
  • A: (1 0) vs (1 0) → ! →
  • A: (1 / 1) →
  • D: (1 0) vs (1 0) → →
  • D: (1 1) →

, , :

  • a = 0, b = 1, c = 0 → (A) a = 1, b = 0, c = 0
  • a = 0, b = 0, c = 1 → (B)
  • a = 0, b = 1, c = 1 → (C)
  • a = 1, b = 0, c = 1 → (D)

, - - , , , , , , , , .. , . , , .

, - " ". , " " , : .

0

All Articles