Lecture 5: Reqs Modeling

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Scenario-Based Modeling

"[Use-cases] are simply an aid to defining what exists outside the system (actors) and what should be performed by the system (use-cases)." Ivar Jacobson (1) What should we write about? (2) How much should we write about it? (3) How detailed should we make our description? (4) How should we organize the description?

Reqs Modelling Objectives

1. describe what customer wants 2. make sw design foundation 3. define reqs for post-build validation

Weak Inheritance Relationship

A weak is-an-extension-of relationship can be represented using interfaces. For example, the weak is-an-extension-of relationship "students are comparable based on their grades" can be represented by implementing the Comparable interface

Requirements Modeling for WebApps

Content Analysis. The full spectrum of content to be provided by the WebApp is identified, including text, graphics and images, video, and audio data. Data modeling can be used to identify and describe each of the data objects. Interaction Analysis. The manner in which the user interacts with the WebApp is described in detail. Use-cases can be developed to provide detailed descriptions of this interaction. Functional Analysis. The usage scenarios (use-cases) created as part of interaction analysis define the operations that will be applied to WebApp content and imply other processing functions. All operations and functions are described in detail. Configuration Analysis. The environment and infrastructure in which the WebApp resides are described in detail. Navigation model. It defines the overall navigation strategy for the app.

Inheritance

Inheritance models the is-an-extension-of relationship between two classes.

Domain Analysis (Firesmith)

Software domain analysis is the identification, analysis, and specification of common requirements from a specific application domain, typically for reuse on multiple projects within that application domain . . . [Object-oriented domain analysis is] the identification, analysis, and specification of common, reusable capabilities within a specific application domain, in terms of common objects, classes, subassemblies, and frameworks . . .

Activity Diagram explanation

Supplements the use case by providing a graphical representation of the flow of interaction within a specific scenario

UML Sequence Diagram for the Actuator-Sensor Pattern

[insert diagram]

Scenarios

• A scenario is an instance of a use case describing a concrete set of actions. • We describe a scenario using a template with three fields: ◦ The name of the scenario enables us to refer to it unambiguously. The name of a scenario is underlined to indicate that it is an instance. ◦ The participating actor instances field indicates which actor instances are involved in this scenario. Actor instances also have underlined names. ◦ The flow of events of a scenario describes the sequence of events step by step.

Use Cases

• A use case is a description or scenario that depicts how the user interacts with the product or system • To create a use case, the analyst must first identify the different types of people (or devices) that use the system or product • These actors represent roles that people (or devices) play as the system operates

Aggregation and Composition

• Aggregation is a special form of association, which represents an ownership relationship between two classes. Aggregation models the has-a relationship. • If an object is exclusively owned by an aggregated object, the relationship between the object and its aggregated object is referred to as composition.

Reviewing the CRC Model

• All participants in the review (of the CRC model) are given a subset of the CRC model index cards. ◦ Cards that collaborate should be separated (i.e., no reviewer should have two cards that collaborate). • All use-case scenarios (and corresponding use-case diagrams) should be organized into categories. • 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. • When the token is passed, the holder of the class card is asked to describe the responsibilities noted on the card. ◦ The group determines whether one (or more) of the responsibilities satisfies the use-case requirement. • 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.

Object-Oriented Concepts

• An object is an entity that has a state and a defined set of operations which operate on that state. The state is represented as a set of object attributes. The operations associated with the object provide services to other objects (clients) which request these services when some computation is required. • Objects are created according to some object class definition. An object class definition serves as a template for objects. It includes declarations of all the attributes and services which should be associated with an object of that class.

How Much to Write About?

• As further conversations with the stakeholders progress, the requirements gathering team develops use cases for each of the functions noted. • In general, use cases are written first in an informal narrative fashion. • If more formality is required, the same use case is rewritten using a template.

Relationships among Classes

• Association • Aggregation • Composition • Inheritance

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.

Requirements Modeling

• Behavior • Patterns • Web/Mobile Apps

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.

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.

Collaborations

• 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

Manifestations of Analysis Classes

• 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

The Interaction Model

• Composed of four elements: ◦ use-cases ◦ sequence diagrams ◦ state diagrams ◦ a user interface prototype • Each of these is an important UML notation

An Example

• Consider the following preliminary use case for software required to control and monitor a rear-view camera and proximity sensor for an automobile: Use case: Monitor reverse motion Description: When the vehicle is placed in reverse gear, the control software enables a video feed from a rear-placed video camera to the dashboard display. The control software superimposes a variety of distance and orientation lines on the dashboard display so that the vehicle operator can maintain orientation as the vehicle moves in reverse. The control software also monitors a proximity sensor to determine whether an object is inside 10 feet of the rear of the vehicle. It will automatically break the vehicle if the proximity sensor indicates an object within 3 feet of the rear of the vehicle.

The Content Model

• Content objects are extracted from use-cases ◦ examine the scenario description for direct and indirect references to content • Attributes of each content object are identified • The relationships among content objects and/ or the hierarchy of content maintained by a WebApp ◦ Relationships—entity-relationship diagram or UML ◦ Hierarchy—data tree or UML

Domain Analysis

• Define the domain to be investigated. • Collect a representative sample of applications in the domain. • Analyze each application in the sample. • Develop an analysis model for the objects.

Exceptions

• Describe situations (failures or user choices) that cause the system to exhibit unusual behavior • Brainstorming should be used to derive a reasonably complete set of exceptions for each use case • Are there cases where a validation function occurs for the use case? ◦ Are there cases where a supporting function (actor) fails to respond appropriately? ◦ Can poor system performance result in unexpected or improper use actions? • Handling exceptions may require the creation of additional use cases

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.

Reviewing a Use-Case

• Each primary scenario should be reviewed and refined to see if alternative interactions are possible • Can the actor take some other action at this point? • Is it possible that the actor will encounter an error condition at some point? If so, what? • Is it possible that the actor will encounter some other behavior at some point? If so, what?

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.

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?

When Do We Perform Analysis?

• In some Web/Mobile App situations, analysis and design merge. However, an explicit analysis activity occurs when ... ◦ the Web or Mobile App to be built is large and/ or complex ◦ the number of stakeholders is large ◦ the number of developers is large ◦ the development team members have not worked together before ◦ the success of the app will have a strong bearing on the success of the business

State Representations

• In the context of behavioral modeling, two different characterizations of states must be considered: ◦ the state of each class as the system performs its function and ◦ the state of the system as observed from the outside as the system performs its function • The state of a class takes on both passive and active characteristics [CHA93]. ◦ A passive state is simply the current status of all of an object's attributes. ◦ The active state of an object indicates the current status of the object as it undergoes a continuing transformation or processing.

What to Write About?

• Inception and elicitation—provide you with the information you'll need to begin writing use cases. • Requirements gathering meetings, QFD (Quality Function Deployment), and other requirements engineering mechanisms

Requirements Modeling Strategies

• One view of requirements modeling, called structured analysis, considers data and the processes that transform the data as separate entities. • 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 affect customer requirements.

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.

Manifestations of Analysis Classes

• 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

Requirements Modeling

• Scenario - system from the user's POV • Class - objects, attributes & relationships • Behavioral - impact of events on system states • Flow - how data transform inside system

The Configuration Model

• Server-side ◦ Server hardware and operating system environment must be specified ◦ Interoperability considerations on the server-side must be considered ◦ Appropriate interfaces, communication protocols and related collaborative information must be specified • Client-side ◦ Browser configuration issues must be identified ◦ Testing requirements should be defined

Navigation Modeling-II

• Should a full navigation map or menu (as opposed to a single "back" link or directed pointer) 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 of the 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 browser window? as a separate frame?

Navigation Modeling-I

• Should certain elements be easier to reach (require fewer navigation steps) 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?

Patterns for Requirements Modeling

• Software patterns are a mechanism for capturing domain knowledge in a way that allows it to be reapplied when a new problem is encountered ◦ domain knowledge can be applied to a new problem within the same application domain ◦ the domain knowledge captured by a pattern can be applied by analogy to a completely different application domain. • The original author of an analysis pattern does not "create" the pattern, but rather, discovers it as requirements engineering work is being conducted. • Once the pattern has been discovered, it is documented

Responsibilities

• 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.

Reqs Behavioral Modeling

• The behavioral model indicates how software will respond to external events or stimuli. To create the model, the analyst must perform the following steps: ◦ Evaluate all use-cases to fully understand the sequence of interaction within the system. ◦ Identify events that drive the interaction sequence and understand how these events relate to specific objects. ◦ Create a sequence for each use-case. ◦ Build a state diagram for the system. ◦ Review the behavioral model to verify accuracy and consistency.

The Functional Model

• The functional model addresses two processing elements of the WebApp ◦ user observable functionality that is delivered by the WebApp to end-users ◦ the operations contained within analysis classes that implement behaviors associated with the class. • An activity diagram can be used to represent processing flow

Reqs Modeling Rules of Thumb

• The model should focus on requirements that are visible within the problem or business domain. The level of abstraction should be relatively high. • Each element of the analysis model should add to an overall understanding of SW Reqs and provide insight into the information domain, function and behavior of the system. • Delay consideration of infrastructure and other non-functional models until design. • Minimize coupling throughout the system. • Be certain that the analysis model provides value to all stakeholders. • Keep the model as simple as it can be.

Discovering Analysis Patterns

• The most basic element in the description of a requirements model is the use case. • A coherent set of use cases may serve as the basis for discovering one or more analysis patterns. • A semantic analysis pattern (SAP) "is a pattern that describes a small set of coherent use cases that together describe a basic generic application." [Fer00]

An Example

• This use case implies a variety of functionality that would be refined and elaborated (into a coherent set of use cases) during requirements gathering and modeling. • Regardless of how much elaboration is accomplished, the use case(s) suggest(s) a simple, yet widely applicable SAP—the software-based monitoring and control of sensors and actuators in a physical system. • In this case, the "sensors" provide information about proximity and video information. The "actuator" is the breaking system of the vehicle (invoked if an object is very close to the vehicle. • But in a more general case, a widely applicable pattern is discovered --> Actuator-Sensor

Analysis Packages

• Various elements of the analysis model (e.g., use- cases, analysis classes) are categorized in a manner that packages them as a group • 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.

Developing a Use-Case

• What are the main tasks or functions that are performed by the actor? • What system information will the actor acquire, produce or change? • Will the actor have to inform the system about changes in the external environment? • What information does the actor desire from the system? • Does the actor wish to be informed about unexpected changes?

Use-Cases

• a scenario that describes a "thread of usage" for a system • actors represent roles people or devices play as the system functions • users can play a number of different roles for a given scenario

Behavioral Modeling

• make a list of the different states of a system (How does the system behave?) • indicate how the system makes a transition from one state to another (How does the system change state?) • indicate event • indicate action • draw a state diagram or a sequence

The States of a System

• state—a set of observable circumstances that characterizes the behavior of a system at a given time • state transition—the movement from one state to another • event—an occurrence that causes the system to exhibit some predictable form of behavior • action—process that occurs as a consequence of making a transition


Kaugnay na mga set ng pag-aaral

Finance 450: Exam 1- Chapter 2 Book Questions

View Set

Financial Management Final Multiple Choice

View Set

America, a narrative history,ch. 30

View Set