CS FundamentalsVery hardService-company placement · ISTQB-style

A state machine has transitions a: S1→S2, b: S2→S3, c: S3→S1 and d: S2→S1. How many test items does 0-switch (every transition) coverage need, and how many does 1-switch (every valid pair of consecutive transitions) coverage need?

  1. A. 4 and 5
  2. B. 4 and 16
  3. C. 4 and 8
  4. D. 3 and 5

Correct answer: A. 4 and 5

0-switch covers the 4 transitions. For pairs, multiply arrivals into each state by departures from it: into S1 (c, d) × out (a) = 2; into S2 (a) × out (b, d) = 2; into S3 (b) × out (c) = 1; total 5. 16 counts all 4 × 4 ordered pairs, most of which cannot follow each other.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic