What is a use case?
A use case is a description of how a user interacts with a system to achieve a specific goal. It shows the scenario of using the product through the user's eyes, not the developer's.
Essence
A use case answers a simple question: "What does the user do, and what should the system respond with?" It is not about the interface and buttons, but about the logic of interaction - step by step. For example: "The user resets a password via email" is a separate use case.
Main elements of a use case
- Actor - the one who interacts with the system. This can be a person (user, administrator) or another system (API, database).
- Goal - what the actor wants to achieve: register, pay for an order, download a report.
- Main Flow - the sequence of steps when everything goes according to plan. Example:
- the user enters a login and password,
- the system checks the data,
- the system opens the personal account.
- Alternative / Exception Flows - what happens if something goes wrong. Example: the user entered a wrong password → the system shows an error.
- Preconditions - what must be true before the scenario starts. For example, the user must be registered.
- Postconditions - what happens after the scenario completes successfully. For example, the user is authorized and sees the home page.
Use case example
Name: Password recovery Actor: User Precondition: The user is registered Main flow:
- The user clicks "Forgot password?"
- Enters their email
- The system sends an email with a recovery link
- The user follows the link and enters a new password
- The system saves the password and reports success Alternative flow:
- If the email is not found, the system reports an error.
Why use cases are needed
- They help understand the system's behavior before it is implemented.
- They simplify communication between business and developers - everyone sees the same scenario.
- They form the basis for test cases and technical requirements.
Conclusion
A use case is a tool that describes the "user ↔ system" interaction through real scenarios. It helps all project participants understand equally what the system does and why, before coding begins.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.