Se Unit 3 Notes
Se Unit 3 Notes
Se Unit 3 Notes
SE-unit-3 notes
Unit-3:Requirements Analysis, Scenario-Based Modeling, UML Models That Supplement the Use Case, Data
Modeling Concepts, Class-Based Modeling, Requirements Modeling Strategies, Flow-Oriented Modeling,
Creating a Behavioral Model, Patterns for Requirements Modelling, Requirements Modeling for WebApps.
REQUIREMENTS ANALYSIS
Requirements analysis results in the specification of software’s operational characteristics, indicates
software’s interface with other system elements, and establishes constraints that software must meet.
Requirements analysis allows you to elaborate on basic requirements established during the inception,
elicitation, and negotiation tasks thatare part of requirements engineering.
The requirements modeling action results in one or more of the following types of models:
• Scenario-based models of requirements from the point of view of various system “actors”
• Data models that depict the information domain for the problem
Class-oriented models that represent object-oriented classes (attributes and operations) and the
manner inwhich classes collaborate to achieve system requirements
Flow-oriented models that represent the functional elements of the system and how they
transform data as itmoves through the system
Behavioral models that depict how the software behaves as a consequence of external “events”
These models provide a software designer with information that can be translated to architectural, interface,
and component-level designs. Finally, the requirements model provides the developer and the customer with
the means to assess quality once software is built.
Throughout requirements modeling, primary focus is on what, not how. What user interaction occurs in a
particular circumstance, what objects does the system manipulate, what functions must the system
perform, what behaviors does the system exhibit, what interfaces are defined, and what constraints apply?
Fig : The requirements model as a bridge between the system description and the design model
The requirements model must achieve three primary objectives:
(1) To describe what the customer requires,
(2) to establish a basis for the creation of a software design, and
(3) to define a set of requirements that can be validated once the software is built.
The analysis model bridges the gap between a system-level description that describes overall system or
business functionality as it is achieved by applying software, hardware, data, human, and other system
elements and a software design that describes the software’s application architecture, user interface, and
component-level structure.
Analysis Rules of Thumb
Arlow and Neustadt suggest a number of worthwhile rules of thumb that should be followed when creating
the analysismodel:
• The model should focus on requirements that are visible within the problem or business domain.
The levelof abstraction should be relatively high.
• Each element of the requirements model should add to an overall understanding of software
requirements and provide insight into the information domain, function, and behavior of the system.
• Delay consideration of infrastructure and other nonfunctional models until design. That is, a
database may be required, but the classes necessary to implement it, the functions required to
access it, and the behavior that will be exhibited as it is used should be considered only after
problem domain analysis has been completed.
• Minimize coupling throughout the system. It is important to represent relationships between
1
classes and functions. However, if the level of “interconnectedness” is extremely high, effort should
be made to reduce it.
• Be certain that the requirements model provides value to all stakeholders. Each constituency has
its own usefor the model
• Keep the model as simple as it can be. Don’t create additional diagrams when they add no new
information. Don’t use complex notational forms, when a simple list will do.
Domain Analysis
Domain analysis doesn’t look at a specific application, but rather at the domain in which the application resides.
The “specific application domain” can range from avionics to banking, from multimedia video games to
software embedded within medical devices. The goal of domain analysis is straightforward: to identify
common problem solving elements that are applicable to all applications within the domain, to find or create
those analysis classes and/oranalysis patterns that are broadly applicable so that they may be reused.
Requirements Modeling Approaches
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.
A second approach to analysis modeling, called object-oriented analysis, focuses on the definition of
classes and the manner in which they collaborate with one another to effect customer requirements. UML
and the Unified Process are predominantly object oriented.
Each element of the requirements model is represented in following figure presents the problem from a
different point of view.
Scenario-based elements depict how the user interacts with the system and the specific sequence of
activities that occur as the software is used.
Class-based elements model the objects that the system will manipulate, the operations that will be applied
to the objects to effect the manipulation, relationships between the objects, and the collaborations that
occur between the classes that are defined.
To begin developing a set of use cases, list the functions or activities performed by a specific actor.
Refining a Preliminary Use Case
Each step in the primary scenario is evaluated by asking the following questions:
• Can the actor take some other action at this point?
• Is it possible that the actor will encounter some error condition at this point? If so, what might it be?
• Is it possible that the actor will encounter some other behavior at this point (e.g.,behavior that is
invoked by some event outside the actor’s control)? If so, what might it be?
Cockburn recommends using a “brainstorming” session to derive a reasonably complete set of exceptions
for each use case. In addition to the three generic questions suggested earlier in this section, the following
issues should also be explored:
• Are there cases in which some “validation function” occurs during this use case? This implies that
validation function is invoked and a potential error condition might occur.
• Are there cases in which a supporting function (or actor) will fail to respond appropriately? For
example, a user action awaits a response but the function that is to respond times out.
• Can poor system performance result in unexpected or improper user actions? For example, a Web-
based interface responds too slowly, resulting in a user making multiple selects on a processing
button. These selects queue inappropriately and ultimately generate an error condition.
Writing a Formal Use Case
The typical outline for formal use cases can be in following manner
• The goal in context identifies the overall scope of the use case.
• The precondition describes what is known to be true before the use case is initiated.
• The trigger identifies the event or condition that “gets the use case started”
• The scenario lists the specific actions that are required by the actor and the appropriate system
responses.
• Exceptions identify the situations uncovered as the preliminary use case is refined Additional
headings may ormay not be included and are reasonably self-explanatory.
Every modeling notation has limitations, and the use case is no exception. A use case focuses on
functional andbehavioral requirements and is generally inappropriate for nonfunctional requirements
However, scenario-based modeling is appropriate for a significant majority of all situations that you will
encounter as asoftware engineer.
**************************************************************************************
3.4. DATA MODELING CONCEPTS
Data modeling is the process of documenting a complex software system design as an easily understood
diagram, usingtext and symbols to represent the way data needs to flow. The diagram can be used as a
blueprint for the construction of new software or for re-engineering a legacy application. The most widely
used data Model by the Software engineers is Entity-Relationship Diagram (ERD), it addresses the issues
and represents all data objects that are entered, stored, transformed, and produced within an application.
Data Objects
A data object is a representation of composite information that must be understood by software. A data
object can be an external entity (e.g., anything that produces or consumes information), a thing (e.g., a
report or a display), an occurrence (e.g., a telephone call) or event (e.g., an alarm), a role (e.g., salesperson),
an organizational unit (e.g., accounting department), a place (e.g., a warehouse), or a structure (e.g., a file).
For example, a person or a car can be viewed as a data object in the sense that either can be defined in
terms of a set of attributes. The description of the data object incorporates the data object and all of its
attributes.
A data object encapsulates data only—there is no reference within a data object to operations that act on
the data. Therefore, the data object can be represented as a table as shown in following table. The headings
in the table reflect attributes of the object.
Data Attributes
Data attributes define the properties of a data object and take on one of three different characteristics. They
can be used to (1) name an instance of the data object, (2) describe the instance, or (3) make reference to
another instance in another table.
Relationships
Data objects are connected to one another in different ways. Consider the two data objects, person and car.
These objects can be represented using the following simple notation and relationships are 1) A person
owns a car, 2) A person is insured to drive a car
Class-based modeling represents the objects that the system will manipulate, the operations that will be
applied to the objects to effect the manipulation, relationships between the objects, and the collaborations
that occur between the classes that are defined. The elements of a class-based model include classes and
objects, attributes, operations, class responsibility-collaborator (CRC) models, collaboration diagrams, and
packages.
Identifying Analysis Classes
We can begin to identify classes by examining the usage scenarios developed as part of the requirements
model and performing a “grammatical parse” on the use cases developed for the system to be built.
Analysis classes manifest themselves in one of the following ways:
• External entities (e.g., other systems, devices, people) that produce or consume information to be used
by a computer-based system.
• 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.
6
• 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 of the system.
• Structures (e.g., sensors, four-wheeled vehicles, or computers) that define a class of objects or related
classes of objects.
Coad and Yourdon suggest six selection characteristics that should be used as you consider each potential
class for inclusion in the analysis model:
1. Retained information. The potential class will be useful during analysis only if information about it must
be remembered so that the system can function.
2. Needed services. The potential class must have a set of identifiable operations that can change the value
of its attributes in some way.
3. 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.
4. Common attributes. A set of attributes can be defined for the potential class and these attributes apply
to all instances of the class.
5. Common operations. A set of operations can be defined for the potential class and these operations
apply to all instances of the class.
6. 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.
Specifying Attributes
Attributes describe a class that has been selected for inclusion in the requirements model. In essence, it is
the attributes that define the class—that clarify what is meant by the class in the context of the problem
space.
To develop a meaningful set of attributes for an analysis class, you should study each use case and select
those “things”that reasonably “belong” to the class.
Defining Operations
Operations define the behavior of an object. Although many different types of operations exist, they can
generally 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.
to provide a class with the information needed to complete a responsibility. In general, a collaboration
implies either a request for information ora request for some action. A simple CRC index card is illustrated
in following figure.
3. The review leader reads the use case deliberately. As the review leader comes to a named object,
she passes a token to the person holding the corresponding class index card.
10
4. When the token is passed, the holder of the card is asked to describe the responsibilities noted on
the card. Thegroup determines whether one (or more) of the responsibilities satisfies the use-case
requirement.
5. If the responsibilities and collaborations noted on the index cards cannot accommodate the use
case, modifications are made to the cards. This may include the definition of new classes (and
corresponding CRC index cards) or the specification of new or revised responsibilities or
collaborations on existing cards.
Associations and Dependencies
An association defines a relationship between classes. An association may be further defined by
indicating
multiplicity. Multiplicity defines how many of one class are related to how many of another class.
A client-server relationship exists between two analysis classes. In such cases, a client class depends on
the server classin some way and a dependency relationship is established. Dependencies are defined by a
stereotype. A stereotype is an “extensibility mechanism” within UML that allows you to define a special
modeling element whose semantics are custom defined. In UML. Stereotypes are represented in double
angle brackets (e.g., <<stereotype>>).
Analysis Packages
An important part of analysis modeling is categorization. That is, various elements of the analysis model
(e.g., use cases, analysis classes) are categorized in a manner that packages them as a grouping—called an
analysis package— that is given a representative name.
Fig : Packages
****************************************************************************************
3.5. REQUIREMENTS MODELING STRATEGIES
One view of requirements modeling, called structured analysis,. Data objects are modeled in a way that
defines their attributes and relationships. Processes that manipulate data objects are modeled in a manner
11
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.
****************************************************************************************
12
A level 0 DFD for the security function is shown in above figure. The primary external entities (boxes)
produce information for use by the system and consume information generated by the system. The labeled
arrows represent dataobjects or data object hierarchies.
The level 0 DFD must now be expanded into a level 1 data flow model. you should apply a “grammatical
parse” to the use case narrative that describes the context-level bubble. That is, isolate all nouns (and noun
phrases) and verbs (and verb phrases). The grammatical parse is not foolproof, but it can provide you with
an excellent jump start, if you’re struggling to define data objects and the transforms that operate on them.
The processes represented at DFD level 1 can be further refined into lower levels. The refinement of DFDs
continues until each bubble performs a simple function. That is, until the process represented by the bubble
performs a function that would be easily implemented as a program component. a concept, Cohesion can
be used to assess the processing focus of a given function. i.e refine DFDs until each bubble is “single-
minded.”
13
15
outside as the system performs its Function Two different behavioral representations are discussed in the
paragraphs that follow. The first
17
indicates how an individual class changes state based on external events and the second shows the
behavior of the software as a function of time.
State diagrams for analysis classes. One component of a behavioral model is a UML state diagram that
represents active states for each class and the events (triggers) that cause changes between these
active states. The followingfigure illustrates a state diagram for the ControlPanel object in the SafeHome
security function. Each arrow shown in figure represents a transition from one active state of an object to
another. The labels shown for each arrow represent the event that triggers the transition
18
The pattern can be reused when performing requirements modeling for an application within a domain.
Analysis patterns are stored in a repository so that members of the software team can use search facilities
to find and reuse them.Once an appropriate pattern is selected, it is integrated into the requirements model
by reference to the pattern name.
Discovering Analysis Patterns
The requirements model is comprised of a wide variety of elements: scenario-based (use cases), data-
oriented (the data model), class-based, flow-oriented, and behavioral. Each of these elements examines
the problem from a different perspective, and each provides an opportunity to discover patterns that may
occur throughout an application domain, or by analogy, across different application domains.
The most basic element in the description of a requirements model is the use case. Use cases may serve
as the basis fordiscovering one or more analysis patterns.
A semantic analysis pattern (SAP) “is a pattern that describes a small set of coherent use cases that
together describea basic generic application”
**********************************************************************************************
3.9. REQUIREMENTS MODELING FOR WEBAPPS
Requirements analysis does take time, but solving the wrong problem takes even more time.
A content object might be a textual description of a product, an article describing a news event, an action
photograph taken at a sporting event, a user’s response on a discussion forum, an animated representation
19
of a corporate logo, a short video of a speech, or an audio overlay for a collection of presentation slides.
The content objects might be stored
20
as separate files, embedded directly into Web pages, or obtained dynamically from a database. Content
objects can be determined directly from use cases by examining the scenario description for direct and
indirect references to content. The content model must be capable of describing the content object
Component.
Navigation Modeling
Navigation modeling considers how each user category will navigate from one WebApp element (e.g.,
content object) to another. The mechanics of navigation are defined as part of design. At this stage, you
should focus on overall navigation requirements. The following questions should be considered:
• Should certain elements be easier to reach than others? What is the priority for presentation?
• Should certain elements be emphasized to force users to navigate in their direction?
• How should navigation errors be handled?
• Should navigation to related groups of elements be given priority over navigation to a specific element?
• Should navigation be accomplished via links, via search-based access, or by some other means?
• Should certain elements be presented to users based on the context of previous navigation actions?
• Should a navigation log be maintained for users?
• Should a full navigation map or menu be available at every point in a user’s interaction?
• Should navigation design be driven by the most commonly expected user behaviors or by the perceived
importance ofthe defined WebApp elements?
• Can a user “store” his previous navigation through the WebApp to expedite future usage?
• For which user category should optimal navigation be designed?
• How should links external to the WebApp be handled? Overlaying the existing browser window? As a new
browserwindow? As a separate frame?
These and many other questions should be asked and answered as part of navigation analysis.