Koed KCT Seqa Unt II
Koed KCT Seqa Unt II
Koed KCT Seqa Unt II
3
Requirements
• A requirement is something that a computer application must do for its
users.
• Requirements constitute part of the scope of a software development project.
• The requirements also dictate how the system should respond to user
interaction.
Understanding Requirements
• Understanding requirements is the most difficult tasks faced by the software
engineer
• They have the trouble understanding the requirements acquired from the
customer
• They record requirements in a disorganized manner
• They spend far too little time verifying what they do record
• They allow change to control us, rather than establishing mechanisms to control
change
• Most importantly, they fail to establish a solid foundation for the system or
software that the user wants built
5
Understanding Requirements Contd..
• Many software developers argue that
• Building software is so compelling that we want to jump right in (before having a
clear understanding of what is needed)
• Things will become clear as we build the software
• Project stakeholders will be able to better understand what they need only after
examining early iterations of the software
• Things change so rapidly that requirements engineering is a waste of time
• The bottom line is producing a working program and that all else is secondary
• All these arguments contain some truth, especially for small projects that take less than
one month to complete
• However, as software grows in size and complexity, these arguments begin to break
down and can lead to a failed software project
6
A Solution: Requirements Engineering
• The broad spectrum of tasks and techniques that lead to an understanding of
requirements is called requirements engineering.
• Begins during the communication activity and continues into the modeling
activity
• Builds a bridge from the system requirements into software design and
construction
• Allows the requirements engineer to examine
• the context of the software work to be performed
• the specific needs that design and construction must address
• the priorities that guide the order in which work is to be completed
• the information, function, and behavior that will have a profound impact on
the resultant design
7
A Bridge
Requirements - Examples
Functional Requirements
Functional Requirements Contd..
Nonfunctional Requirements
14
Example: Campus Information
Access Kiosk
• Both podium-high and desk-high terminals located throughout the campus in
all classroom buildings, admin buildings, labs, and dormitories
• Hand/Palm-login and logout (seamlessly)
• Voice input
• Optional audio/visual or just visual output
• Immediate access to all campus information plus
• E-mail
• Cell phone voice messaging
15
Inception Task
• Most projects begin when a business need is identifies
• Stakeholders define a business case (outlines the why, what, how, and who necessary to decide if it is
worthwhile continuing a project)
E.g. https://expertprogrammanagement.com/2017/06/project-business-case/
• During inception, the requirements engineer asks a set of questions to establish…
A basic understanding of the problem
The people who want a solution
The nature of the solution that is desired
The effectiveness of preliminary communication and collaboration between the customer and the
developer
• Through these questions, the requirements engineer needs to…
Identify the stakeholders
Recognize multiple viewpoints
Work toward collaboration
Break the ice and initiate the communication
16
The First Set of Questions
These questions focus on the customer, other stakeholders, the overall goals, and the
benefits
17
The Next Set of Questions
These questions enable the requirements engineer to gain a better understanding of
the problem and allow the customer to voice his or her perceptions about a solution
18
The Final Set of Questions
These questions focus on the effectiveness of the
communication activity itself
• Are you the right person to answer these questions? Are your answers
"official"?
• Are my questions relevant to the problem that you have?
• Am I asking too many questions?
• Can anyone else provide additional information?
• Should I be asking you anything else?
19
Elicitation Task ( Requirements gathering)
• Asking the customer, the users and others what are the objectives of the system, what is to be
accomplished, how the system fits into the needs of the business & how the system will be used
on a day-today basis.
• Eliciting requirements is difficult because of
• Problems of scope in identifying the boundaries of the system or specifying too much
technical detail rather than overall system objectives
• Problems of understanding what is wanted, what the problem domain is, and what the
computing environment can handle (Information that is believed to be "obvious" is often
omitted)
• Problems of volatility because the requirements change over time
• Elicitation may be accomplished through two activities
• Collaborative requirements gathering
• Quality function deployment
20
Basic Guidelines of Collaborative Requirements
Gathering
• Meetings are conducted and attended by both software engineers, customers, and other
interested stakeholders
• Rules for preparation and participation are established
• An agenda is suggested that is formal enough to cover all important points but
informal enough to encourage the free flow of ideas
• A "facilitator" (customer, developer, or outsider) controls the meeting
• A "definition mechanism" is used such as work sheets, flip charts, wall stickers,
electronic bulletin board, chat room, or some other virtual forum
• The goal is to identify the problem, propose elements of the solution, negotiate
different approaches, and specify a preliminary set of solution requirements
21
Quality Function Deployment (QFD)
• This is a technique that translates the needs of the customer into technical requirements
for software
• It emphasizes an understanding of what is valuable to the customer and then deploys
these values throughout the engineering process through functions, information, and tasks
• It identifies three types of requirements
• Normal requirements: These requirements are the objectives and goals stated for a
product or system during meetings with the customer. If these are present, customer
is satisfied.
E.g. Entry of marks, calculation of results ( in a result management system)
• Expected requirements: These requirements are implicit to the product or system
and may be so fundamental that the customer does not explicitly state them. Absence
will cause customer dissatisfaction.
E.g. Protection from unauthorized access , Ease of software installation
• Exciting requirements: These requirements are for features that go beyond the
customer's expectations and prove to be very satisfying when present
E.g. when unauthorized access is detected, it should backup and shutdown all processes
22
Elicitation Work Products
The work products will vary depending on the system, but should
include one or more of the following items
23
UML Diagram for Eliciting Requirements
Elaboration Task
• During elaboration, the software engineer takes the information obtained during
inception and elicitation and begins to expand and refine it
• Elaboration focuses on developing a refined technical model of software functions,
features, and constraints
• It is an analysis modeling task
• Use cases are developed
• Domain classes are identified along with their attributes and relationships
• State machine diagrams are used to capture the life on an object
• The end result is an analysis model that defines the functional, informational, and
behavioral domains of the problem
25
Developing Use Cases
• Step One – Define the set of actors that will be involved in the story
• Actors are people, devices, or other systems that use the system or
product within the context of the function and behavior that is to be
described
• Actors are anything that communicate with the system or product and
that are external to the system itself
• Step Two – Develop use cases, where each one answers a set of questions
27
Elements of the Analysis Model
• Scenario-based elements
• Describe the system from the user's point of view using scenarios that are depicted in use
cases and activity diagrams
• Class-based elements
• Identify the domain classes for the objects manipulated by the actors, the attributes of
these classes, and how they interact with one another; they utilize class diagrams and
collaboration diagram to do this
• Behavioral elements
• Use state diagrams to represent the state of the system, the events that cause the system
to change state, and the actions that are taken as a result of a particular event; can also be
applied to each class in the system
• Flow-oriented elements
• Use data flow diagrams to show the input data that comes into a system, what functions
are applied to that data to do transformations, and what resulting output data are
produced
28
Negotiation Task
• During negotiation, the software engineer reconciles the conflicts between what
the customer wants and what can be achieved given limited business resources
• Requirements are ranked (i.e., prioritized) by the customers, users, and other
stakeholders
• Risks associated with each requirement are identified and analyzed
• Rough guesses of development effort are made and used to assess the impact of
each requirement on project cost and delivery time
• Using an iterative approach, requirements are eliminated, combined and/or
modified so that each party achieves some measure of satisfaction
29
The Art of Negotiation
• Recognize that it is not competition
• Map out a strategy
• Listen actively
• Focus on the other party’s interests
• Don’t let it get personal
• Be creative
• Be ready to commit
30
Specification Task
• A specification is the final work product produced by the requirements engineer
• It is normally in the form of a software requirements specification (SRS)
• It serves as the foundation for subsequent software engineering activities
• It describes the function and performance of a computer-based system and the
constraints that will govern its development
• It formalizes the informational, functional, and behavioral requirements of the
proposed software in both a graphical and textual format
31
Typical Contents of a Software Requirements
Specification
• Requirements
• Required states and modes
• Software requirements grouped by capabilities (i.e., functions, objects)
• Software external interface requirements
• Software internal interface requirements
• Software internal data requirements
• Other software requirements (safety, security, privacy, environment, hardware,
software, communications, quality, personnel, training, logistics, etc.)
• Design and implementation constraints
• Qualification provisions to ensure each requirement has been met
• Demonstration, test, analysis, inspection, etc.
• Requirements traceability
• Trace back to the system or subsystem where each requirement applies
32
Validation Task
• During validation, the work products produced as a result of requirements
engineering are assessed for quality
• The specification is examined to ensure that
• all software requirements have been stated unambiguously
• inconsistencies, omissions, and errors have been detected and corrected
• the work products conform to the standards established for the process, the
project, and the product
• The formal technical review serves as the primary requirements validation
mechanism
• Members include software engineers, customers, users, and other
stakeholders
33
Questions to ask when Validating Requirements
• Is each requirement consistent with the overall objective for the system/product?
• Have all requirements been specified at the proper level of abstraction? That is,
do some requirements provide a level of technical detail that is inappropriate at
this stage?
• Is the requirement really necessary or does it represent an add-on feature that
may not be essential to the objective of the system?
• Is each requirement bounded and unambiguous?
• Does each requirement have attribution? That is, is a source (generally, a specific
individual) noted for each requirement?
34
Questions to ask when Validating Requirements
Contd….
• Do any requirements conflict with other requirements?
• Is each requirement achievable in the technical environment that will house
the system or product?
• Is each requirement testable, once implemented?
• Approaches: Demonstration, actual test, analysis, or inspection
• Does the requirements model properly reflect the information, function, and
behavior of the system to be built?
• Has the requirements model been “partitioned” in a way that exposes
progressively more detailed information about the system?
35
Requirements Management Task
• During requirements management, the project team performs a set of activities
to identify, control, and track requirements and changes to the requirements at
any time as the project proceeds
• Each requirement is assigned a unique identifier
• The requirements are then placed into one or more traceability tables
• These tables may be stored in a database that relate features, sources,
dependencies, subsystems, and interfaces to the requirements
• A requirements traceability table is also placed at the end of the software
requirements specification
36
Requirements Modeling
Requirements Modeling
• Uses a combination of text and diagrammatic representation to depict the
requirements in an easy way
Importance of Requirements Modeling
• To validate software requirements, it has to be examined them from a number of
different points of view.
• Requirements modeling is considered from three different perspectives:
scenario- based models, data(information) models, and class-based
models
• Each represents requirements in a different “dimension,” thereby increasing the
probability that errors will be found, that inconsistency will surface, and that
omissions will be uncovered.
Requirements Analysis
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 in which classes collaborate to achieve system
Requirements.
•Flow-oriented models that represent the functional elements of the system and
how they transform data as it moves through the system.
•Behavioral models that depict how the software behaves as a consequence of
external “events.
Overall Objectives and Philosophy
In requirements modeling, the 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
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
Analysis Rules of Thumb
Rules to be followed when creating the analysis model:
•The model should focus on requirements that are visible within the problem or
business domain. The level of abstraction should be relatively high.
•Be certain that the requirements model provides value to all stakeholders
• If you understand how end users (and other actors) want to interact with a
system, your software team will be better able to properly characterize
requirements and build meaningful analysis and design models.
• A simple but very effective model for analysing requirements through the process of exploring user interactions with the
system
• Specify the behaviour of the system or a part of the system
• Is a description of a set of sequences of actions
• Scenarios for understanding system requirements
• Capture the intended behaviour of the system without specifying how the behavior is implemented
• Helps to come to a common understanding with the system's end users and domain expert
• Represents a functional requirement of the system as a whole
• Involves the interaction of users (actors) and the system
• An Actor is outside or external the system.
• It can be a:
• Human
• Peripheral device (hardware)
• External system or subsystem
• Time or time-based event
• An actor is who or what initiates the events involved in the task of the use case
• Represented by stick figure
Use Cases Contd..
The USE CASE should contain
• How & WHEN the use case begins & ends
• The interaction between the use case and the actors ( When the interaction occurs & what is
exchanged)
• How and when the use case will need data stored in the system or will store the data in the
system
• Exception to the flow of events
Eg. SCENARIO
A patient calls the clinic to make an appointment for a yearly checkup. The receptionist finds the
nearest empty time slot in the appointment book and schedules the appointment for that time slot.
The actor is a Patient
Use Cases Contd..
The use case is a summary
The Use Case is Make Appointment of scenarios for a single task or goal.
Labelled using a descriptive verb-noun phrase
Represented by an oval shape
Use Case Example
ATM System
Main Flow of Events
• The use case starts when the system prompts the customer for a PIN No.
• Customer can enter the PIN no. via Keyboard
• Customer presses the enter key to commit the entry
• The system then checks to see if this PIN no. is valid
• If PIN No. is valid , the system acknowledges the entry , thus ending the use case
• Request Cash
• Request Balance
• Request Statement
• Request Cheque book
Request Balance Request Statement
Customer
Request Statement
Printer
Request Cash
Customer
Request Cheque Book
Request Balance
Use Case Diagram for ATM Withdrawal
Example : Library user Interaction - Use Cases
• As a user, you expect a library to offer you the following services and the
librarian, being a domain expert will know how to perform these tasks.
i) Generalization
• Generalization among classes
• The child use case inherits the behaviour and meaning of the parent use case
• Represented by a line and a hollow arrow from child to parent
Use Cases – Types of relationships
ii) Include
• Example of Delegation
• This relationship between use cases means that the base use case explicitly incorporates
the behavior of another use case
• The included use case never stands alone, but is only instantiated as a part of larger base
that includes it
iii) Extends
• The base use case implicitly incorporates the behavior of another use case
• The base use case may stand alone but under certain conditions its behavior may be
extended by the behaviour of another use case
• May be extended at certain points called extension point.
• Used to model the part of the use case that the user may see as optional system
behaviour
• Put the normal behavior in one use-case and the exceptional behavior
Place Place rush
<< extend >> order
Order
(set priority)
Check password
Place order <<uses>>
Extension points
set priority Vaildate user
Retinal scan
Creating a Preliminary Use Case
Creating a Preliminary Use Case Contd…
Creating a Preliminary Use Case
Homeowner actor:
•Select camera to view.
•Request thumbnails from all cameras.
•Display camera views in a PC window.
•Control pan and zoom for a specific camera.
•Selectively record camera output.
•Replay camera output.
•Access camera surveillance via the Internet.
conversations with the stakeholder (who plays the role of a homeowner)
Use case: Access camera surveillance via the Internet—display camera views
(ACS- DCV)
Actor: homeowner:
If I’m at a remote location, I can use any PC with appropriate browser software to log
on to the Safe Home Products website. I enter my user ID and two levels of passwords
and once I’m validated, I have access to all functionality for my installed Safe Home
system. To access a specific camera view, I select “surveillance” from the major
function buttons displayed. I then select “pick a camera” and the floor plan of the
house is displayed. I then select the camera that I’m interested in. Alternatively, I can
look at thumbnail snapshots from all cameras simultaneously by selecting “all
cameras” as my viewing choice. Once I choose a camera, I select “view” and a one-
frame-per-second view appears in a viewing window that is identified by the camera
ID. If I want to switch cameras, I select “pick a camera” and the original viewing
window disappears and the floor plan of the house is displayed again.
I then select the camera that I’m interested in. A new viewing window appears.
Use case: Access camera surveillance via the Internet—display camera views
(ACS-DCV)
Actor: homeowner
1.The homeowner logs onto the Safe Home Products website.
2.The homeowner enters his or her user ID.
3.The homeowner enters two passwords (each at least eight characters in length).
4.The system displays all major function buttons.
5.The homeowner selects the “surveillance” from the major function buttons.
6.The homeowner selects “pick a camera.”
7.The system displays the floor plan of the house.
8.The homeowner selects a camera icon from the floor plan.
9.The homeowner selects the “view” button.
10.The system displays a viewing window that is identified by the camera ID.
11.The system displays video output within the viewing window at one frame per
second.
Refining a Preliminary Use Case
• A description of alternative interactions is essential for a complete understanding
of the function that is being described by a use case.
• Therefore, 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?
Refining a Preliminary Use Case
E.g.
Consider steps 6 and 7 in the primary scenario presented earlier:
Can the actor take some other action at this point? The answer is “yes.” Referring to the
free-flowing narrative, the actor may choose to view thumbnail snapshots of all cameras
simultaneously.
Hence, one secondary scenario might be “View thumbnail snapshots for all cameras.”
Writing a Formal Use Case
• The informal use cases presented in the previous Section are sometimes
sufficient for requirements modeling.
Alternative courses
Steps 8 and 9. The customer details are already in the system so the Receptionist needs only
to key in an identifier and the system will display the customer details. Steps 7 – 12. The
customer may not be happy with the price and may terminate the
transaction.
Activity Diagrams
• Activity diagram supplements the use case diagram
• Activity Diagrams are also useful for:
• analyzing a use case by describing what actions need to take place and
when they should occur;
• a complicated sequential algorithm; and
• modeling applications with parallel processes
• Provides the flow of interaction within a specific scenario
Activity Diagram Symbols
• Symbols used:
• Rounded rectangle for functions
• Arrow to represent the flow through the system
• Decision diamonds to depict a branching decision
• Solid horizontal lines to indicate parallel activities that are occuring
OOAD 73
Data Modeling Concepts
• If software requirements include the need to create, extend, or
interface with a database or if complex data structures must be constructed
and manipulated, the software team may choose to create a data model as
part of overall requirements modeling.
• Data models are defined by the software engineer/analyst.
• Entity Relationship (ER) diagrams are used to show the relationship between
these data objects.
Data Objects
• A data object is a representation of composite information that must be
understood by software.
• Composite information - something that has a number of different properties
or attributes.
E.g. dimensions(incorporating height, width, and depth) could be defined as an object.
• A data object can be an external entity, a thing(a report/a display), an
occurrence( telephone call) or event( alarm) , a role(a salesperson), an
organizational unit( accounting department) , a place( warehouse) or a
structure ( a file).
E.g. A person, a car
• A data object encapsulates data only and can be represented as a table.
Data Attributes
• Data attributes define the properties of a data object
• It takes on one of three different characteristics. They can be used to
1) name an instance of the data object
2) describe the instance
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.
• A person owns a car.
• A person is insured to drive a car.
Entity-Relationship Diagrams
• The object-relationship pair is the cornerstone ( most important ) of the
data model.
• These pairs can be represented graphically using the entity- relationship
diagram (ERD).
• A set of primary components is identified for the ERD:
data objects
attributes
relationships
various type indicators
• The primary purpose of the ERD is to represent data objects and their
relationships.
ER Diagram :Example
Class-Based Modeling
• Class-based modeling represents the objects that the system will manipulate,
the operations (also called methods or services) that will be applied to the
objects to effect the manipulation relationships.
• The collaborations that occur between the classes are defined.
• Elements include:
• Classes & Objects
• Attributes
• Operations
• CRC Models( Class-Responsibility-Collaborator)
• Collaboration diagrams
• Packages
Identifying Analysis Classes
•If you look around a room, there is a set of physical objects that can be easily
identified, classified, and defined (in terms of attributes and operations).
•Classes can be identified by
• examining the usage scenarios developed as a part of requirements model
• Performing a grammatical parse on the use cases.
•Underline each noun or noun phrase and enter it into a simple table
Identifying Analysis Classes Contd..
• Retained information- 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- A class with a single attribute may be represented as an attribute of
another class rather than a class
• Common attributes- The attributes of the potential class should apply to all instances of
the class.
• Common operations – The operations of the potential class should apply to all instances
of the class.
• Essential requirements -
Specifying Attributes
• Attributes are the set of data objects that fully define the class
within the context of the problem
• Attributes describe a class that has been selected for inclusion in
the requirements model.
• To develop a meaningful set of attributes, each use case should
be studied and only those things that reasonably belong to the
class must be selected.
Defining Operations
• Operations define the behavior of an object.
• Operations can be divided into 4 categories:
• Operations that manipulate data in some way ( adding, deleting, reformatting, selecting)
• Operations that perform a computation
• Operations that inquire about the state of an object
• Operations that monitor an object for the occurrence of a controlling event
• When you define operations for an analysis class, focus on problem-oriented
behavior rather than behaviors required for implementation
• In addition to grammatical parsing, consider the communication that occurs
between objects.
• Objects communicate by passing messages to one another
Defining Operations
Class-Responsibility-Collaborator
(CRC) Modeling
Class-responsibility-collaborator (CRC) modeling provides a simple means for
identifying and organizing the classes that are relevant to system or product
requirements.
• It is collection of standard index cards that that represent classes.
• The cards are divided into 3 sections. Along the top of the card the name of
the class, the class responsibilities on the left of the card and the collaborators
on the right of the card (in the body of the card).
CRC Index Card
Clas
s:Clas
Class:
Descript ion
s:
Class:
: Descript ion FloorPlan
: Descript ion
Responsibility:
: Description:
Responsibility:
Responsibility:
Collaborator:
Responsibili
Collaborator: Collaborator:
Collaborator:
ty: floor plan name/type
defines
manages floor plan positioning
scales floor plan for display
scales floor plan for
displayporat es walls, doors and
incor Wall
windows shows position of video Camer
cameras a
91
CRC card Example
Taxonomy of class types
Entity Class (model or business class) are extracted directly from the
statement of the problem. These classes typically represent things that are to
be stored in the database and persist throughout the duration of the
application.
96
Associations & Dependencies
Wall
1 1 1
1.. 0..
0..* is used to build
* *
WallSegm Window Door
ent
98
Dependencies
DisplayWindow Camer
a
<<access>>
{password}
99
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.
10
0
Analysis Packages
package name
10
1