Identifier test requirements

Equivalence partition

Input conditions Valid classes Invalid classes
Identifier's size t 1 <= t <= 6 (1) t < 1 (2), t > 6 (3)
First character c is a letter Yes (4) No (5)
Only contains valid characters Yes (6) No (7)


All-Nodes

  • 6


All-Edges

  • (8, 12)


Boundary-interior

  • (4, 5, 6, 7, 4)


All-Paths

  • (1, 2, 3, 4, 8, 12)


All-Defs

  • valid_id = false


All-P-Uses

  • while (i < s.length() - 1)


All-C-Uses

  • i++


Data flow testing

  • {(s, 1, 3), (valid_id, 1, (8, 9,)), (valid_id, 1, (8, 12,))
  • (valid_id, 1, (8, 9,)) is infeasible.


All-Pot-Uses

  • (s, 1, 6), (achar, 3, (8, 9)), and (achar, 3, (8, 12))