Whitebox testing with break

223 Views Asked by At

Can someone tell me if my whitebox testing is correct? Can I put 2 arrows entering for statement 8 ?

Code being tested:

Code being tested

Whitebox test:

Whitebox test

1

There are 1 best solutions below

0
lexicore On

Below are all the possible transitions:

  • 1 - 2
  • 2 - 3
  • 2 - 8 (scheduling.cell.row may be empty)
  • 3 - 4
  • 3 - 8 (db.getvehicles may be empty)
  • 4 - 5
  • 4 - 6
  • 5 - 3
  • 5 - 8
  • 6 - 7
  • 7 - 8

That's it. The whole 9-13 part is not executed here as it will be executed as a reaction on a drag event. So there is no direct connection between 8 and 9.