software engineering lecture 5

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/104

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

105 Terms

1
New cards

What is the main gap that software design addresses?

The gap between requirements (what the system should do) and code (how the system fulfills requirements)

2
New cards

What is software design?

A creative process to transform user requirements into visualized form describing what and how the system will be developed; an iterative process translating requirements into a blueprint for constructing software code

3
New cards

What are the two main types of design artifacts in software design?

Conceptual Design (What) - meant for customers (UI designs, use-case diagrams); Technical Design (How) - meant for developers (structural models, behavioral models, architectural designs)

4
New cards

Why do we need software modeling?

To clarify and visualize software, specify behavior and structure, document development decisions, and facilitate communication between different users

5
New cards

What is the goal of software models?

To bridge the gap between requirements and code by documenting solutions to problems defined by requirements

6
New cards

What does UML stand for and when was it proposed?

Unified Modeling Language, proposed in 1995 to unify different modeling notations

7
New cards

What is UML?

A general purpose notation used to visualize, specify, construct and document artifacts of software-based systems, business processes, and similar processes

8
New cards

What are the two main ways UML is used?

As a blueprint (detailed plan) and as a sketch (draft or outline)

9
New cards

What characterizes UML as sketch?

Common in agile methods, used to discuss or document parts of design and code, lightweight and informal use of notation, goal is not to create complete blueprint-style model

10
New cards

What is forward engineering with UML sketches?

Using sketches to discuss alternative designs before any code is written

11
New cards

What is reverse engineering with UML sketches?

Using sketches to explain existing code in the context of software maintenance and evolution

12
New cards

What are the two main categories of UML diagrams?

Static Diagrams (model code's structure) and Dynamic Diagrams (model system's behavior at runtime)

13
New cards

What are the three UML diagrams covered in this lecture?

Use Case Diagrams, Class Diagrams, and Sequence Diagrams

14
New cards

What is a use case?

A specification of system behavior describing a set of sequences of actions, including variants, that a system performs to yield an observable result of value to an actor

15
New cards

What is an actor in UML?

An idealization of an external person, process, or thing interacting with a system, subsystem, or class; characterizes interactions that outside users may have with the system

16
New cards

What does a use case diagram specify?

The behavior of a system through sequences of actions to yield an observable result of value to an actor; captures intended behavior (the what) omitting implementation (the how)

17
New cards

What are the four elements of a use case diagram?

Systems, Actors, Use Cases, and Relationships

18
New cards

How is a system represented in a use case diagram?

As a rectangle with its name at the top (subject symbol) to indicate system boundary

19
New cards

How is an actor rendered in a use case diagram?

As a stick figure

20
New cards

What are the two types of actors in use case diagrams?

Primary Actors (initiate system use, placed on left side) and Secondary Actors (reactionary, system initiates interaction with them, placed on right side)

21
New cards

How is a use case depicted in a diagram?

As an oval shape with a unique label (usually starting with a verb) representing a high-level action/feature

22
New cards

What does an association relationship represent in use cases?

Bi-directional communication between the actor and the system; represented as a solid line drawn between an actor and a use case

23
New cards

What is generalization in use case diagrams?

Also called inheritance, shows specialized use cases from the general base case; depicted by an arrowed line (can apply to use cases or actors)

24
New cards

What does the <> relationship mean?

A dotted line with arrow pointing to the include use case; occurs when a chunk of behavior is similar across more than one use case; used instead of copying behavior description

25
New cards

What does the <> relationship mean?

A dotted line labeled <> with arrow toward the base case; means the base use case can optionally be extended by another use case under certain conditions; base class declares "extension points"

26
New cards

When should you use <> vs <>?

Use <> if the usage is required by multiple use cases; use <> if the base use case is complete and the usage may be optional

27
New cards

What should each use case describe?

A significant chunk of system usage that is understandable by both domain experts and programmers

28
New cards

What should a use case diagram contain?

Only use cases at the same level of abstraction and only required actors

29
New cards

How should large numbers of use cases be organized?

Into packages

30
New cards

What does a class diagram describe?

Static structure showing the types of objects in a system and the relationships between them

31
New cards

What are the main elements of a class diagram?

Boxes (Classes with Attributes and Operations) and Relationships (Association, Generalization/Inheritance, Composition/Aggregation, Dependence)

32
New cards

What is a class in UML?

The most important building block of any object-oriented system; a description of a set of objects; an abstraction of entities existing in the problem/solution domain

33
New cards

How is a class depicted in UML?

As a class-box with up to three sections

34
New cards

For conceptual design, how can a class box be drawn?

With only two sections (without details)

35
New cards

What are attributes in a class diagram?

The adjectives and properties of a given entity; equivalent to instance variables in programming languages

36
New cards

What can be specified within the attributes section?

Visibility scope, type of the attribute, and default value

37
New cards

What are the four visibility scopes in UML?

  • Public (accessible from anywhere), # Protected (accessible to subclasses only), - Private (not accessible except from class only), ~ Package (accessible from classes of same package)
38
New cards

What is the default visibility if no symbol is shown?

Usually private

39
New cards

How are static attributes represented in UML?

By underlining (e.g., num_users); these are global variables belonging to the class and shared between all objects of the same class

40
New cards

How are constant variables conventionally written?

In capital letters

41
New cards

How are computed/derived attributes indicated?

With a forward slash / before the attribute name (e.g., /age); indicates the attribute is computed during retrieval and not stored

42
New cards

What are operations and methods in UML?

Actions, functions or operations that can be performed by a given class

43
New cards

What can be specified for class operations?

Visibility modifier, operation name, passed parameters, and return type

44
New cards

Should setters and getters be added to UML class diagrams?

Better not; the aim of UML diagrams is to simplify and convey understanding of system design, not to care about non-architectural details

45
New cards

What is an interface in UML?

Composed of attributes and operations (signatures) that need to be implemented inside a class; drawn same way as class but with <> annotation above the interface name

46
New cards

What must an interface have?

At least one class to implement its operations

47
New cards

What is the noun extraction heuristic for finding classes?

Each noun in the requirements text is a potential class or attribute (e.g., "User submits a form" → User, Form)e.g., "User submits a form" → User, Form)

48
New cards

What is the domain concepts heuristic?

Identify real-world entities the system must represent (e.g., Customer, Order, Invoice)

49
New cards

What is the responsibilities heuristic?

Look for entities that have behavior or store information (e.g., Payment handles processing)

50
New cards

What should you avoid when finding classes?

Functional concepts - ignore verbs, operations, or UI elements (e.g., Print, Click, Save)

51
New cards

How do you refine attributes when finding classes?

Some nouns are just attributes, not classes (e.g., "Student has a name" → name is an attribute)

52
New cards

How do you check for redundancy in classes?

Merge synonyms or overlapping concepts (e.g., Customer vs. Client)

53
New cards

In the example "A customer places an order that contains several items. The system calculates the total and generates an invoice," what are the resulting classes?

Customer, Order, Item, Invoice (drop System - too generic, Total - attribute)

54
New cards

What does a simple association represent?

A structural link between two classes; drawn as a simple line, optionally labeled with relationship name or roles the classes play

55
New cards

What can be added to improve readability of associations?

An arrow/triangle

56
New cards

What do multiplicity symbols represent?

The minimum and maximum times a class instance can be associated with the related class instance

57
New cards

What are common multiplicity notations?

___ (various options including: 1, 0..1, , 1.., 0..*, n..m for specific ranges)

58
New cards

What is an association class?

A class which associates to other classes when the relationship needs to have further attributes or information; linked to the association solid line by a dashed line; drawn as a normal class

59
New cards

When would you use an association class?

When the association needs further information (e.g., Student-School relationship needs registration year, academic year, status)

60
New cards

What does aggregation represent?

A logical "a-part-of" relationship between multiple classes or a class and itself

61
New cards

What does "logical" imply in aggregation?

Whole class can be removed without impacting the composing classes; composing classes can compose different whole classes at the same time (multiplicity can be *)

62
New cards

How is aggregation depicted?

___ (typically with a hollow diamond on the "whole" side)

63
New cards

What does inheritance or generalization show?

That one class (subclass) inherits from another class (superclass); properties and operations of the superclass are valid for objects of the subclass

64
New cards

How is generalization shown?

With a solid line from the subclass to the superclass and a hollow arrow pointing at the superclass

65
New cards

What is a dependency relationship?

A directed relationship showing that some UML element requires, needs or depends on other model elements for specification or implementation

66
New cards

When does a dependency exist?

If changes to the definition of one element may cause changes to the other (but not the other way around)

67
New cards

How is a dependency drawn?

As a dashed-line arrow (Class 1 depends on Class 2)

68
New cards

Do dependencies indicate multiplicity?

No, dependencies do not indicate any multiplicity

69
New cards

What does - mean in UML visibility?

Private

70
New cards

What does + mean in UML visibility?

Public

71
New cards

How is a simple association typically implemented in code?

As an instance variable/field in the class (e.g., Order has a Customer field)

72
New cards

How is a one-to-many association implemented?

Using a collection/list (e.g., Order has a List)

73
New cards

How are bidirectional associations implemented?

Both classes have references to each other (e.g., Order has Customer, Customer has List)

74
New cards

How is inheritance implemented in code?

Using the extends keyword (in Java) or similar inheritance syntax

75
New cards

How are dependencies typically represented in code?

As local variables, method parameters, or return types that are not stored as fields

76
New cards

What is the difference between <> and <>?

<> means the behavior is required and reused across multiple use cases; <> means the base use case is complete and can optionally be extended under certain conditions
77
New cards

What is the difference between association and dependency?

Association represents a structural relationship (usually stored as a field); dependency represents a weaker relationship (local variable, parameter) where changes to one may affect the other

78
New cards

What is the difference between aggregation and composition?

___ (Both are "part-of" relationships; composition is stronger - parts cannot exist without the whole; aggregation is weaker - parts can exist independently)

79
New cards

What is the difference between static and dynamic UML diagrams?

Static diagrams model code's structure; dynamic diagrams model system's behavior at runtime

80
New cards

What is the difference between conceptual design and technical design?

Conceptual design (What) is meant for customers (UI designs, use-case diagrams); technical design (How) is meant for developers (structural models, behavioral models)

81
New cards

What is the difference between forward and reverse engineering with UML?

Forward engineering uses sketches to discuss alternative designs before code is written; reverse engineering uses sketches to explain existing code during maintenance

82
New cards

When defining use cases in text, what should you do with nouns and verbs?

Use them accurately and consistently to help derive objects and messages for interaction diagrams

83
New cards

What should you do with common usages required by multiple use cases?

Factor them out; use <> if required, consider <> if base use case is complete and usage is optional

84
New cards

What level of abstraction should use cases have in one diagram?

All use cases should be at the same level of abstraction

85
New cards

Why shouldn't you add getters and setters to UML class diagrams?

To simplify and convey understanding of system design without non-architectural details

86
New cards

What makes a good use case?

It describes a significant chunk of system usage understandable by both domain experts and programmers

87
New cards

How should you handle static attributes in UML?

Underline them and use capital letters for constant variables

88
New cards

What is the purpose of the / symbol before an attribute?

To indicate the attribute is computed/derived and not stored (e.g., /age)

89
New cards

True or False: A use case diagram should show implementation details of how the system works

False - use case diagrams capture intended behavior (the what) omitting implementation (the how)

90
New cards

True or False: Secondary actors are placed on the left side of a use case diagram

False - primary actors (who initiate) are on the left; secondary actors (reactionary) are on the right

91
New cards

True or False: All attributes without a visibility symbol are public by default

False - default is usually private

92
New cards

True or False: Dependencies indicate multiplicity like associations do

False - dependencies do not indicate any multiplicity

93
New cards

True or False: In aggregation, the whole class cannot be removed without impacting composing classes

False - in aggregation, the whole class can be removed without impacting the composing classes

94
New cards

True or False: UML sketches are only useful in forward engineering

False - UML sketches are useful in both forward engineering (before code) and reverse engineering (explaining existing code)

95
New cards

True or False: Every noun in requirements should become a class

False - some nouns are attributes, some are too generic (like "System"), and synonyms should be merged

96
New cards

If you see a dashed arrow from ClassA to ClassB in a class diagram, what does it mean?

ClassA depends on ClassB (changes to ClassB may cause changes to ClassA, but not the other way around)

97
New cards

If a use case diagram shows a dotted line from "Process Payment" to "Validate Card" with <>, what does this tell you?

"Process Payment" requires and reuses the "Validate Card" behavior; it's a mandatory part of processing payment

98
New cards

You see an attribute written as "/age : int" in a class diagram. What does this mean?

Age is a computed/derived attribute that is calculated when retrieved, not stored in the database

99
New cards

A class diagram shows "Student -------- 0..* School" with a dashed line connecting to a box labeled "Enrollment". What is this?

An association class showing that the Student-School relationship has additional attributes (like registration year, status) stored in Enrollment

100
New cards

In a requirements document: "The manager approves a request submitted by an employee." Identify potential classes.

Manager, Request, Employee (drop "approves" and "submitted" - they are verbs/actions)