Search code examples
use-casediagramming

Should interface be part of a system in use case diagram?


My system is a soda can machine. You can put a coin and buy soda from this machine. The interface is a keypad and digital screen.

One of my requirements is that the user can put x dollars into machine and then add items to his order. Then, the machine will show him the order total.

That is, "show user order total" Should I show this in my use case diagram? If yes, then how do i show it?


Solution

  • No, you should not. For several reasons.

    1. Use cases are typically used to convey functional requirements. Requirements should be solution-independent. They should outline "what" a system should do but not "how". If you have a given interface that you must operate with, then you'd document that as a constraint, not as a use case. See A. Cockburn, Writing Effective Use Cases, p. 191 "Mistakes Fixed: Too many user interface details"
    2. Use cases describe the interaction with a system from a user's point of view. You may want to include the system as an actor as well; but then still...:
    3. ... the use case you describe would probably be too fine grained. See A. Cockburn, Writing Effective Use Cases, p. 192 "Mistakes Fixed: Very low goal levels"

    If you still want to highlight that aspect in your use case diagram (which can be useful depending on your needs) then consider naming the use case "verify order total" and assign it to your primary actor. IMO that would be perfectly fine for a subfunction level.