UML Sequence Diagram feedback - uml

Hi can anyone tell me their thoughts on this sequence diagram, if it is correct or whatever needs changing.
Thankyou, your feedback would certainly help a lot.
Full Size Image: http://i.stack.imgur.com/ktPsY.jpg

There seem to be some splits in the sequences, for example there is a gap between steps 2 and 3. Keeping each sequence whole makes the diagram valid and much more readable. Here is an example of what a diagram should look like. Note how the bar for the customer goes on until the very end of the sequence.
The objects have also been chosen pretty confusingly. Aren't Register, Login and Book part of the web server? If they are, you probably should get rid of the Web Server object in this chart.
The return values should be passed back to the object that originated the call like has been correctly done in steps 11 and 12, though there is another gap in the sequence.
Some sequences are incomplete, like step 8. Now the diagram describes the Browse Shows as a call that is made by the user to the Book object, which never provides any return value.
The alternate paths 4 and 5 are incorrectly defined. An else block should be used instead.

Related

Do I use foreach for 2 different inspection checks in activity diagram?

I am new in doing an activity and currently, I am trying to draw one based on given description.
I enter into doubt on a particular section as I am unsure if it should be 'split'.
Under the "Employee", the given description is as follows:
Employee enter in details about physical damage and cleanliness on the
machine. For the cleanliness, there must be a statement to indicate
that the problem is no longer an issue.
As such, I use a foreach as a means to describe that there should be 2 checks - physical and cleanliness (see diagram in the link), before it moves on to the next activity under the System - for the system to record the checks.
Thus, am I on the right track? Thank you in advance for any replies.
Your example is no valid UML. In order to make it proper you need to enclose the fork/join in a expansion region like so:
A fork/join does not accept any sematic labels. They just split the control flow into several parallel ones which join at the end.
However, this still seems odd since you would probably have some control for the different inspections being entered. So I'd guess there's a decision which loops through multiple inspection entries. Personally I use regions only for handling interrupts. ADs are nice to a certain level. But sometimes a tabular text (like suggested by Cockburn) is just easier to write and read. Graphical programming is not the ultimate answer (unlike 42).
First, the 'NO' branch of the decision node must lead somewhere (at the end?).
After, It differs if you want to show the process for ONE or MULTIPLE inspections. But the most logical way is to represent the diagram for an inspection, because you wrote inspection without S ! If you want represent more than one inspection, you can use decision and merge node to represent loop that stop when there is no more inspection.

How to validate text box in gherkin language?

I need to validate "text box" which does not allow special character,Number more than 10000, and letters,
So my question is how to write in gerkin language ?
Gherkin is not a programming language to have validations. You cannot inject variables into it. However, you can perform the validation in the step definition file and tag it to gherkin.
Scenario: I verify if the characters more than 100
Given I see the text box
And I verify, the text box does not contain characters more than ""
The step definition file
arg !< characters.length
arg is the argument you pass inside the double quotes in gherkin.
Your task is to
Find the value in the text box
The way to do this varies from environment to environment, Selenium may be a good way to interact with your system if it is a web application
Save it in some variable
Validate it against some known value in a step
I have written a few blog posts on how to use Cucumber. This blog post from 2015 may be a reasonable start. The cucumber version is a bit outdated. The process of implementing steps is still valid.
Executable specifications (whether they are in Gherkin format or not) are meant to describe the behavior of the business people. I am pretty confident that not a single business person would talk about the how a single text box should behave.
My advice is to see what the actual business value is about and write the scenario from that perspective. Then the actual testing on this particular text box might not be described in the scenario, but it can be part of the underlying steps implementation.
In other words should the text box suddenly allow for numbers up to a million than the business value probably doesn't change. Therefore the scenario should not change, but the test code behind it might.

Washing machine petri net

It is my first time doing a Petri net, and I want to model a washing machine. I have started and it looks like this so far:
Do you have any corrections or help? I obviously know its not correct, but I am a beginner and not aware of the mistakes you guys might see. Thanks in advance.
First comments on your net's way of working:
there is no arrow back to the off state. So once you switch on your washing machine, won't you never be able to switch it off again ?
drain and dry both conduct back to idle. But when idle has a token, it will either go to delicate or to T1. The conditions ("program" chosen by the operator) don't vanish, so they would be triggered again and again.
Considering the last point, I'd suggest to have a different idle for the end of the program to avoid this cycling. If you have to pass several times through the same state but take different actions depending on the progress, you have to work with more tokens.
Some remarks about the net's form:
you don't need to put the 1 on every arc. You could make this more readable by Leaving the 1 out and indicating a number on an arc, only when more than one tokens would be needed.
usually, the transitions are not aligned with the arcs (although nothing forbids is) but rather perpendicular to the flow (here, horizontal)
In principle, "places" (nodes) represent states or resources, and "transitions" (rectangles) represent an event that changes the state (or an action that consumes resources). Your naming convention should better reflect this
Apparently you're missing some condition to stop the process. Now once you start your washing will continue in an endless loop.
I think it would be nice to leave the transition graphics unshaded or unfilled if it is not enabled. Personally I fill it green if it is enabled.
If you want someone to check if you modeled a logic properly in your Petri Net then it would be nice if you include a description of your system logic in prose.

How to make Sequence Diagram for Update Inventory

I'm preparing the sequence diagram for a project. I made the following sequence diagram for a retailer updating his inventory
It's confusing to me because this is the first time I use this technique with a real project.i have used database as an object here and i don't know whether its right or wrong. And another thing i need to clarify is by using Updating i meant for both editing/add new item To the inventory. Is it wrong to do like that way? or else can we draw it separately?
The following image is part of the updating process, would any one take a look and correct me if I did any mistake.(UpdateUI- User interface).Thanks in Advance.
It does not look right. There are a couple of issues:
Your database will likely never issue any messages
Actions inside a DB are usually not exposed. You normally only call CRUD from outside for a DB.
You mix synch/asynch (likely unwillingly). Filled arrows are synch, unfilled ones as asynch.
Main Page is likely the V in MVC and UpdateUI the C. So the controller will act on a click from the user and interact with the DB.
So just from my guts here is a more reasonable sketch:

First Cut Sequence Diagram response

Here is an image of my first cut sequence diagram:
My question is this: the retrieveStockInfo(stkID,stkInfo) method gets the data that is wanted to be shown to the customer. At the moment, I have a response to the activation 'box'. Is this correct? Do I need to return anything else to the actual Customer?
thanks
Yes, you need to return the information to the customer otherwise they will never know what happened!
You might also want to put in error handling sequences. These are often forgotten about in sequence diagrams.

Resources