Getting Started with Use Case Diagrams, Documents, and Templates

UPI Study › Courses › System Analysis and Design › Free lessons › Lesson 4.4 Free with a free account

Getting Started with Use Case Diagrams, Documents, and Templates

System Analysis and Design · Chapter 4: Requirements Validation, Modeling, and UMLSection 4.4 · lesson 27 of 698 min · free with a free account

← UML Models Unpacked: Design Patterns and Practical CasesNext lesson: Data Flow Diagrams: How Data Moves Through a System →

Earn 3 college credits for System Analysis and DesignRecommended for credit by NCCRS · Computer Science 390 · self-paced · one payment, lifetime access

In this lesson

Sketching use cases, documenting them in full, and comparing them with user stories.

  • Identify actors, use cases, and the system boundary in a use case diagram
  • Distinguish the include, extend, and generalization relationships
  • Write a use case narrative with pre- and postconditions, main and alternate flows
  • Compare use cases with user stories, and choose between them

Transcript

Everything said in the video, section by section (1,166 words). Read along, or search it.

Requirements Validation, Modeling, and UML

Use Case Diagrams, Documents, and Templates

Earlier in the course, use cases came up briefly. This section teaches them properly. We will cover the diagram notation used to sketch use cases at a glance. The written template used to document one in full detail. And how the technique compares with the shorter user story format, common in agile work.

What a Use Case Is

Value, Seen From Outside

A use case describes a way a system delivers value to someone outside it. And it is told from that person's point of view, rather than the system's internal logic. That perspective is the whole point. A use case is not about how the system works inside. It is about what someone outside can accomplish with it. Use cases come in two forms. A diagram sketches many use cases at a glance. And a written narrative documents one use case in full detail.

Figure 1

Actors, Use Cases, and the System Boundary

Here is a basic use case diagram, for an online banking system. On the left is an actor, drawn as a stick figure. This one is the customer. The rectangle is the system boundary. Everything inside it is part of the system being built. Inside it are three use cases, drawn as ovals. View balance, transfer funds, and pay bill. Plain lines, called associations, connect the actor to each use case it takes part in. Notice the placement rule. Actors always sit outside the boundary. Use cases always sit inside it. That echoes the context diagram from earlier in this chapter. The boundary separates what you build from who uses it.

The Notation

4 Elements

Let's name the four elements precisely. An actor, drawn as a stick figure, represents anyone or anything outside the system that interacts with it. Typically that is a type of user, but sometimes it is another system. A use case, drawn as an oval, names one specific goal the actor can accomplish using the system. The system boundary, drawn as a rectangle, marks what is inside the system, and what is outside it. And an association, a plain line, connects an actor to a use case it participates in. Four simple shapes. That simplicity is why stakeholders with no technical background can read these diagrams.

Figure 2

Include, Extend, and Generalization

Beyond simple associations, three more relationships connect use cases to each other. The first is include. A base use case always performs an included use case, as part of its own flow. The arrow points from the base to the included use case. For example, transfer funds always includes verify account. The second is extend. An extending use case adds optional behavior to a base use case, but only under certain conditions. Here the arrow points the other way, from the extension to the base. For example, schedule recurring payment extends pay bill, only when the customer chooses that option. The third is generalization. A child use case is a specialized version of a more general parent. It is drawn with a hollow triangle, pointing from child to parent. Pay by card, and pay by bank transfer, both generalize to make payment.

Documenting in Full

The Use Case Narrative Template

A use case diagram shows that a use case exists. It does not show what actually happens inside it. The narrative template captures that detail. And it does so in a standard structure, so any use case is documented the same way, whoever writes it. It has four sections. Preconditions state what must already be true before the use case can begin. The main flow is the numbered sequence of steps followed when everything goes as expected. Alternate flows are numbered variations, tied to a main-flow step, that handle exceptions or choices. And postconditions state what must be true once the use case finishes successfully.

Worked Example (1 of 2)

Use Case: Transfer Funds

Here is a complete narrative, for transfer funds. The precondition. The customer is logged in, and has at least one active account. Now the main flow. Step one, the customer selects transfer funds. Step two, the system displays the customer's accounts, and their balances. Step three, the customer selects a source account, a destination account, and an amount. Step four, the system verifies the source account. That step is exactly the include relationship we just saw. Transfer funds includes verify account. Step five, the system transfers the amount, and displays a confirmation.

Worked Example (2 of 2)

When Things Go Differently

Now the alternate flows, where things go differently. Alternate flow three A. The customer enters an amount greater than the source account balance. The system displays an error, and returns to step three. Alternate flow four A. Account verification fails. The system displays an error, and cancels the transfer. Notice the numbering. Each alternate flow is tied to the main-flow step it branches from. Finally, the postconditions. The source account balance is decreased, and the destination balance increased, by the transferred amount. Those postconditions are also a ready-made test. After a successful transfer, both balances must have moved by exactly that amount.

2 Formats

Use Cases vs. User Stories

How does a use case compare with a user story? A user story is a short, one- or two-sentence statement of a need. It usually takes the form, as a type of user, I want a goal, so that a benefit. It captures the same underlying idea as a use case, but at a much smaller scale. A use case is a full narrative, with preconditions, flows, and postconditions. A user story is a single sentence, often expanded later with acceptance criteria. Use cases suit complex, regulated, or safety-critical workflows. User stories suit iterative, fast-moving projects, where scope shifts often. Use cases are usually written by an analyst, and often reviewed formally. User stories are often written by the whole team, together. And use cases capture exceptions explicitly, in alternate flows. User stories usually handle exceptions as separate stories. Neither format is strictly better. Many teams use user stories for day-to-day planning, and reserve full use cases for workflows complex or risky enough to need the detail.

Key Terms

The Vocabulary of This Section

Let's lock in the key terms. An actor is someone or something outside the system that interacts with it, drawn as a stick figure. A use case is a specific goal the actor can accomplish, drawn as an oval. The system boundary is the rectangle marking what is inside the system. An include relationship is always performed. An extend relationship adds optional behavior, under certain conditions. Generalization shows a child use case as a specialized version of a parent. A use case narrative documents preconditions, the main flow, alternate flows, and postconditions. And a user story states a need, as a user, I want a goal, so that a benefit.

Key Takeaways

What to Carry Forward

To pull this together. A use case diagram has three core elements. Actors outside the system, use cases inside it, and the system boundary between them. Include means the base use case always performs the included one. Extend means the extension runs only under certain conditions. Generalization, drawn with a hollow triangle, shows a child use case as a specialized version of a parent. A use case narrative documents preconditions, a main flow, alternate flows, and postconditions, in a standard structure. And use cases suit complex or regulated workflows, while user stories suit fast-moving, iterative work.

About System Analysis and Design at UPI Study

System Analysis and Design (Computer Science 390) is a self-paced online course of 69 video lessons in 9 chapters, from the analyst's role and requirements to UML modeling, interface and database design, testing, maintenance and project management. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Software Engineering vs Systems Analysis

Why take it here

Why students take System Analysis and Design with UPI Study

From business problem to working systemSystem Analysis and Design teaches how analysts study a business need and turn it into a system design: requirements, UML and data-flow models, interface and database design, implementation and project management. It is a core course in information systems and IT degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

System Analysis and Design carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Getting Started with Use Case Diagrams, Documents, and Templates

What are the main elements of a use case diagram?
A use case diagram has four main elements: actors, use cases, the system boundary, and associations. An actor, drawn as a stick figure, is a user or another system outside the system. A use case, drawn as an oval, names one goal the actor can accomplish. The system boundary is a rectangle containing the use cases, and associations are plain lines linking actors to the use cases they take part in.
What is the difference between include and extend in a use case diagram?
An include relationship means the base use case always performs the included use case, while an extend relationship adds optional behavior only under certain conditions. The include arrow points from the base to the included use case, as when transfer funds includes verify account. The extend arrow points from the extension to the base, as when schedule recurring payment extends pay bill only if the customer chooses it.
What goes into a use case narrative template?
A use case narrative template has four sections: preconditions, a main flow, alternate flows, and postconditions. Preconditions state what must be true before the use case begins. The main flow is the numbered sequence of steps when everything goes as expected. Alternate flows are numbered variations tied to a main-flow step that handle exceptions or choices. Postconditions state what must be true after successful completion and double as a ready-made test.
When should you use a use case instead of a user story?
Use cases suit complex, regulated, or safety-critical workflows, while user stories suit iterative, fast-moving projects where scope shifts often. A user story is a one- or two-sentence statement, usually in the form as a type of user, I want a goal, so that a benefit. A use case is a full narrative that captures exceptions explicitly in alternate flows. Many teams plan with user stories and reserve use cases for complex or risky workflows.

About the System Analysis and Design course

How many college credits is System Analysis and Design?
System Analysis and Design (Computer Science 390) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does System Analysis and Design cost and what is included?
$250, paid once, with lifetime access: all 69 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does System Analysis and Design take?
It is self-paced with no deadlines. The 69 lessons total about 9 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in System Analysis and Design.

69 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

System Analysis and Design
3 credits · NCCRS
Enroll →