CNIT 182 Lab Exam 1: Context, Use Case, Class Diagrams

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/82

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:33 PM on 10/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

83 Terms

1
New cards

What is a model?

A representation of reality. Physical model = what the system does AND how (implementation details). Logical model = what the system does/should do, with NO implementation details.

2
New cards

What is a context model diagram (CMD)?

A popular first step in modeling a proposed system: the system as a 'black box' showing only its inputs and outputs. It's the 'view from 50,000 feet': an overview for analyzing project scope, not a detailed picture.

3
New cards

What questions does a context model diagram answer?

What is the system supposed to do? (scope) and How does the system interact with the world around it?

4
New cards

A context model diagram is a special case of what?

A data flow diagram (a process-oriented model). Data flow diagrams focus on processes (transforms) that turn incoming data flows into outgoing data flows.

5
New cards

What does a system (process) do to data?

It transforms data from one form to a different form. If A goes in, A can't come out: it must come out as A'. A system is sometimes called a process.

6
New cards

How many processes are on a context model diagram, and what is its symbol?

Exactly ONE process representing the entire system, drawn as a ROUNDED SQUARE labeled with the system name (e.g., 'Payroll System'). It's a black box: no internal detail.

7
New cards

What is NOT shown on a context model diagram?

Time (system clock) and data stores (files and databases), because they are inside the system. Also no internal processes, and no data flows between two actors.

8
New cards

What is an actor (agent) in a context model diagram?

Someone or something that provides inputs to or receives outputs from the system. Also called an Agent or External Agent. Symbol: SQUARE with a noun/noun-phrase label (e.g., Employee). Actors are the WHO.

9
New cards

Does a CMD show ALL actors?

No. It shows only the MOST IMPORTANT actors.

10
New cards

Typical actors on a context model diagram?

Employees, departments, or users; separate organizations; other information systems. Ask: where does the input data come from, and where does the processed data (information) go?

11
New cards

Information inputs vs. material inputs?

Don't confuse them: we diagram an INFORMATION system. Example: new books (material) vs. packing slips (information).

12
New cards

What is a data flow on a context model diagram?

A line with an arrow and a label describing the data in motion. Arrow direction = direction of the flow (input or output). Data flows are the WHAT: what goes into and comes out of the system.

13
New cards

What must every data flow connect?

The system and an actor. ALL data flows connect the system with an actor. Data flows are external events that bring data in or give information out.

14
New cards

Rule: can a data flow go from one actor to another actor?

NEVER. Every flow must go to or from the system.

15
New cards

What should you do about assumptions when making a CMD?

ALWAYS document any assumptions you make, because other people make different assumptions.

16
New cards

What is a composite data flow?

A combined data flow that will be broken down later. 'Management Reports' is a good example.

17
New cards

Context model diagram checklist (what to verify before turning it in)?

ONE system rounded square ‣ Actors are squares with noun labels ‣ Every arrow connects an actor and the system (never actor-to-actor) ‣ Every arrow labeled with data and pointed the right way ‣ No data stores or time ‣ Assumptions documented

18
New cards

How do you find actors and data flows in a problem statement?

Actors = who provides the data / who uses the information (nouns). Data flows = what goes in and what comes out (what actors input, submit, receive).

19
New cards

Context model diagram vs. use case diagram?

Context model = the system as a black box with its actors and the DATA flowing in and out. Use case diagram = what each actor can DO (the goals/functions) with the system.

20
New cards
<p>Pixton Library CMD: Library Patron, Suppliers, Library Board. Why is it wrong?</p>

Pixton Library CMD: Library Patron, Suppliers, Library Board. Why is it wrong?

Orders is drawn from the Library Board (an actor) to Suppliers (another actor). Data flows may NEVER go actor-to-actor; the flow must connect the system and an actor.

21
New cards
<p>Pixton Library CMD with only Check Outs, Returns and Packing Slips. Why is it wrong?</p>

Pixton Library CMD with only Check Outs, Returns and Packing Slips. Why is it wrong?

It's incomplete: it's missing system outputs/actors from the full story (Renewal Notice, Past Due Notice, Management Reports to Library Board, Orders to Suppliers). A CMD must show all key inputs AND outputs.

22
New cards
<p>ATM context model from lab: what are the actors and data flows?</p>

ATM context model from lab: what are the actors and data flows?

Actors: Customer, Bank Operator. Customer → ATM: Change PIN, Make Deposit, Transfer Between Accounts (Make Withdrawal also tied to the Customer). ATM → Customer: Receipt. Bank Operator → ATM: Update Customer Information. System = ATM (rounded square).

23
New cards

Student Scheduling context model: actors and flows? (from your Week 2 assignment)

Actors: Master Scheduler, Student, Instructor. IN: course, instructor and section information (Master Scheduler); section inquiry and add/drop (Student). OUT: student schedule → Student; course rosters → Instructor; management reports → Master Scheduler.

24
New cards

ATM context model (Week 2 assignment): list actors and flows.

Actor: Bank Patron. IN: ATM card, PIN, transaction type, transaction amount (4 separate flows). OUT: ATM card + receipt (one combined flow).

25
New cards

Why do we model user requirements with use cases?

To document WHAT a proposed information system should do (independent of HOW). Use case diagrams are a UML tool for documenting and modeling user requirements.

26
New cards

What is a scenario?

A sequence of steps describing an interaction between a user and an information system (e.g., a customer buying an item from an e-commerce site).

27
New cards

What is a use case?

A set of scenarios related to a SINGLE user goal. It has a typical course of events (the desired, perfect path) and alternative courses (optional paths to the same goal).

28
New cards

Typical course vs. alternate course of events?

Typical = the desired, perfect path to the user goal. Alternate = other paths to the same goal (errors, exceptions, branches).

29
New cards

What can an actor be on a use case diagram?

Anyone or anything that interacts with the system: a human playing a role; another information system; a device (e.g., a thermostat); or a temporal event (e.g., end of an accounting cycle).

30
New cards

How do you draw a use case on a use case diagram?

As an OVAL. Name it with an ACTION VERB followed by an OBJECT (e.g., 'Add a Class', 'Order Items').

31
New cards

How do you connect actors to use cases, and how are the lines labeled?

A line (an ASSOCIATION) labeled 'initiates' from the actor to the use case. NO arrowhead because no flow. Initially show only initiating actors.

32
New cards
<p>College Enrollment System: who initiates what?</p>

College Enrollment System: who initiates what?

Student initiates Enroll in Class. Registrar initiates Add a Class and Check Class Enrollment. Professor initiates Check Class Enrollment. Actors are stick figures outside the system rectangle; use cases (ovals) are inside it.

33
New cards

How do you determine use cases and actors?

Use cases: look for actions that provide value to a user, named verb + object ('Shopping cart' is NOT a use case; 'Order items' is). Actors: ask WHO initiates or triggers the use case.

34
New cards

What is the temporal actor?

TIME. An often-overlooked actor that triggers use cases (e.g., end of month triggers 'Produce Monthly Reports'). Time can often trigger use cases.

35
New cards
<p>What are the 2 actors here and how do their lines differ?</p>

What are the 2 actors here and how do their lines differ?

Time initiates 'Produce Monthly Reports' (line labeled 'initiates'). Management is a participating actor: it gets something of value when the use case completes, so its line is NOT labeled.

36
New cards

What is a participating actor?

An actor that does NOT initiate or trigger a use case but RECEIVES something of value when it completes (e.g., Management). Shown on the diagram with a line that is NOT labeled.

37
New cards

Use case diagram checklist?

System boundary rectangle with the system name ‣ Actors (stick figures) OUTSIDE it, use cases (ovals) INSIDE ‣ Use cases named verb + object ‣ Associations labeled 'initiates', no arrowheads ‣ Participating actors have unlabeled lines ‣ Don't forget Time ‣ Every context-model data flow is covered

38
New cards

How do you turn a context model diagram (e.g., ATM) into a use case diagram?

Each actor becomes an actor. Each data flow/input that an actor starts suggests a use case (Make Deposit, Change PIN, Transfer Between Accounts, Update Customer Info). Draw 'initiates' lines, and use participating (unlabeled) lines for actors that just receive results.

39
New cards

Student Scheduling use cases (from Week 3)?

Master Scheduler initiates: Modify Course / Section / Instructor Information, View Management Reports. Student initiates: View Section Availability, Add / Drop a Section, View Student Schedule. Instructor initiates: View Course Rosters.

40
New cards

What is a use case narrative?

Text detailing the steps that actually make up a use case. It must be HIGHLY DETAILED: EVERY condition (IF), every branch (true and false), every step and action; specific enough to write a program from.

41
New cards
<p>Sections of the use case narrative template?</p>

Sections of the use case narrative template?

Use-Case Name, ID, Priority, Source, Type ‣ Primary Business Actor, Primary System Actor, Other Participating Actors, Other Interested Stakeholders ‣ Description, Precondition, Trigger ‣ Typical Course of Events (Actor Action | System Response), Alternate Courses ‣ Conclusion, Postcondition, Business Rules, Implementation Constraints and Specifications, Assumptions, Open Issues

42
New cards

How do you number steps in a use case narrative?

Steps are numbered in sequence across BOTH columns, alternating Actor Action / System Response: Step 1 (actor) → Step 2 (system) → Step 3 (actor)… Step 1 starts with 'This use case is initiated when…'; the last step says 'The use case concludes when…'.

43
New cards

How do you write alternate courses?

'Alt Step 4a:' = branches from typical step 4. State the failing condition, what the system does, and 'GO TO Step 3' (where to return). Ex: 4a: ID and/or password not valid. The system notifies the user to provide a valid ID and password GO TO Step 3.

44
New cards

Typical course for Login (slide example): outline the 9 steps.

1 User requests to log in. 2 System prompts for ID and password. 3 User provides ID and password. 4 System verifies them. 5 System retrieves one of five security questions, displays it, prompts for answer. 6 User answers. 7 System verifies the answer. 8 System grants access. 9 Use case concludes when user receives confirmation. Alts: 4a invalid ID/pw → GO TO 3; 7a invalid answer → GO TO 6.

45
New cards

Precondition vs. trigger vs. postcondition?

Precondition = what must be true BEFORE the use case starts (user has logged in). Trigger = the event that starts it (user requests the class list). Postcondition = what is true when it ends (e.g., 'No change').

46
New cards

Primary business actor vs. primary system actor?

Business actor = the role that starts/benefits from the use case in the business (Professor or Registrar). System actor = the one interacting with the system to perform it. In the slide example both are 'Professor or Registrar'.

47
New cards

What goes in Business Rules, Constraints, Assumptions?

Business Rules = policies enforced (professors can run class lists only for their own classes). Implementation Constraints = limits on the solution (option unavailable to students). Assumptions = taken as true (networked or Internet access for professors).

48
New cards

Narrative practice: 'Check Class Enrollment'. Give its key fields.

Actor: Professor or Registrar. Trigger: user requests class list. Pre: user logged in. 1 User selects Check Class Enrollment. 2 If professor, system lists classes taught by that professor; if registrar, lists all classes. 3 User selects a class. 4 System generates report (StudentID, StudentName for each enrolled student) with a print option. Alt: none. Post: no change.

49
New cards

Narrative practice: outline 'System Login' from your Week 3 assignment (3 failures lock account, password ≥ 60 days must change).

Actor: Registered User. Pre: registered with ID, password, answers to 5 questions. Typical: request login → system prompts for ID/password → system validates, shows 1 of 5 random questions → user answers → system validates → checks password age → confirms and grants access. Alts: bad credentials/answer → error, retry; 3 failures → lock account; password ≥ 60 days → change + confirm + log in again.

50
New cards

Narrative practice: outline 'Check Out Equipment' from your Week 3 assignment.

Actor: Employee. Typical: employee requests checkout → system prompts for Employee ID → verifies authorization → for each item, checks skill classification/restrictions → for tracked items checks no outstanding checkout → records checkout → gives receipt with equipment location. Alts: not authorized, restricted, or unavailable → deny with message.

51
New cards

What is OOP?

Object-oriented programming: both the data and the processes of an entity called an 'object' in a single, self-contained unit of code.

52
New cards

What is encapsulation?

Bundling data and behaviors in one object. Encapsulated methods present a PUBLIC interface to the world; outside code can only call the object's public methods. The object becomes a 'black box'.

53
New cards

What is UML?

Unified Modeling Language: a standard set of diagrams for analyzing, constructing, and documenting software and even non-software systems.

54
New cards

List the advantages of OOP.

Improved project efficiency, improved project management, code reuse, and code maintenance.

55
New cards

What is an object?

Anything in an information system about which users want to store data and/or perform actions. Each object includes both its data and its behaviors (methods), integrating data and process. Ex: Customer, Employee, Order.

56
New cards

Object class vs. object instance?

Object class = a general class of objects (e.g., Student). Object instance = each specific object (e.g., each of you). Every instance belongs to a class.

57
New cards
<p>What are the 3 boxes of a class in a class diagram?</p>

What are the 3 boxes of a class in a class diagram?

Top = class name. Middle = attributes. Bottom = behaviors (methods), which can specify parameters. Ex: Customer ‣ -custID, -custName, -address, -phone, -email ‣ +addCustomer(), +updateCustomer(), +deleteCustomer(), +viewCustomerInfo(), +checkBalance().

58
New cards

What naming convention is used for attributes?

camelCase: begin with a lowercase letter; additional words capitalized and added with no spaces (custName, orderDate).

59
New cards

What do - and + mean in front of attributes?

  • = private (cannot be accessed from outside the class). + = public. Attributes are normally private; behaviors are public.
60
New cards

Why are object attributes private?

Attributes can be accessed only through behaviors (e.g., only a cashier or clerk has access to the cash register). The public methods are the only way the private data is viewed, updated, or deleted.

61
New cards

What is a method (behavior) in a class?

A behavior built into the object that is part of its public interface. Methods can take parameters, e.g., deleteCustomer(customerID) or addCustomer(name, address,…).

62
New cards

What are the CRUD behaviors?

Create, Read, Update, Delete: always four behaviors per class (e.g., addCustomer, viewCustomer, updateCustomer, deleteCustomer). They give the public interface to the private attributes.

63
New cards

What is an association (relationship) between classes?

A relationship between any two object classes, drawn as a line between them. Associations are bi-directional and include multiplicity notation. Name the relationship in BOTH directions (e.g., sells / is sold by).

64
New cards

What is multiplicity?

The minimum and maximum number of occurrences of an instance of one object class for each instance of another object class.

65
New cards

List the UML multiplicity notations.

1 = exactly 1 ‣ 0..1 = zero or 1 ‣ 0..* = zero or more ‣ 1..* = 1 or more ‣ 6..9 = specific range

66
New cards
<p>Read this: Salesperson 1 — 0..* Car, 'sells/is sold by'.</p>

Read this: Salesperson 1 — 0..* Car, 'sells/is sold by'.

Each Salesperson sells zero or more Cars; each Car is sold by exactly one Salesperson. (Salesperson has -baseSalary, -commissionRate; Car has -make, -model, -engine, -price.)

67
New cards

What is composition?

An association where a class object is made up of other class objects: a 'part of' / 'is part of' relationship. The part cannot exist independently of the whole (OrderItem can't exist without its Order). Drawn with a filled diamond at the whole.

68
New cards
<p>Read this diagram: Order ◆— OrderItem.</p>

Read this diagram: Order ◆— OrderItem.

Order is the whole (-orderDate, -custID); OrderItem is the part (-item, -price, -quantity). Multiplicity 1 Order to many (*) OrderItems; an OrderItem can't exist without its Order.

69
New cards

What is generalization / specialization (inheritance)?

One object class shares the attributes and behaviors of another. Each subtype instance has its own attributes/behaviors PLUS those inherited from the supertype. Described as 'can be a' / 'is a kind of'. The arrow points from the SUBTYPE to the SUPERTYPE.

70
New cards
<p>What is the supertype, and what are the subtypes?</p>

What is the supertype, and what are the subtypes?

User is the supertype; Student and Professor are subtypes (hollow triangle arrow points to User). Student 0..* — Takes — Course 0..; Professor 1.. — Teaches — 1..* Course.

71
New cards

How do you identify classes from a problem statement or use case narrative?

Noun analysis: the nouns in use case narratives and problem statements often indicate object classes. ALL objects are nouns but NOT every noun is an object.

72
New cards

Noun analysis: which nouns are NOT classes, and why?

Report: generated from existing data. Screen: part of a computer. StudentID, StudentName: attributes of Student. Access: not an object. Students → the class Student (singular). Course, User, Professor ARE classes.

73
New cards

Why might some nouns not become classes?

Some are attributes of object classes, some are just nouns that describe use case actions, and some are synonyms of other nouns.

74
New cards

Where should behaviors be placed in a class diagram?

In the class the action is done TO, not the one doing it. Ex: viewNumberOfStudents belongs in Section (not Professor, even though professors do it).

75
New cards

What are common errors in a first-draft class diagram?

Behaviors placed in the wrong class; attributes missing or misplaced (e.g., IDs, shared data); missing CRUD methods; relationship named in one direction only; missing or wrong multiplicity at one or both ends; missing generalization.

76
New cards

List the steps to build a class diagram from a problem statement.

1 Noun analysis → candidate classes ‣ 2 Drop nouns that are attributes/reports/screens/synonyms ‣ 3 Add private camelCase attributes ‣ 4 Add CRUD behaviors in the correct class ‣ 5 Draw associations and name both directions ‣ 6 Put multiplicity at both ends ‣ 7 Add generalization and composition where appropriate

77
New cards

Practice: draw the Customer class with at least 3 attributes.

Customer ‣ -custID, -custName, -address, -phone, -email ‣ +addCustomer(), +updateCustomer(), +deleteCustomer(), +viewCustomerInfo()

78
New cards

Class diagram lab (Bob's dealership): which classes?

Customer, Manufacturer, Point of Contact, Address, Vehicle, Sale. Address is shared by Customer, Manufacturer and Point of Contact (street, city, state, zip). Only new cars sold to individuals.

79
New cards

Bob's dealership: attributes for Vehicle and Sale?

Vehicle: -vin, -listPrice, -dealerCost, -brand, -modelName, -year. Sale: -dateSold, -soldPrice. Customer: -firstName, -lastName, -phoneNumber. Point of Contact adds -emailAddress. Manufacturer: -name.

80
New cards

Bob's dealership: key associations and multiplicities?

Manufacturer 1 — 1..* Point of Contact; Manufacturer 1 — 0..* Vehicle; Customer 1 — 0..* Sale; Vehicle 1 — 0..1 Sale; Customer, Manufacturer, and Point of Contact each have 1 Address.

81
New cards

Auto dealership lab: where does inheritance apply?

Employee supertype → Mechanic and Salesperson. Customer supertype → Prospective Customer (if prospects are treated as a kind of customer). Others: Car, Car Sale, Service Job.

82
New cards

College enrollment lab: classes, inheritance and key multiplicities?

User (supertype) → Student, Professor, Staff. Plus Course, Section, Department, Plan of Study. Department 1 — 0..* Course; Course 1 — 1..* Section; Student 1..* — 0..* Section; Professor 1 — 0..* Section.

83
New cards

Which diagram answers which question? (Context vs. Use Case vs. Class)

Context model = system scope: actors and data flows in/out. Use case diagram = user goals: what each actor does with the system. Class diagram = the system's objects: attributes, behaviors, relationships and multiplicity.