Sad Ch6
Sad Ch6
Analysis
Analysis model
Entity, boundary and control class/object
Dynamic model/ state chart
An Overview of Analysis
• Analysis results in a model of the system that aims to be correct, complete,
consistent, and unambiguous.
• Developers validate, correct and clarify the requirements specification if any errors
or ambiguities are found.
• The client and the user are usually involved in this activity when the requirements
specification must be changed and when additional information must be gathered.
An Overview of Analysis
• The analysis workflow of the Unified Process has two overall aims.
• From the viewpoint of the requirements workflow (the preceding workflow), the
aim of the analysis workflow is to obtain a deeper understanding of the
requirements.
• From the viewpoint of the design and implementation workflows (the workflows
that follow the analysis workflow), the aim of the analysis workflow is to
describe those requirements in such a way that the resulting design
and implementation are easy to maintain.
An Overview of Analysis
• Analysis focuses on producing a model of the system, called the analysis model,
which is correct, complete, consistent, and verifiable.
• Depicted with UML class diagrams, includes classes, attributes, and operations.
• State machines represent the behavior of a single object (or a group of very tightly
coupled objects).
• For example, classes such as Database, Session Manager, Network should not
Entity, Boundary, and Control Objects
• The analysis object model consists of entity, boundary, and control objects.
• Boundary objects represent the interactions between the actors and the system.
• At the top of the hierarchy is a general concept , and at the bottom of the
hierarchy are the most specialized concepts.
Analysis Activities: From Use Cases to Objects
• The following are the activities that transform the use cases and scenarios
produced during requirements elicitation into an analysis model. Generally
analysis activities include:
• Identifying Entity Objects
• Identifying Boundary Objects
• Identifying Control Objects
• Mapping Use Cases to Objects with Sequence Diagrams
• Modeling Interactions among Objects with CRC Cards
• Identifying Associations
• Identifying Aggregates
• Identifying Attributes
• Modeling State-Dependent Behavior of Individual Objects
• Modeling Inheritance Relationships
• Reviewing the Analysis Mode
Identifying Entity Objects
• Noun extraction / natural language analysis
• found by examining each use case and identifying candidate objects.
Using natural language analysis
• Pioneered by Russell Abbott (1983), popularized by Grady Booch
• Not perfect, but coupled with other techniques, it's a good start
• This can be done from a general problem description, or better, from a use
case or scenario
• Map parts of speech to object model components.
• nouns usually map to classes, objects, or attributes
• verbs usually map to operations or associations
Using natural language analysis
Identifying Entity Objects
• Heuristics for identifying entity objects
• Terms that developers or users need to clarify in order to understand the use
case
• Recurring nouns in the use cases
• Real-world entities that the system needs to track
• Real-world activities that the system needs to track
• Data sources or sinks
Identifying Boundary Objects
• Heuristics for identifying boundary objects
• Identify user interface controls that the user needs to initiate the use case (e.g.,
Report Emergency Button).
• Identify forms the users needs to enter data into the system (e.g., Emergency
Report Form).
• Identify notices and messages the system uses to respond to the user (e.g.,
Acknowledgment Notice).
• When multiple actors are involved in a use case, identify actor terminals (e.g.,
Dispatcher Station) to refer to the user interface under consideration.
• Do not model the visual aspects of the interface with boundary objects.
• Always use the end user’s terms for describing interfaces; do not use terms from
the solution or implementation domains.
Identifying Control Objects
• Heuristics for identifying control objects
• Identify one control object per use case.
• Identify one control object per actor in the use case.
• The life span of a control object should cover the extent of the use case or the
extent of a user session. If it is difficult to identify the beginning and the end of a
control object activation, the corresponding use case probably does not have well-
defined entry and exit conditions.
• For each class, the software development team fills in a card showing the name
of the class, its functionality (responsibility), and a list of the other
classes it invokes to achieve that functionality (collaboration).
Introduction to CRC
• The strength of CRC cards is that, when utilized by a team, the interaction
among the members can highlight missing or incorrect fields in a class,
whether attributes or methods.
• Also, the relationships between classes are clarified when CRC cards are used.
• One especially powerful technique is to distribute the cards among the team
members, who then act out the responsibilities of their classes.
Introduction to CRC
• A weakness of CRC cards is that this approach generally is not a good way of
identifying entity classes unless the team members have considerable
experience in the relevant application domain.
• On the other hand, once the developers have determined many of the classes
and have a good idea of their responsibilities and collaborations, CRC cards
can be an excellent way of completing the process and making sure that
everything is correct.
Introduction to CRC
• So how do you create CRC models? Iteratively perform the following steps:
• Find classes
• Find responsibilities.
• Define collaborators.
• Move the cards around.
Mapping Use Cases to Objects with Sequence Diagrams
• CRC cards and sequence diagrams are two different representations for supporting
the same type of activity.
• Sequence diagrams are a better tool for a single modeler or for documenting a
sequence of interactions, because they are more precise and compact.
• CRC cards are a better tool for a group of developers refining and iterating over an
object structure during a brainstorming session, because they are easier to create
and to modify
Identifying Associations
• class diagrams allow developers to describe the interdependencies of objects.
• An association shows a relationship between two or more classes.
• Identifying associations has two advantages. First, it clarifies the analysis model by
making relationships between objects explicit
• Second, it enables the developer to discover boundary cases associated with links.
Boundary cases are exceptions that must be clarified in the model.
• Name, role and multiplicity are properties of association.
• Initially, the associations between entity objects are the most important, as they
reveal more information about the application domain.
Identifying Associations
• associations can be identified by examining verbs and verb phrases denoting a
state
(e.g., has, is part of, manages, reports to, is triggered by, is contained in, talks to,
includes).
• Every association should be named, and roles should be assigned to each end.
Identifying Aggregates
• Aggregations are special types of associations denoting a whole–part relationship.
• It represent the behavior of the system from the perspective of a single use case.
• Viewing behavior from the perspective of each object enables the developer to
build a more formal description of the behavior of the object, and consequently,
to identify missing use cases.
Modeling Inheritance Relationships
between Objects
• Generalization is used to eliminate redundancy from the analysis model.