The use case: modeling behavior

Use cases are among the best-known types of modeling There is a good reason for this: when we describe something, we are particularly interested in its behavior. And use cases allow us to do this.
It is easy to successfully specify use cases in a short time if a few basic concepts are internalized and a few rules are followed. That's what this article is about.
Use cases are also striking in their graphic form and have a high recognition value. They are ovals that are connected to the corresponding actuator with a line.
Use cases are part of both UML and SysML. In SysML there is also the element "Actor", but it is recommended to use blocks instead. There are formal reasons for this, but intuitively this is important because an actor does not necessarily have to be a person.
The image is (almost) useless
It cannot be said often enough: the diagram is not the model, but merely a view of the model. Therefore, the image should at best be understood as a map that provides a rough overview. The information behind the use case is more important.
This is also reflected in the fact that it Countless templates for formulating use cases exists. These are typically tables with more or less numerous entries. When working with a modelling tool such as No Magic or Enterprise Architect, the tool provides over a hundred standardized attributes.
A simple use case
A simple use case only consists of a name, actuator and description. This may also explain why it is possible to work with use cases without a modeling tool. Here is a simple example:
| Name | Log out |
| Actuators | Every logged in user |
| Description | As a user, I would like to log out of the system so that no one from this web browser has access to my account. |
Of course, the description that can follow a test template is very important, e.g: "As I want so that ".
Add detail
What has been shown so far is extremely minimal. Even when working without a modeling tool, a typical use case contains more than just the three fields listed above. The library of templates linked above provides many suggestions. As in many other situations, however, it is advisable to only include the fields that are actually needed.
Do not use more fields than are absolutely necessary.
Modeling instead of documenting
What has been shown so far could also be implemented in a word processor. But even in this form, we are already dealing with a simple model. Specifically, we already have two data types (actuator and use case) that are linked to each other via a relationship. This alone can be helpful. If, for example, an actuator is not linked to a single use case, we should ask ourselves whether this actuator is really a stakeholder.
But things get really interesting when we start to link the use case with the domain. Because in order to describe behavior, we also need a description of the part of the world we are looking at. And for this we need the domain model, which is described in the SysML with blocks is described. To take up the example above: Our domain model hopefully describes what we mean by system, and what an account is.
It is now possible to go into more and more detail here. In extreme cases, this goes so far that the behavior of the resulting model can be simulated and the software code can be generated from the model. How this is done in concrete terms (e.g. by modeling activities) is not within the scope of this article.
Too much formality can quickly make the model confusing, incomprehensible and difficult to maintain.
In a longer article in the RE magazine, I report on a Case study from the logistics sector which shows how effectively use cases can be specified.
Choose the right method
Use cases are a language element. This means we need to understand the language and use it correctly. It is not advisable to "just start specifying". In this blog, I already mentioned the ICONIX process which, in my opinion, offers a good introduction. But there are also many other methods, and perhaps it is enough to design a simple method yourself and summarize it on a few pages. But it is particularly important in a team that there is a common set of rules.
If these simple rules are followed, then nothing stands in the way of successful use case modeling.
Photo by Agnieszka Boeske on Unsplash






