How to determine non-human actors of a use case? - uml

I'm just learning about UML and am questioning how to define actors correctly. I know that actors perform role in the system and I don't have a problem determining human actors. My question is how do I decide what non-human, external components are actors on the system.
For example, in a home automation system a homeowner and a system installer would be actors. Would it be correct to name a door sensor or a coffee maker an actor? These components receive signals from the main computer module and use cases could be written for actions taken on them (i.e. turn the coffee maker on/off).
Is the main computer/server the "system" or is the system made up of the collection of the computer/server and all of the components (lighting modules, coffee makers, door sensors)?

I think that you must first define system's boundaries, it will be then more easy to understand external actors but keep in mind that actors usually treated as black boxes.
For example if the automation system finds out that the food supplies are low and need a restock it may initiate an order perhaps on an online service; in this case the online system accepting such orders is an actor, you don't need to know how it will process the order, you as a developer of the automation system need to know it's public interface in order to interact with it.
An actor is someone or something (another system) that interacts with the system you are trying to develop. More formally an actor initiates use cases.

#Stef - An actor can also assist the primary actor to achieve the stated goal of the use case. That would be the case with the online service from your example. The online service wouldn't initiate any use cases here, but in receiving the order, it becomes a secondary actor to the Order Food Supplies use case.

Related

Can there be a use case diagram for an app that is completely offline?

I am building an app that is completely client side with 0 backend, as all the data is completely static and non modifiable. From what I understand of USE case diagrams, they are supposed to represent actions and reactions between user and server. But if there is no involvement of a server, can there be a USE case diagram??
I tried looking up on reddit and stack overflow but didn't find anything on specifically on client side apps. I am expecting an explanation.
You can use a use-case as long as you have an actor, a subject (i.e. a system), and a goal. According to the UML specifications:
Each UseCase specifies some behavior that a subject can perform in collaboration with one or more Actors. UseCases define the offered Behaviors of the subject without reference to its internal structure.
Front-end, backend, client-side app, server are about internal structure of your system. They don't matter for the use-case. What matters is the goal that an actor (user) wants to achieve with your system.
Use-cases are not either meant to describe the details of the interaction with your system. Modeling such details requires somehow to take into account the sequence of the interactions or the flow of events. Use-cases, on contrary, have no sequential order and no workflow. There are other modeling for that.
Last but not least, use-cases shall not to be confused with user-interfaces. User interface is about how the interaction happen, whereas use-case is what the interaction is about. Use wireframes or other techniques for user-interfaces. Even the inventor of use-cases, Ivar Jacobson, explained that it was a bad thing to let user interface design be tied to use-cases.

UML Diagram-Is sending an email within my application considered as external system

My application have a contact option which will open the email app with the massage page and the message receiver is set to be the application support email.(I have attached a picture of what I mean)
I have written it as a requirement but not sure on how to illustrate it in the system class diagram and Use case diagram.
What i have initially did in the use case diagram is: connect my user(Primary actor) to the use case "Contact Support Team" which is connected to a secondary actor "Mail system".
As for the the class diagram I have attached a picture of the part of the class diagram the shows this connection.
I'm confused by it since after the implementation I’m not sure if what I documented is accurate and if the mail system is considered as an external system here, and from what I understand is that if I'm dealing with an API then it is considered as an external system so is that applicable on the situation here?
The boundaries of a system are a fuzzy topic, because it depends on your definition of the system. In other words: you set the boundaries.
To take an extreme example, Ivar Jacobson, the inventor of the use-cases has written a book (The Object Advantage:business process reengineering with object technology) about applying object oriented modeling to human organisations (i.e. companies). The system under consideration is in this case a business made of components which are departments, people and IT systems. Of course, you can then zoom on the IT system (i.e a subsystem of the organisational system) and see the other elements as external. You could zoom further on one subsystem of the IT system and consider the other subsystems as external, and so on. Up to you to decide at which level you see things.
More generally, and independently of Jacobson‘s pioneering work and even object orientation, very complex systems (satellite systems, telephone networks, …) are often seen as systems of systems. There‘s even a profesional organisation fir people working in these extremely complex environments (INCOSE).
Coming back on your question: the mail system can be seen as an autonomous independent system, since it has an own purpose and can be useful independently of your app. It is therefore a candidate actor and, hence, external to your system.
On the other side, you could add an email function forwarding emails using SMTP directly from your app. So you could see the emailing system as an implementation detail of your system (and you just happen to rely on something existing). So it is a matter of viewpoint. Whatever your choice, the diagrams are not wrong and you can explain the scope that you use in your model to avoid ambiguity. The only thing, is that you should stay consistent with your own viewpoint.

Use Case / UML scenario for App and an external system

I am currently working on the use cases for a car sharing app.
The simple diagram for the process of registration looks like this:
At the moment I am stuck with the following scenarios.
When a new customer is registered, a process is carried out at the head office (central)in which the following points are checked
Scenario 1 - Head office side:
1. The identity of new customers is carried out externally with
the post. Two possibilities: presenting the identity card at a post office branchor carrying out by video.
2. The verification of the customer's bank details is carried out externally with the bank.
3.The system will verify that the contact details (email address) are correct
4.the consent to the GTC has been obtained
My sketch for the confirmation process looks like this:
How do I show that the system verifies that the contact details (email address) is correct ? How do I show that consent to the GTC has been given ?
Scenario 2 - Customer's side: A customer can view and edit the information of his registration.
1.Edit profile data
2.Edit contact information
3.Edit bank details.
If information is changed during editing, verification must be carried out again by the head office.
What would the two use case diagrams look like ?
One or two apps?
(Posted before diagrams were added to the question)
Nothing in the narrative says that you need two systems. It's too early to decide about system architecture. You could have the following variants, each with pros and cons:
one and the same system (e.g. post office and customer access it via the web);
one and the same system that is accessible using different components on different devices (e.g. a rich client in the post office, a web interface for the customer on her mac/PC and a mobile app for a customer when using a smartphone);
several independent systems (e.g. a back office in the post-office, and an independent app that would connect not only to the back office, but also to other back-end services e.g. from other companies).
But how do you want to decide before first knowing what is needed and how the needs are related?
First, you have to understand the big picture of what's needed. Focus on the users not on the inner details of your solutions, as explained in the UML specifications:
UseCases are a means to capture the requirements of systems, i.e., what systems are supposed to do. (...)
a UseCase (...) specifies a set of behaviors (...), which yields an observable result that is of value for Actors or other stakeholders (...)
(...) without reference to its internal structure
Look into your narrative to find actors (people, organisation, responsibilities), their goals (what do they need to do?) and how they could relate to each other. Just try a first sketch.
Your current model
(Posted after the diagrams were added)
I still see no reason to go for 2 distinct systems. You are working on a solution for car sharing. It may have different sub-systems/components, but the actors do not care. And neither does your customer. But:
If you'd go for two independent systems, you'd draw two disginct diagrams, and in each diagram you'd have an actor representing the other system that interacts with the system under consideration. As said, this makes sense only if it's an independent system.
In your case, I could imagine this for the bank account verification and the video identity verification: unless you intend to develop your own super-secured AI component capable of doing this, you'd probably outsource this to a specialized company, that may offer this service via an automated API.
The identify verification is at a different level of details than the other use-cases. You may want to show it in a separate diagram, in order not to pollute the main diagram.
And lastly, your second diagram has some issues:
the arrows of extend and include should not following the same direction: the target of an include is the included use case whereas the target of the extend arrow should be the use case that is extended (and not the use case that is extending the normal use case as you have shown).
ID correct and Bank correct are states. Use cases do not show states. The end-state can be specified in the description of the use-case but not in the use-case diagram.
Post office, Bank account, Video seem to be use-cases, but they are not well described.
A possible diagram could therefore be:
Note: I'd personally prefer specialization of Ensure identity. This corresponds more to the reality that there are two very distinct behaviors. But extension is ok.
Just to stress this fact: you do NOT describe a scenario with use cases. A use case is "just" to show the added value a system under consideration delivers to one of its actors. What you are asking is functional decomposition and that's just plain wrong. You would describe a scenario with an activity diagram (or as plain text like in the Cockburn way).

Use Case Diagram with Database and Web Servers

I'm finding it hard to get around my head how the specific scenario would work out:
I have a database server, a web server and a user.
When the user registers a service is created to the web server, the web server then goes to the database server and returns to the web server to register the details.
How would I actually illustrate this.
I have created the three Actors; User, Web Server, Database Server.
As a note I have read many online resources, and also a Book on UML.
Thanks in advance.
Are the DB/web servers part of the system you're implementing? If so you don't need them as Actors. UC Diagrams should only show actors outwith the scope of your system.
So you only need one Actor (User) in this case. The Use Case should describe the goal from the User's perspective (e.g. "Buy a Widget").
You could show the servers in a diagram showing how the UC is realised - usually a sequence diagram or activity diagram. Although I'd typically expect to see logical entities (classes) as well / instead of the physical servers.
hth.
I agree with maple_shaft's last statement. A high-level UC (use case) is a vehicle for capturing requirements.
Req'ts are the "what" of a system. What is the system supposed to do. What does the user need to accomplish. What interaction does the user need from the system.
By capturing system components in your UC you are injecting "how" into it and that's inappropriate for a UC. You don't want your use case to say how the system will accomplish something as that's an implemenation decision.
In short, I disagree that you really want to create a Use Case diagram. This sounds more like a component diagram.
Use case diagrams should represent user flow and non-technical flow from a user perspective, not demonstrate underlying architectural structure.

How can a piece of hardware be an actor in a use case diagram?

How can a piece of hardware be an actor when designing a use case diagram?
I got confused because I've read on Wikipedia this:
A use case should not include detail regarding user interfaces and screens. This is done in user-interface design, which references the use case and its business rules.
If you give me an example about hardware being an actor, I'd be grateful.
I'd suggest the important part here is the definition of an actor.
An actor specifies a role played by a person or thing when interacting with the system
In the system of traffic intersection, there are many 'hardware' actors, including Car and Traffic Light. The system under consideration is the rules around what do to (yield, merge, stop) and when.
How about a third party system - for example a warehouse management system that produces a feed of stock level changes for different products, which is consumed by your retail application.
That would be an actor. It will not have a UI or screen, but communicate with your system, cause different events to occur and have its own business rules.
The following can all be "actors" on a system you are describing, if these components are outside the scope of the system being described:
A scheduled task
A server component
An automated network client (or whatever's on the other end of a network connection)
If the source of a request for your system to do something is outside the scope of the system, it is usually not necessary to separate the human component from any external tool or hardware they are using to facilitate the requests on your system. In such cases, the actors could very well be automatons.

Resources