0 and 1 - Switch Coverage in State Transition Testing? - testing

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.

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:
ACT-ACT;
ACT-ACC;
ACT-DIS;
ACT-CLO.
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:
ACT: (as computed earlier) ACT-ACT; ACT-ACC; ACT-DIS; ACT-CLO -> 4;
ACC: ACC-ACT; ACC-CLO -> 2;
DIS: DIS-ACT; DIS-CLO -> 2;
CLO: CLO-DIS; CLO-ACT; CLO-REM; CLO-ACC -> 4.
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.

There are 4 0-Switch transitions (states that you can reach with 1 leap from the Activated status):
Activated
Accepted
Disputed
Closed
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:
Activated - Activated
Activated - Accepted
Activated - Disputed
Activated - Closed
Accepted - Activated
Accepted - Closed
Disputed - Activated
Disputed - Closed
Closed - Activated
Closed - Removed
The final restriction indicates that only Closed - Activated can be done, so Closed - Disputed, and Closed - Accepted do not count.

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)

Related

Matrox DSXLE5 mvConnectorConfig - how to check current -KeyMapping value

I'm looking if there is a way to call the board (DSXLE5) and request info of the current KeyMapping value?
It is the first time I deal with DSX5 family, I've already identified that the firmware change process is different, as before, to change a DSXLE4 8 port card to be 2in + 6out we used
$mvConnectorConfig -2in6out -sn=XXXXX
and now I see that DSXLE5 needs to point the firmware (*.pin) with the load parameter.
$mvConnectorConfig load -f=xmio5_x2_00i12o.pin -sn=xxxxx
I see from the help that we can use -KeyMapping to change the boards, but how does it work and can we call the board to show which mapping is currently using?
I'm new here, so I'm sorry if it isn't 100% straight question.
Best Regards,
Rafael Girotto

PedSelectOutPut routing pedestrians inconsistently

I am simulating the passenger changeover process in metros using the Anylogic Pedestrian Library.
When passengers enter the vehicle, a seat is assigned to them from the seats available near the door (within a given distance) they entered the vehicle through, using a function called lookForSeat. If there is no more free seat available, their boolean parameter wantToSit is set to false and they will stay standing.
The parameter wantToSit is predefined for the Passenger Agent, with default value randomtrue(0.8). But even if I set it to default value = 1, I get the same error.
Then, passengers are separated using a PedSelectOutput block:
Condition 1: if ped.WantToSit = true --> they are sent to their
assigned seat coordinates (PointNode 'seatPoint', null by default)
Condition 2: true (thus, ped.WantToSit = false) --> they stay in the
standing area in the vehicle, no assigned seatPoint necessary in this case.
Now, it works pretty well, but when the majority of the seats is already occupied, suddenly the PedSelectOutput block directs a passenger with ped.wantToSit to its seating point, which gives null and I get the NullPointerException error.
Attached you find the function, the settings of PedSelectOutput and the log from the command.
As it can be seen, the PedSelectOutput sends the passenger through exit 1 (which gives the error due to calling the coordinates of a "null"), despite ped.wantToSit = false.
Any ideas, what is going wrong? For me it really looks like the function is working properly - I have been changing it the whole day until I realized that something in the PedSelectOutput block goes wrong.
Thank you in advance!
Pic 1: pedSelectOutput block and the command with the log
Pic 2: the function lookForSeat assigning the seats from the seat Collection
The problem here is a subtle one, which has caused me many hours of debugging as well. What you need to understand is that the on exit code is only executed once the agent already has a path to which it is going to exit. i.e. the selectOutput and subsequent blocks are already evaluated and only once it is determined that the agent can move to the next block then the on exit code is called. But the agent will continue on its chosen path that has been determined before the on exit code has been executed.
See the small example below:
I have a pedestrian with a variable that is true by default and a select output that checks this value
If I ran the model all pedestrians exit at the top option, as expected
If I change the variable to false on the On Exit code I might expect that all pedestrians will now exit at the second option
But they don't there is no change....
If I add the code to the on enter code then it does..

Can someone tell me Rally CA agile central default severity and priority levels for bugs ? Can it be changed?

Can you list me the different levels of Severity and Priority that are on Rally CA agile central?
According to this help page they can be customized by a subscription adminstrator: https://help.rallydev.com/defects
By default Priority has these values:
1 - Resolve Immediately
2 - High Attention
3 - Normal
4 - Low
By default Severity has these values:
1 - Crash/Data Loss
2 - Major Problem
3 - Minor Problem
4 - Cosmetic

Apache ODE - BPEL compensation handler - weird behavior (or may be I'm wrong somewhere

I've got this example of BPEL from this location https://svn.wso2.org/repos/wso2/carbon/platform/trunk/products/bps/modules/samples/product/src/main/resources/bpel/2.0/SampleCompensationHandlers/FlightReservationProcess/
The example sets a given variable when executes a given scope.
The last scope throws an error, so the fault triggers the relevant handler for that scope, which rethrows the fault. That way the fault handler for the process is triggered, where the compensation is made for every successfully completed scope.
I've created a BPEL project in Eclipse and I've put the example in there, then I've started some tests. But I've found a very strange behavior:
I've got correct results just few times:
CarReservationActivity: 1 CarReservationCompensated: 1 HotelReservationActivity: 1 HotelReservationCompensated: 1 FlightReservatoinActivity: 1
In all other cases I've got incorrect results:
A)
CarReservationActivity: 1 CarReservationCompensated: 0 HotelReservationActivity: 1 HotelReservationCompensated: 1 FlightReservatoinActivity: 1
B)
CarReservationActivity: 1 CarReservationCompensated: 1 HotelReservationActivity: 1 HotelReservationCompensated: 0 FlightReservatoinActivity: 1
And when the result is incorrect then the case A) dominates.
I can not find out where is the problem. Everything looks fine.
Can someone help me to solve the issue ?
Used software :
- Windows 7 Enterprise, SP1, 32bit
- Apache Tomcat v.6.0.18
- Apache ODE v.1.3.5
- Eclipse Indigo v.3.7.2 SR2
- BPEL designer v.1.0.1
- Java 7 (v.1.7.0_07)

Issue tracking system for an hospital? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've a friend working in an hospital and he asked for an issue tracking system.
Currently they are using only mails. I thought to Jira or Trac, but they use
"programming terms" like "bug" or "patch".
I don't want to spend time customizing, do you know any better solution/software?
I used Trac to implement issue tracking for managing the operations of a building. It is quite configurable, so I was able to conceal the software-bug-oriented wording without a lot of effort, though the admin interface.
I applied a trivial patch to Trac so that it displays boolean values as Y and N rather than the the "computerese" 1 and 0, and also, so that the false value is displayed a blank. (This is better in a columnar report where you have boolean columns, and you just want to clearly see where the Y values are; they are harder to see in a grid of Y's and N's).
Here it is below. Everything else, I did easily through the admin interface.
Index: pyshared/trac/ticket/web_ui.py
===================================================================
--- pyshared.orig/trac/ticket/web_ui.py 2011-09-16 11:59:40.000000000 -0700
+++ pyshared/trac/ticket/web_ui.py 2011-09-16 12:11:31.000000000 -0700
## -1120,7 +1120,7 ##
elif type_ == 'checkbox':
value = ticket.values.get(name)
if value in ('1', '0'):
- field['rendered'] = value == '1' and _('yes') or _('no')
+ field['rendered'] = value == '1' and 'yes' or ''
# ensure sane defaults
field.setdefault('optional', False)
Index: pyshared/trac/ticket/query.py
===================================================================
--- pyshared.orig/trac/ticket/query.py 2011-09-16 14:36:51.000000000 -0700
+++ pyshared/trac/ticket/query.py 2011-09-16 14:37:10.000000000 -0700
## -294,9 +294,9 ##
val = datetime.fromtimestamp(int(val or 0), utc)
elif field and field['type'] == 'checkbox':
try:
- val = bool(int(val))
+ val = val == '1' and 'Y' or ''
except TypeError, ValueError:
- val = False
+ val = ''
result[name] = val
results.append(result)
I know you said that you didn't want to time customizing, but I am afraid you are just out of luck on that. I doubt that there is any issue tracking system out there that will give you exactly what you want without customizing (or without exorbitant fees). So I will still recommend JIRA.
JIRA is incredibly customizable. We use it in our organization for tracking issues of many types from software issue tracking, to Vehicle reservations, to building maintenance work order requests, purchase request, and more. We also have plans to customize it for our students (I work in a college) to be able to request assistance with registration, submit feedback, and more.
JIRA is incredibly robust and, once you get the hang of it, not terrible to configure. I won't lie. Configuring JIRA, at first, is a chore and can be difficult to get a handle on. But there is a great book from O'Reilly called Jira Administration that helped me understand it all much better. And it is quite a small book (187 pages or so), so it is not filled with a bunch of fluff. It is just great and useful information.
We use JIRA Dashboards, Issue type customizations, notification schemes, permission schemes, issue type security, custom workflows, custom screens and forms, plugins, the Web Service APIs, and more. It really is a fantastic system.