Reputation: 52
This question is not programming related but related to one of test case design the technique. State Transition Diagram technique provides Test coverage by identifying test conditions via N-1 switch transitions. I am confused about how to calculate the 0-switch and 1-switch coverage.
Adding screenshot of an example. Can anyone please explain how this can be solved? Thank you in Advance.
Upvotes: 0
Views: 14007
Reputation: 1
Addendum for Marco answer<<
Total solution for 1-switch is 9.
You rule out ACT-CLO-ACC (as Marco said due to second restriction)
but You also rule out ACT-CLO-REM (This one nobody excluded) ACT-CLO-DIS (as Afner noted)
Upvotes: 0
Reputation: 1
There are 4 0-Switch transitions (states that you can reach with 1 leap from the Activated status):
There are 12 1-Switch transitions (states that you can reach with 2 leaps from the Activated status), however only 10 of them are valid:
The final restriction indicates that only Closed - Activated can be done, so Closed - Disputed, and Closed - Accepted do not count.
Upvotes: 0
Reputation: 66
The number of 0-switch from a state equals to the number of the transitions of length 1 starting from that state. In this case you have:
So, from Activated there are 4 transitions of length 1.
1-switch coverage from a state equals to all the transitions of length 2 starting from that state. You can build up from what you found in the 0-switch case, knowing which states you can reach from Activated in 1 transition. Just compute all the 0-switch transitions from each of these 4 states:
In total, there are 12 1-STs.
But this is without considering the constraints in the second part of the exercise description.
"If a claim in state Accepted has been Closed it can only be restored to the same state Accepted." -> it does not matter for the exercise, since we start from the state Activated.
"If a claim in state Activated has been Closed it can only be restored to state Activated." -> this constraint rules out ACT-CLO-ACC.
So, in the end, you have 11 valid 1-STs.
Upvotes: 0