Chapter 10
Requirements Modeling: Class-Based Methods
Slide Set to accompany
Software Engineering: A Practitioner’s
Approach, 8/e
by Roger S. Pressman
Slides copyright © 1996, 2001, 2005, 2009, 2014 by Roger S. Pressman
For non-profit educational use only
May be reproduced ONLY for student use at the university level when used in conjunction
with Software Engineering: A Practitioner's Approach, 8/e. Any other reproduction or use is
prohibited without the express written permission of the author.
All copyright information MUST appear if these slides are posted on a website for student
use.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 1
Requirements Modeling
Strategies
One view of requirements modeling, called structured
analysis, considers data and the processes that transform
the data as separate entities.
Data objects are modeled in a way that defines their
attributes and relationships.
Processes that manipulate data objects are modeled in a
manner that shows how they transform data as data
objects flow through the system.
A second approach to analysis modeled, called object-
oriented analysis, focuses on
the definition of classes and
the manner in which they collaborate with one another to
effect customer requirements.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill 2014). Slides copyright 2014 by
Roger Pressman. 2
Class-Based Modeling
Class-based modeling represents:
objects that the system will manipulate
operations (also called methods or services) that will
be applied to the objects to effect the manipulation
relationships (some hierarchical) between the objects
collaborations that occur between the classes that are
defined.
The elements of a class-based model include
classes and objects, attributes, operations, CRC
models, collaboration diagrams and packages.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 3
Identifying Analysis
Classes
Examining the usage scenarios developed as
part of the requirements model and perform a
"grammatical parse" [Abb83]
Classes are determined by underlining each noun or
noun phrase and entering it into a simple table.
Synonyms should be noted.
If the class (noun) is required to implement a
solution, then it is part of the solution space;
otherwise, if a class is necessary only to describe a
solution, it is part of the problem space.
But what should we look for once all of the
nouns have been isolated?
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 4
Manifestations of Analysis
Classes
Analysis classes manifest themselves in one of the
following ways:
• External entities (e.g., other systems, devices, people) that
produce or consume information
• Things (e.g, reports, displays, letters, signals) that are part of
the information domain for the problem
• Occurrences or events (e.g., a property transfer or the
completion of a series of robot movements) that occur within
the context of system operation
• Roles (e.g., manager, engineer, salesperson) played by people
who interact with the system
• Organizational units (e.g., division, group, team) that are
relevant to an application
• Places (e.g., manufacturing floor or loading dock) that
establish the context of the problem and the overall function
• Structures (e.g., sensors, four-wheeled vehicles, or computers)
that define a class of objects or related classes of objects
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 5
Potential Classes
Retained information. The potential class will be useful during analysis
only if information about it must be remembered so that the system can
function.
Needed services. The potential class must have a set of identifiable
operations that can change the value of its attributes in some way.
Multiple attributes. During requirement analysis, the focus should be on
"major" information; a class with a single attribute may, in fact, be
useful during design, but is probably better represented as an attribute
of another class during the analysis activity.
Common attributes. A set of attributes can be defined for the potential
class and these attributes apply to all instances of the class.
Common operations. A set of operations can be defined for the potential
class and these operations apply to all instances of the class.
Essential requirements. External entities that appear in the problem
space and produce or consume information essential to the operation
of any solution for the system will almost always be defined as classes
in the requirements model.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 6
Defining Attributes
Attributes describe a class that has been selected
for inclusion in the analysis model.
build two different classes for professional baseball
players
• For Playing Statistics software: name, position, batting
average, fielding percentage, years played, and games
played might be relevant
• For Pension Fund software: average salary, credit
toward full vesting, pension plan options chosen,
mailing address, and the like.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 7
Defining Operations
Do a grammatical parse of a processing
narrative and look at the verbs
Operations can be divided into four broad
categories:
(1) operations that manipulate data in some way
(e.g., adding, deleting, reformatting, selecting)
(2) operations that perform a computation
(3) operations that inquire about the state of an
object, and
(4) operations that monitor an object for the
occurrence of a controlling event.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 8
CRC Models
Class-responsibility-collaborator (CRC) modeling
[Wir90] provides a simple means for
identifying and organizing the classes that are
relevant to system or product requirements.
Ambler [Amb95] describes CRC modeling in
the following way:
A CRC model is really a collection of standard index
cards that represent classes. The cards are divided
into three sections. Along the top of the card you
write the name of the class. In the body of the card
you list the class responsibilities on the left and the
collaborators on the right.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 9
CRC
Modeling Class:
Class:
Description:
Class:
Description:
Class: FloorPlan
Description:
Responsibility:
Description: Collaborator:
Responsibility: Collaborator:
Responsibility: Collaborator:
Responsibility: Collaborator:
defines floor plan name/type
manages floor plan positioning
scales floor plan for display
scales floor plan for display
incorporates walls, doors and windows Wall
shows position of video cameras Camera
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 10
Class Types
Entity classes, also called model or business
classes, are extracted directly from the statement of
the problem (e.g., FloorPlan and Sensor).
Boundary classes are used to create the interface
(e.g., interactive screen or printed reports) that the
user sees and interacts with as the software is used.
Controller classes manage a “unit of work” [UML03]
from start to finish. That is, controller classes can be
designed to manage
the creation or update of entity objects;
the instantiation of boundary objects as they obtain
information from entity objects;
complex communication between sets of objects;
validation of data communicated between objects or
between the user and the application.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 11
Responsibili
ties
System intelligence should be distributed across
classes to best address the needs of the problem
Each responsibility should be stated as generally
as possible
Information and the behavior related to it should
reside within the same class
Information about one thing should be localized
with a single class, not distributed across
multiple classes.
Responsibilities should be shared among related
classes, when appropriate.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 12
Collaboratio
ns
Classes fulfill their responsibilities in one of two ways:
A class can use its own operations to manipulate its own
attributes, thereby fulfilling a particular responsibility, or
a class can collaborate with other classes.
Collaborations identify relationships between classes
Collaborations are identified by determining whether a
class can fulfill each responsibility itself
three different generic relationships between classes
[WIR90]:
the is-part-of relationship
the has-knowledge-of relationship
the depends-upon relationship
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 13
Composite Aggregate
Class
Player
PlayerHead PlayerBody PlayerArms PlayerLegs
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 14
Associations and
Dependencies
Two analysis classes are often related to
one another in some fashion
In UML these relationships are called
associations
Associations can be refined by indicating
multiplicity (the term cardinality is used in
data modeling
In many instances, a client-server
relationship exists between two analysis
classes.
In such cases, a client-class depends on the
server-class in some way and a dependency
relationship is established
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 15
Multiplicit
y
Wa ll
1 1 1
is used to build is used to build
1..* 0..* is used to build 0..*
Wa llSe g m e n t Win d o w Do o r
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 16
Dependenci
es
DisplayWindow Camera
<<access>>
{password}
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 17
Analysis
Packages
Various elements of the analysis model (e.g.,
use-cases, analysis classes) are categorized
in a manner that packages them as a
grouping
The plus sign preceding the analysis class
name in each package indicates that the
classes have public visibility and are
therefore accessible from other packages.
Other symbols can precede an element within
a package. A minus sign indicates that an
element is hidden from all other packages
and a # symbol indicates that an element is
accessible only to packages contained within
a given package.
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 18
Analysis Packages
p ackag e n ame
Environm e nt
+Tree
+Landscape
+Road
+Wall
+Bridge
+Building Rule s OfThe Gam e
+VisualEffect
+Scene +RulesOfMovement
+ConstraintsOnAction
Charact e rs
+Player
+Protagonist
+Antagonist
+SupportingRole
These slides are designed to accompany Software Engineering: A
Practitioner’s Approach, 8/e (McGraw-Hill, 2014). Slides copyright 2014 by
Roger Pressman. 19