SlideShare uma empresa Scribd logo
1 de 20
Software Requirement Analysis using UML




Software Requirement Analysis
         Using UML




                       -1-
Software Requirement Analysis using UML


Introduction
The document hopes to break a common myth that software analysis is a non-logical
process. We attempt to present the entire process as a series of logical steps which could
be followed to ensure customer satisfaction.

This document is based on the knowledge base that has been collected from various
sources. Most of the steps followed here are based on the RUP model.




                                          -2-
Software Requirement Analysis using UML


What are Requirement Artifacts?

Requirements artifacts are the diagrams/flowcharts/algorithms/documents that a software
designer creates as a result of the process of developing and managing software
requirements. Each artifact serves a particular purpose for understanding and
communicating either the user requirements or the software requirements. Each artifact
provides a view of the full set of requirements.

The set of UML artifacts (not necessarily every type of UML diagram BUT only a subset
of UML diagram-types that the designer deems necessary) ensures that these views do
not conflict with one another. The following figure illustrates the overall architecture of
the requirements artifacts:




                           Figure 1: Software Analysis Model

Each artifact in the above Software Analysis Model serves a particular purpose in final
goal of capturing the system requirements:

Use Case Model: The use case model consists of Actors, Use Case diagrams as well as
Use Case specifications. Actors are entities external to the system which are unaffected
by the current design process (but interact with the system in clearly documented ways).
The use-cases capture the high-level functionality of the system. The use case
specifications are the detailed description of how the actors interact with the system to
achieve a specific goal.



                                           -3-
Software Requirement Analysis using UML



Class Diagrams: The Class Diagrams (analysis classes) show the entities that need to
work together to ensure that our system realizes each use case specification. The Class
Diagrams contains the functional requirements of the software. Objects of each class
fulfill their responsibilities in collaboration with objects of the other classes in the model.

Sequence Diagrams: The Sequence Diagrams show how objects of classes in the Class
Diagram collaborate to realize a use case. Each use case specification is related to one or
more sequence diagrams

Activity Diagrams: Activity diagrams are similar to flow charts. We use activity
diagrams for (visually) capturing the dynamic behavior of a given part of our system.

State Diagrams: State transition diagrams can be used to describe the behavior of a
class, a use case, or a system. The key components of a state transition diagram are the
states, triggering events that cause a transition from one state to another or possibly back
to the same state, guards on those transitions, and actions the entity can perform during
the transitions.

Software Requirements Specification (SRS): The SRS is the final (all-inclusive)
artifact of the requirements development process. The SRS contains BOTH the
specification of the functional requirements for each class in the class diagram AND the
nonfunctional requirements. The SRS may also contain a specification of the interfaces to
the system.

We learn the entire process of software (requirement) analysis using an example. We
build up the various artifacts starting from a simple problem statement given below:

Problem Statement:
Implement a Hotel Management System wherein the customer can book one of the
following kinds of rooms:
Single
Double
Suite

The system takes care of the billing which includes the Room service/Std calls etc




                                             -4-
Software Requirement Analysis using UML


Use Case Model
The use case model captures the interaction of the system with other external entities. We
start by enlisting a rough draft of the scenarios in which the system will be exercised and
then go on to refine the same (for capturing more specific details).

The high-level overview of the system (given earlier) reveals the following use-case
scenarios:
1. Hotel Room reservation
2. Room Service (Food)
3. Telephone/Internet Service
4. Billing

We now try to refine the above use-case scenarios for capturing more details. We try to
make good use of the available use-case relationships i.e. extends, includes and
generalization (of both actors and use cases). Capturing such fine details helps in both
getting a broader view of the system as well as encouraging reuse.

Identifying the Actors & Elaborating the Use-case scenarios

From the above identified use case scenarios we can deduce the following four broad
categories of actors
    1. Customer
    2. (Hotel) Employee
    3. (Hotel) Manager (responsible for booking/tariff selection etc)
    4. Hotel Register (Customer details/Billing details/Room availability details)

Each of the above identified use case scenarios are then elaborated after taking
continuous feedback from the customer.




                                           -5-
Software Requirement Analysis using UML




Figure 2: Actors of the Hotel Management System




                     -6-
Software Requirement Analysis using UML




  Figure 3: Room Reservation Use Cases




                  -7-
Software Requirement Analysis using UML




    Figure 4: Room Service Use Cases




                  -8-
Software Requirement Analysis using UML




  Figure 5: Telephone Service Use Cases




                  -9-
Software Requirement Analysis using UML




       Figure 6: Billing Use Cases




                 - 10 -
Software Requirement Analysis using UML




(Incrementally) Iterative development model
This model is close to the iterative development model (as suggested by RUP). We first
sort the requirements (read as Use Cases) according to their:
    1. Urgency (as decided by customer)
    2. Complexity
    3. Risk (as perceived by architect/developer)

We then prioritize the use cases by taking a weighted average of the above 3 priority
values (weights could be decided after discussion with customer/client).

For the Hotel Management system being considered here, we assume that the top 3 use
cases (highest priority) are:
    1. Make Reservation
    2. Make Corporate Reservation
    3. Make Group Reservation

We now do a complete iteration of software analysis for each of these 3 requirements.
The other use cases are explored incrementally (in subsequent iterations).


Use Case Name:                        Make Reservation
Author (Date) of first Revision:      Dhiraj Shetty (Feb 25th, 2009)
Precondition:                         Hotel Register is updated with latest info
Post-condition:                       Hotel Register updated to include current booking
Failed Post-condition:                Hotel Register remains unaffected

Main Flow:

1. Customer gives itinerary (days of stay at hotel)
2. System searches for room details
3. System presents room types and tariffs
4. Customer selects room and confirms tariff
5. System records customer‟s name and address
6. Manager confirms booking on system
7. System generates confirmation receipt.

Alternate Flow: Tariff Negotiation
3.1. Customer asks for discount
3.2. Manager does DSS analysis (external to system) to decide feasibility of discount

                     Use Case Specification for “Make Reservation”




                                           - 11 -
Software Requirement Analysis using UML


Use Case Name:                       Make Corporate Reservation
Author (Date) of first Revision:     Dhiraj Shetty (Feb 25th, 2009)
Precondition:                        Hotel Register is updated with latest info
Post-condition:                      Hotel Register updated to include current booking
Failed Post-condition:               Hotel Register remains unaffected

Main Flow:

1. Customer gives itinerary (days of stay at hotel)
2. System searches for room details
3. System presents room types and special corporate tariffs
4. Customer selects room and confirms tariff
5. System records the name and address of both the customer as well as guest (customer‟s
client/employee)
6. Manager confirms booking on system
7. System generates confirmation receipt.

Alternate Flow: Tariff Negotiation
3.1. Customer asks for discount
3.2. Manager does DSS analysis (external to system) to decide feasibility of discount

                   Use Case Specification for “Corporate Reservation”


Use Case Name:                       Make Group Reservation
Author (Date) of first Revision:     Dhiraj Shetty (Feb 25th, 2009)
Precondition:                        Hotel Register is updated with latest info
Post-condition:                      Hotel Register updated to include current booking
Failed Post-condition:               Hotel Register remains unaffected

Main Flow:

1. Customer gives itinerary (days of stay at hotel)
2. System searches for room details
3. System presents room types and special group tariffs
4. Customer selects rooms and confirms tariff(s)
5. System records name and address for each customer in group
6. Manager confirms booking on system
7. System generates confirmation receipt.

Alternate Flow: Tariff Negotiation
3.1. Customer asks for discount
3.2. Manager does DSS analysis (external to system) to decide feasibility of discount

                    Use Case Specification for “Group Reservation”



                                          - 12 -
Software Requirement Analysis using UML



Identification of Analysis Classes:
Analysis classes are categorized into the following 3 kinds:
   1. Boundary Classes (the Interface)
            Behavior that involves communication with an actor
   2. Control Classes (the Use Case flow of events)
            Behavior specific to a use case or part of a very important flow of events
   3. Entity Classes(Persistent Data)
            Behavior that involves the data encapsulated within the abstraction


Boundary classes model the interaction between the system and its surroundings. As a
thumb rule we need one boundary class per „Actor‟-„Use Case‟ pair. They should be
modeled according to the type of boundary they represent. For e.g.:
    Modeling a boundary with a human actor should stress more on how the interface
      will be presented to the user.
    Modeling a boundary with an external system should stress more on the
      communication protocol.

Control classes coordinate the activities of other objects that implement the functionality
of a use case. However they may share a many-to-many relationship with use cases. The
design of control cases should be independent of change in surroundings. They should
also be independent of the internal structure of their corresponding entity classes. It‟s
always better to divide a given control class if:
    1. Two different actors interact with the same control class in different ways
    2. The control task performs more than one kind of task and each are equally
        susceptible to change during the life time of the system.

Entity classes are used to hold and update information about an event, a person or some
real-life object. They are independent of the environment (the actors). Thus changing the
GUI or communication protocol (for communicating with external entities) should entail
changing only the boundary classes, not the entity and control classes.

Entity classes can be identified using the use case specifications. The first step in this
exercise is to identify all the nouns in the use case specification. These are the best hints
to the classes in the system. The verbs indicate the methods. The nouns which indicate
entities external to the system (for e.g. Actors) are to be skipped. Entity classes may also
come from the domain model (business entities).




                                           - 13 -
Software Requirement Analysis using UML



Boundary Classes identified are:
   1. Manager-Reservation-behaviour
   2. Customer-Reservation-behaviour
   3. HotelRegister-Reservation-behaviour

Control Classes identified are:
   1. MakeReservation-Controller
   2. GroupReservation-Controller
   3. CorporateReservation-Controller

Entity Classes identified are:
   1. Customer-info
   2. Room-info
   3. Reservation-info
   4. Group-reservation-info
   5. Corporate-reservation-info



Distribute Responsibilities between the Analysis Classes
Responsibilities of an object for a given Analysis class are characterized as:
   1. The actions the object can perform
   2. The knowledge that the object maintains and provides to other objects

Analysis classes with only one responsibility are probably too simple, while those with a
dozen or more can potentially be split into several classes.

Responsibilities are determined by drawing Sequence Diagrams OR Collaboration
Diagrams for representing the use case flows. Collaboration diagrams do have a distinct
advantage over sequence diagrams in that they allow you to show more complex
branching as well as multiple concurrent flows of control. Sequence diagrams help in „top
to bottom‟ chronological ordering of messages but only allow us to show simple
branching.

We now draw interaction diagrams for every possible use case flow i.e. main flow and/or
alternate flow and/or exception flow. The messages that are passed to the objects (of
Analysis classes) automatically give us their responsibilities. Besides, some other
responsibilities may also be derived from the non-functional requirements.

While allocating responsibilities to entity classes it may be helpful to have a broader
overview of the entire system (rather than just the current subset of use cases). For e.g.
While designing the book reservation system for British Library (which has multiple
branches across India) it may be sensible for the BOOK entity to include methods
MOVE_LOCATION and GET_CURRENT_LOCATION.


                                          - 14 -
Software Requirement Analysis using UML



The remaining part of this document will focus on the analysis of only the above use case
flow. In practice however we analyze all the flows (that have been selected for the current
iteration) in parallel. This ensures that we come up with a more comprehensive analysis
for the classes involved.

The responsibilities of each analysis class are now identified using the incoming arrow to
its corresponding lifeline (in the sequence diagram analysis). For example, we can list the
responsibility of customer-reservation-behavior class as:
     1. Provide an UI to capture customer‟s itinerary dates.
     2. Provide an UI to query room availability.
     3. Provide an UI to display available rooms (arranged by category/rates).
     4. Provide an UI to take room reservation confirmation.
     5. Provide an UI to display reservation-confirmation details.
     6. Provide an UI for capturing customer‟s personal data.

Further the non-functional requirements may also affect the analysis either by:
   1. Introducing new responsibilities OR
   2. Affecting the descriptions of pre-identified responsibilities




                                          - 15 -
Software Requirement Analysis using UML


Define Attributes
Attributes are the information-holders of an analysis class. The name of the attribute
should clearly specify the information that the attribute holds. Optionally we could use a
short description for giving more details.

Attributes are usually:
    1. Simple data types like string/integer etc
    2. Uniquely owned by the object (to which it belongs) i.e. no sharing across objects
    3. Have no real behavior other than providing its value.

It is always better to model a potential attribute as a separate analysis class in the
following conditions:
    1. The information has a complex behavior.
    2. The information is shared across objects OR
    3. The information is passed “by reference” between two or more objects.

For example, the attributes of the customer-info class could be defined as:
    Integer Customer_ID
    String Name
    String Address
    String Contact_Number

Incase the data types identified are advanced features/types provided by certain languages
(like STL in C++) we should clearly document the expected behavior of the type. This
helps to keep the requirements independent of the implementation mechanism. It also
ensures that we do not force any choices on the designer/developer.


Establish Relationship between Analysis Classes (Class Diagrams)
The analysis classes in this model don‟t represent actual classes to be implemented in the
code; instead they represent conceptual entities that interact to represent the behavior of
the proposed software without thinking much about implementation issues like
persistence, performance or security. Besides, we do not apply any kind of design
patterns here. Design patterns like Strategy, Abstract Factory etc come into play during
the next stage of converting the analysis to a formal design.

We start with a quick overview of the kinds of class relationships:

1. Association: A relationship between classes that allows instances of those classes to
send messages to each other. For example: An "Employee” works in a “Company".

1a. Multiplicity: An example of this kind of association is many employees working at
the same company. In this case, the relation shows a star sign near the employee class.
We can use UML to model „one to many‟, „many to many‟ and so forth kind of relations.


                                          - 16 -
Software Requirement Analysis using UML



1b. Directed Association: Association between classes is considered to be bi-directional
by default. However we can fix the navigability of the association by using a directed
association. The arrowhead identifies the container-contained relationship.

1c. Reflexive Association: It does not need any special visual symbol. However, the
relation will point back at the same class. An example of this kind of relation is when a
class has a variety of responsibilities. For example, an employee of a company can be a
manager for another employee.

2. Aggregation: When a class is formed as a collection of other classes, it is called an
aggregation relationship between these classes. It is also called a "has a" relationship.

2a. Composition: Composition is a special kind of aggregation relationship in which the
life-cycle of the contained object strictly ends at (or before) the destruction of the
container object.

3. Inheritance/Generalization: Generalization is an "is a" relationship in which the child
class is a type of the parent class. Generalization is the basic mechanism for encouraging
reuse. The child classes "inherit" the functionality defined in the parent class.

4. Realization: In a realization relationship, one entity (normally referred to as an
interface) defines a set of functionalities as a contract and the other entity (normally
referred to as a concrete class) "realizes" the contract by implementing the functionality
defined in the contract.

Class diagrams help in identifying relationships in the space domain. For example in the
system currently under analysis, it may be helpful to capture that Group-reservation-info
and Corporate-reservation-info classes are inherited from Reservation-info class.




                                          - 17 -
Software Requirement Analysis using UML



Need for Activity Diagrams
Activity diagrams are used to model the dynamic behavior of any element of an object
oriented system. Two common uses include:
    1. Modeling the flow of a use case
    2. Modeling the behavior of an operation on a class(object)

Modeling the use case flow is beneficial in cases in which the flow appears to be complex
in terms of multiple alternate flows. It helps to get a broader picture of how the various
(alternate) flows branch and merge at different points. Besides symbols like fork/join
could be intelligently used to capture information that may not be clear in the use case
specification. Activity diagrams can be a very helpful input in drawing the interaction
diagrams.



Need for Interface Requirement Specification
While designing systems that need to interface with (existing/pre-designed) external
systems, we need to ensure that the external interfaces of our modules are compatible
with the interfaces presented by the external system. The IRS is used to capture such
requirements. Such interface requirements can also be represented on the class diagram
(covered earlier) using the “Realization” relationship.

For example, let us consider the scenario in which the Billing system needs to interface
with an existing print server. In this case we document the interface provided by the print
server as follows:

interface PrintServer {
// defines an abstract printer server
// requires: interface Printer, interface PrintDoc
// provides: initialize, print, displayPrintQueue, cancelPrintJob
void initialize (Printer p);
void print (Printer p, PrintDoc d);
void displayPrintQueue (Printer p);
void cancelPrintJob (Printer p, PrintDoc d);
} //PrintServer

                          Interface specification for Print Server

We can then proceed to elaborate the interfaces for Printer and PrintDoc (if required).
This ensures that the billing system developers know not only the procedural interface
but also the data format to be followed for interfacing with the (existing) print server(s).




                                           - 18 -
Software Requirement Analysis using UML



Need for State Diagrams
State diagrams help us to capture certain requirements that may be very crucial to the
correct/efficient working of the system. Even if they may not come directly into the final
SRS, they do affect the functional/non-functional requirements. A common example can
be that of a “Software Defect Tracking” system in which we need to capture not only the
valid states (like unassigned/assigned/resolved/deferred/retired) but also the valid state
transitions.


Specifying Functional Requirements using the Class Diagram
Functional requirements are usually written in the language conducive to programmers.
This means we are free to use standard programming constructs like sequence, iteration,
conditional logic etc which may not necessarily be clear to the customer. We should
include a short description of the need/responsibility of each class, each class-attribute as
well as each class-method.


Specifying Non Functional Requirements
Functional requirements specify the actions that the software must perform. Non-
functional requirements place restrictions on the product being developed and/or the
development process. They may also specify external constraints that the product must
meet.




                 Figure 8: Classification of Non Functional Requirements


                                           - 19 -
Software Requirement Analysis using UML



It is usually difficult to identify non-functional requirements, unless clearly specified in
the problem statement. In such cases, it is better to probe the customer using open-ended
questions in each of the categories given in the above diagram.


Software Requirement Specification
The SRS document is the official statement of what is required of the system
developers. It is NOT a design document. To the extent possible, it should only specify
WHAT the system needs to do, rather than HOW it should do it.

Each software product company/vendor usually has its own format for documenting the
requirements. Ideally the SRS should include the following topics:
    Introduction.
    General system description.
    Specific requirements.
    Appendices.
    Index.




                                           - 20 -

Mais conteúdo relacionado

Mais procurados

Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram Rahul Pola
 
Domain model Refinement
Domain model RefinementDomain model Refinement
Domain model RefinementAnjan Kumar
 
UML Diagrams for Real estate management system
UML Diagrams for Real estate management systemUML Diagrams for Real estate management system
UML Diagrams for Real estate management systemStarlee Lathong
 
Online Hostel Management System Proposal
Online Hostel Management System Proposal Online Hostel Management System Proposal
Online Hostel Management System Proposal farhanamusthafa
 
Prototype model
Prototype modelPrototype model
Prototype modelsadhana8
 
Software Engineering concept
Software Engineering concept Software Engineering concept
Software Engineering concept Atamjitsingh92
 
Employee management system1
Employee management system1Employee management system1
Employee management system1supriya
 
Software Project Management - Staffing
Software Project Management - StaffingSoftware Project Management - Staffing
Software Project Management - StaffingTanishqRongta1
 
software design principles
software design principlessoftware design principles
software design principlesCristal Ngo
 
Project Proposal of an Employee Management System
Project Proposal of an Employee Management SystemProject Proposal of an Employee Management System
Project Proposal of an Employee Management SystemNurFathihaTahiatSeeu
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specificationAman Adhikari
 
Non Functional Requirement.
Non Functional Requirement.Non Functional Requirement.
Non Functional Requirement.Khushboo Shaukat
 
Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9koolkampus
 
Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramNikhil Pandit
 
College Management System
College Management SystemCollege Management System
College Management SystemAsfaque Khalid
 

Mais procurados (20)

software characteristics
software characteristicssoftware characteristics
software characteristics
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram
 
Domain model Refinement
Domain model RefinementDomain model Refinement
Domain model Refinement
 
UML Diagrams for Real estate management system
UML Diagrams for Real estate management systemUML Diagrams for Real estate management system
UML Diagrams for Real estate management system
 
Online Hostel Management System Proposal
Online Hostel Management System Proposal Online Hostel Management System Proposal
Online Hostel Management System Proposal
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenance
 
Case Study Uml
Case Study UmlCase Study Uml
Case Study Uml
 
Prototype model
Prototype modelPrototype model
Prototype model
 
College admission system
College admission system College admission system
College admission system
 
Software Engineering concept
Software Engineering concept Software Engineering concept
Software Engineering concept
 
Employee management system1
Employee management system1Employee management system1
Employee management system1
 
Software Project Management - Staffing
Software Project Management - StaffingSoftware Project Management - Staffing
Software Project Management - Staffing
 
software design principles
software design principlessoftware design principles
software design principles
 
Project Proposal of an Employee Management System
Project Proposal of an Employee Management SystemProject Proposal of an Employee Management System
Project Proposal of an Employee Management System
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
Non Functional Requirement.
Non Functional Requirement.Non Functional Requirement.
Non Functional Requirement.
 
Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9Formal Specification in Software Engineering SE9
Formal Specification in Software Engineering SE9
 
Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence Diagram
 
College Management System
College Management SystemCollege Management System
College Management System
 

Destaque

Budget reductions and accountability final
Budget reductions and accountability finalBudget reductions and accountability final
Budget reductions and accountability finalTim Washington
 
Getting Things Done - internal implementation plan
Getting Things Done - internal implementation planGetting Things Done - internal implementation plan
Getting Things Done - internal implementation planHerbJones
 
Task based-learning
Task based-learningTask based-learning
Task based-learninggingerfresa
 
Delegation and decentralisation
Delegation and decentralisationDelegation and decentralisation
Delegation and decentralisationPranav Kumar Ojha
 
Organizational Skills Presentation
Organizational Skills PresentationOrganizational Skills Presentation
Organizational Skills PresentationEmily Kates
 
Demonstration in teaching
Demonstration in teachingDemonstration in teaching
Demonstration in teachingFamelaMelate
 
PROCRASTINATION POWERPOINT
PROCRASTINATION POWERPOINTPROCRASTINATION POWERPOINT
PROCRASTINATION POWERPOINTAndrew Schwartz
 
Performance Appraisal
Performance AppraisalPerformance Appraisal
Performance AppraisalRajesh Patel
 
Rewards And Recognition
Rewards And RecognitionRewards And Recognition
Rewards And Recognitionrajeevgupta
 
Setting up a Project Management Office (PMO)
Setting up a Project Management Office (PMO)Setting up a Project Management Office (PMO)
Setting up a Project Management Office (PMO)Hussain Bandukwala
 

Destaque (13)

Budget reductions and accountability final
Budget reductions and accountability finalBudget reductions and accountability final
Budget reductions and accountability final
 
Introducing action research
Introducing action researchIntroducing action research
Introducing action research
 
Experimental Psychology
Experimental PsychologyExperimental Psychology
Experimental Psychology
 
Getting Things Done - internal implementation plan
Getting Things Done - internal implementation planGetting Things Done - internal implementation plan
Getting Things Done - internal implementation plan
 
Task based-learning
Task based-learningTask based-learning
Task based-learning
 
Delegation and decentralisation
Delegation and decentralisationDelegation and decentralisation
Delegation and decentralisation
 
Organizational Skills Presentation
Organizational Skills PresentationOrganizational Skills Presentation
Organizational Skills Presentation
 
Demonstration in teaching
Demonstration in teachingDemonstration in teaching
Demonstration in teaching
 
PROCRASTINATION POWERPOINT
PROCRASTINATION POWERPOINTPROCRASTINATION POWERPOINT
PROCRASTINATION POWERPOINT
 
Performance Appraisal
Performance AppraisalPerformance Appraisal
Performance Appraisal
 
Rewards And Recognition
Rewards And RecognitionRewards And Recognition
Rewards And Recognition
 
Setting up a Project Management Office (PMO)
Setting up a Project Management Office (PMO)Setting up a Project Management Office (PMO)
Setting up a Project Management Office (PMO)
 
Motivation ppt
Motivation pptMotivation ppt
Motivation ppt
 

Semelhante a Software (requirement) analysis using uml

OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptxanguraju1
 
hotel management dbms.docx
 hotel management dbms.docx hotel management dbms.docx
hotel management dbms.docxKaranamManideep1
 
Passport Automation System
Passport Automation SystemPassport Automation System
Passport Automation SystemMegha Sahu
 
Onlineshopping 121105040955-phpapp02
Onlineshopping 121105040955-phpapp02Onlineshopping 121105040955-phpapp02
Onlineshopping 121105040955-phpapp02Shuchi Singla
 
Onlineshoppingonline shopping
Onlineshoppingonline shoppingOnlineshoppingonline shopping
Onlineshoppingonline shoppingHardik Padhy
 
Online eaxmination
Online eaxminationOnline eaxmination
Online eaxminationAditi_17
 
Online Hotel Management System
Online Hotel Management SystemOnline Hotel Management System
Online Hotel Management SystemAbdullah Almasud
 
HOTEL MANAGEMENT SYSTEM vi.docx
HOTEL MANAGEMENT SYSTEM vi.docxHOTEL MANAGEMENT SYSTEM vi.docx
HOTEL MANAGEMENT SYSTEM vi.docxKartikeySingh87567
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptxTekle12
 
Online Voting System Project management system.doc
Online Voting System Project management system.docOnline Voting System Project management system.doc
Online Voting System Project management system.docKamal Acharya
 
Refining The System Definition
Refining The System DefinitionRefining The System Definition
Refining The System DefinitionSandeep Ganji
 

Semelhante a Software (requirement) analysis using uml (20)

OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptx
 
UML Unit 01
UML Unit 01UML Unit 01
UML Unit 01
 
hotel management dbms.docx
 hotel management dbms.docx hotel management dbms.docx
hotel management dbms.docx
 
Passport Automation System
Passport Automation SystemPassport Automation System
Passport Automation System
 
M azhar
M azharM azhar
M azhar
 
Uml intro
Uml introUml intro
Uml intro
 
Onlineshopping 121105040955-phpapp02
Onlineshopping 121105040955-phpapp02Onlineshopping 121105040955-phpapp02
Onlineshopping 121105040955-phpapp02
 
Onlineshoppingonline shopping
Onlineshoppingonline shoppingOnlineshoppingonline shopping
Onlineshoppingonline shopping
 
Online eaxmination
Online eaxminationOnline eaxmination
Online eaxmination
 
Online Hotel Management System
Online Hotel Management SystemOnline Hotel Management System
Online Hotel Management System
 
Use Case UML Diagram
Use Case UML DiagramUse Case UML Diagram
Use Case UML Diagram
 
HOTEL MANAGEMENT SYSTEM vi.docx
HOTEL MANAGEMENT SYSTEM vi.docxHOTEL MANAGEMENT SYSTEM vi.docx
HOTEL MANAGEMENT SYSTEM vi.docx
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
Online Voting System Project management system.doc
Online Voting System Project management system.docOnline Voting System Project management system.doc
Online Voting System Project management system.doc
 
Chapter5
Chapter5Chapter5
Chapter5
 
Refining The System Definition
Refining The System DefinitionRefining The System Definition
Refining The System Definition
 
Lecture05
Lecture05Lecture05
Lecture05
 
Lecture05
Lecture05Lecture05
Lecture05
 
Lecture05
Lecture05Lecture05
Lecture05
 
Lecture05
Lecture05Lecture05
Lecture05
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 

Software (requirement) analysis using uml

  • 1. Software Requirement Analysis using UML Software Requirement Analysis Using UML -1-
  • 2. Software Requirement Analysis using UML Introduction The document hopes to break a common myth that software analysis is a non-logical process. We attempt to present the entire process as a series of logical steps which could be followed to ensure customer satisfaction. This document is based on the knowledge base that has been collected from various sources. Most of the steps followed here are based on the RUP model. -2-
  • 3. Software Requirement Analysis using UML What are Requirement Artifacts? Requirements artifacts are the diagrams/flowcharts/algorithms/documents that a software designer creates as a result of the process of developing and managing software requirements. Each artifact serves a particular purpose for understanding and communicating either the user requirements or the software requirements. Each artifact provides a view of the full set of requirements. The set of UML artifacts (not necessarily every type of UML diagram BUT only a subset of UML diagram-types that the designer deems necessary) ensures that these views do not conflict with one another. The following figure illustrates the overall architecture of the requirements artifacts: Figure 1: Software Analysis Model Each artifact in the above Software Analysis Model serves a particular purpose in final goal of capturing the system requirements: Use Case Model: The use case model consists of Actors, Use Case diagrams as well as Use Case specifications. Actors are entities external to the system which are unaffected by the current design process (but interact with the system in clearly documented ways). The use-cases capture the high-level functionality of the system. The use case specifications are the detailed description of how the actors interact with the system to achieve a specific goal. -3-
  • 4. Software Requirement Analysis using UML Class Diagrams: The Class Diagrams (analysis classes) show the entities that need to work together to ensure that our system realizes each use case specification. The Class Diagrams contains the functional requirements of the software. Objects of each class fulfill their responsibilities in collaboration with objects of the other classes in the model. Sequence Diagrams: The Sequence Diagrams show how objects of classes in the Class Diagram collaborate to realize a use case. Each use case specification is related to one or more sequence diagrams Activity Diagrams: Activity diagrams are similar to flow charts. We use activity diagrams for (visually) capturing the dynamic behavior of a given part of our system. State Diagrams: State transition diagrams can be used to describe the behavior of a class, a use case, or a system. The key components of a state transition diagram are the states, triggering events that cause a transition from one state to another or possibly back to the same state, guards on those transitions, and actions the entity can perform during the transitions. Software Requirements Specification (SRS): The SRS is the final (all-inclusive) artifact of the requirements development process. The SRS contains BOTH the specification of the functional requirements for each class in the class diagram AND the nonfunctional requirements. The SRS may also contain a specification of the interfaces to the system. We learn the entire process of software (requirement) analysis using an example. We build up the various artifacts starting from a simple problem statement given below: Problem Statement: Implement a Hotel Management System wherein the customer can book one of the following kinds of rooms: Single Double Suite The system takes care of the billing which includes the Room service/Std calls etc -4-
  • 5. Software Requirement Analysis using UML Use Case Model The use case model captures the interaction of the system with other external entities. We start by enlisting a rough draft of the scenarios in which the system will be exercised and then go on to refine the same (for capturing more specific details). The high-level overview of the system (given earlier) reveals the following use-case scenarios: 1. Hotel Room reservation 2. Room Service (Food) 3. Telephone/Internet Service 4. Billing We now try to refine the above use-case scenarios for capturing more details. We try to make good use of the available use-case relationships i.e. extends, includes and generalization (of both actors and use cases). Capturing such fine details helps in both getting a broader view of the system as well as encouraging reuse. Identifying the Actors & Elaborating the Use-case scenarios From the above identified use case scenarios we can deduce the following four broad categories of actors 1. Customer 2. (Hotel) Employee 3. (Hotel) Manager (responsible for booking/tariff selection etc) 4. Hotel Register (Customer details/Billing details/Room availability details) Each of the above identified use case scenarios are then elaborated after taking continuous feedback from the customer. -5-
  • 6. Software Requirement Analysis using UML Figure 2: Actors of the Hotel Management System -6-
  • 7. Software Requirement Analysis using UML Figure 3: Room Reservation Use Cases -7-
  • 8. Software Requirement Analysis using UML Figure 4: Room Service Use Cases -8-
  • 9. Software Requirement Analysis using UML Figure 5: Telephone Service Use Cases -9-
  • 10. Software Requirement Analysis using UML Figure 6: Billing Use Cases - 10 -
  • 11. Software Requirement Analysis using UML (Incrementally) Iterative development model This model is close to the iterative development model (as suggested by RUP). We first sort the requirements (read as Use Cases) according to their: 1. Urgency (as decided by customer) 2. Complexity 3. Risk (as perceived by architect/developer) We then prioritize the use cases by taking a weighted average of the above 3 priority values (weights could be decided after discussion with customer/client). For the Hotel Management system being considered here, we assume that the top 3 use cases (highest priority) are: 1. Make Reservation 2. Make Corporate Reservation 3. Make Group Reservation We now do a complete iteration of software analysis for each of these 3 requirements. The other use cases are explored incrementally (in subsequent iterations). Use Case Name: Make Reservation Author (Date) of first Revision: Dhiraj Shetty (Feb 25th, 2009) Precondition: Hotel Register is updated with latest info Post-condition: Hotel Register updated to include current booking Failed Post-condition: Hotel Register remains unaffected Main Flow: 1. Customer gives itinerary (days of stay at hotel) 2. System searches for room details 3. System presents room types and tariffs 4. Customer selects room and confirms tariff 5. System records customer‟s name and address 6. Manager confirms booking on system 7. System generates confirmation receipt. Alternate Flow: Tariff Negotiation 3.1. Customer asks for discount 3.2. Manager does DSS analysis (external to system) to decide feasibility of discount Use Case Specification for “Make Reservation” - 11 -
  • 12. Software Requirement Analysis using UML Use Case Name: Make Corporate Reservation Author (Date) of first Revision: Dhiraj Shetty (Feb 25th, 2009) Precondition: Hotel Register is updated with latest info Post-condition: Hotel Register updated to include current booking Failed Post-condition: Hotel Register remains unaffected Main Flow: 1. Customer gives itinerary (days of stay at hotel) 2. System searches for room details 3. System presents room types and special corporate tariffs 4. Customer selects room and confirms tariff 5. System records the name and address of both the customer as well as guest (customer‟s client/employee) 6. Manager confirms booking on system 7. System generates confirmation receipt. Alternate Flow: Tariff Negotiation 3.1. Customer asks for discount 3.2. Manager does DSS analysis (external to system) to decide feasibility of discount Use Case Specification for “Corporate Reservation” Use Case Name: Make Group Reservation Author (Date) of first Revision: Dhiraj Shetty (Feb 25th, 2009) Precondition: Hotel Register is updated with latest info Post-condition: Hotel Register updated to include current booking Failed Post-condition: Hotel Register remains unaffected Main Flow: 1. Customer gives itinerary (days of stay at hotel) 2. System searches for room details 3. System presents room types and special group tariffs 4. Customer selects rooms and confirms tariff(s) 5. System records name and address for each customer in group 6. Manager confirms booking on system 7. System generates confirmation receipt. Alternate Flow: Tariff Negotiation 3.1. Customer asks for discount 3.2. Manager does DSS analysis (external to system) to decide feasibility of discount Use Case Specification for “Group Reservation” - 12 -
  • 13. Software Requirement Analysis using UML Identification of Analysis Classes: Analysis classes are categorized into the following 3 kinds: 1. Boundary Classes (the Interface)  Behavior that involves communication with an actor 2. Control Classes (the Use Case flow of events)  Behavior specific to a use case or part of a very important flow of events 3. Entity Classes(Persistent Data)  Behavior that involves the data encapsulated within the abstraction Boundary classes model the interaction between the system and its surroundings. As a thumb rule we need one boundary class per „Actor‟-„Use Case‟ pair. They should be modeled according to the type of boundary they represent. For e.g.:  Modeling a boundary with a human actor should stress more on how the interface will be presented to the user.  Modeling a boundary with an external system should stress more on the communication protocol. Control classes coordinate the activities of other objects that implement the functionality of a use case. However they may share a many-to-many relationship with use cases. The design of control cases should be independent of change in surroundings. They should also be independent of the internal structure of their corresponding entity classes. It‟s always better to divide a given control class if: 1. Two different actors interact with the same control class in different ways 2. The control task performs more than one kind of task and each are equally susceptible to change during the life time of the system. Entity classes are used to hold and update information about an event, a person or some real-life object. They are independent of the environment (the actors). Thus changing the GUI or communication protocol (for communicating with external entities) should entail changing only the boundary classes, not the entity and control classes. Entity classes can be identified using the use case specifications. The first step in this exercise is to identify all the nouns in the use case specification. These are the best hints to the classes in the system. The verbs indicate the methods. The nouns which indicate entities external to the system (for e.g. Actors) are to be skipped. Entity classes may also come from the domain model (business entities). - 13 -
  • 14. Software Requirement Analysis using UML Boundary Classes identified are: 1. Manager-Reservation-behaviour 2. Customer-Reservation-behaviour 3. HotelRegister-Reservation-behaviour Control Classes identified are: 1. MakeReservation-Controller 2. GroupReservation-Controller 3. CorporateReservation-Controller Entity Classes identified are: 1. Customer-info 2. Room-info 3. Reservation-info 4. Group-reservation-info 5. Corporate-reservation-info Distribute Responsibilities between the Analysis Classes Responsibilities of an object for a given Analysis class are characterized as: 1. The actions the object can perform 2. The knowledge that the object maintains and provides to other objects Analysis classes with only one responsibility are probably too simple, while those with a dozen or more can potentially be split into several classes. Responsibilities are determined by drawing Sequence Diagrams OR Collaboration Diagrams for representing the use case flows. Collaboration diagrams do have a distinct advantage over sequence diagrams in that they allow you to show more complex branching as well as multiple concurrent flows of control. Sequence diagrams help in „top to bottom‟ chronological ordering of messages but only allow us to show simple branching. We now draw interaction diagrams for every possible use case flow i.e. main flow and/or alternate flow and/or exception flow. The messages that are passed to the objects (of Analysis classes) automatically give us their responsibilities. Besides, some other responsibilities may also be derived from the non-functional requirements. While allocating responsibilities to entity classes it may be helpful to have a broader overview of the entire system (rather than just the current subset of use cases). For e.g. While designing the book reservation system for British Library (which has multiple branches across India) it may be sensible for the BOOK entity to include methods MOVE_LOCATION and GET_CURRENT_LOCATION. - 14 -
  • 15. Software Requirement Analysis using UML The remaining part of this document will focus on the analysis of only the above use case flow. In practice however we analyze all the flows (that have been selected for the current iteration) in parallel. This ensures that we come up with a more comprehensive analysis for the classes involved. The responsibilities of each analysis class are now identified using the incoming arrow to its corresponding lifeline (in the sequence diagram analysis). For example, we can list the responsibility of customer-reservation-behavior class as: 1. Provide an UI to capture customer‟s itinerary dates. 2. Provide an UI to query room availability. 3. Provide an UI to display available rooms (arranged by category/rates). 4. Provide an UI to take room reservation confirmation. 5. Provide an UI to display reservation-confirmation details. 6. Provide an UI for capturing customer‟s personal data. Further the non-functional requirements may also affect the analysis either by: 1. Introducing new responsibilities OR 2. Affecting the descriptions of pre-identified responsibilities - 15 -
  • 16. Software Requirement Analysis using UML Define Attributes Attributes are the information-holders of an analysis class. The name of the attribute should clearly specify the information that the attribute holds. Optionally we could use a short description for giving more details. Attributes are usually: 1. Simple data types like string/integer etc 2. Uniquely owned by the object (to which it belongs) i.e. no sharing across objects 3. Have no real behavior other than providing its value. It is always better to model a potential attribute as a separate analysis class in the following conditions: 1. The information has a complex behavior. 2. The information is shared across objects OR 3. The information is passed “by reference” between two or more objects. For example, the attributes of the customer-info class could be defined as:  Integer Customer_ID  String Name  String Address  String Contact_Number Incase the data types identified are advanced features/types provided by certain languages (like STL in C++) we should clearly document the expected behavior of the type. This helps to keep the requirements independent of the implementation mechanism. It also ensures that we do not force any choices on the designer/developer. Establish Relationship between Analysis Classes (Class Diagrams) The analysis classes in this model don‟t represent actual classes to be implemented in the code; instead they represent conceptual entities that interact to represent the behavior of the proposed software without thinking much about implementation issues like persistence, performance or security. Besides, we do not apply any kind of design patterns here. Design patterns like Strategy, Abstract Factory etc come into play during the next stage of converting the analysis to a formal design. We start with a quick overview of the kinds of class relationships: 1. Association: A relationship between classes that allows instances of those classes to send messages to each other. For example: An "Employee” works in a “Company". 1a. Multiplicity: An example of this kind of association is many employees working at the same company. In this case, the relation shows a star sign near the employee class. We can use UML to model „one to many‟, „many to many‟ and so forth kind of relations. - 16 -
  • 17. Software Requirement Analysis using UML 1b. Directed Association: Association between classes is considered to be bi-directional by default. However we can fix the navigability of the association by using a directed association. The arrowhead identifies the container-contained relationship. 1c. Reflexive Association: It does not need any special visual symbol. However, the relation will point back at the same class. An example of this kind of relation is when a class has a variety of responsibilities. For example, an employee of a company can be a manager for another employee. 2. Aggregation: When a class is formed as a collection of other classes, it is called an aggregation relationship between these classes. It is also called a "has a" relationship. 2a. Composition: Composition is a special kind of aggregation relationship in which the life-cycle of the contained object strictly ends at (or before) the destruction of the container object. 3. Inheritance/Generalization: Generalization is an "is a" relationship in which the child class is a type of the parent class. Generalization is the basic mechanism for encouraging reuse. The child classes "inherit" the functionality defined in the parent class. 4. Realization: In a realization relationship, one entity (normally referred to as an interface) defines a set of functionalities as a contract and the other entity (normally referred to as a concrete class) "realizes" the contract by implementing the functionality defined in the contract. Class diagrams help in identifying relationships in the space domain. For example in the system currently under analysis, it may be helpful to capture that Group-reservation-info and Corporate-reservation-info classes are inherited from Reservation-info class. - 17 -
  • 18. Software Requirement Analysis using UML Need for Activity Diagrams Activity diagrams are used to model the dynamic behavior of any element of an object oriented system. Two common uses include: 1. Modeling the flow of a use case 2. Modeling the behavior of an operation on a class(object) Modeling the use case flow is beneficial in cases in which the flow appears to be complex in terms of multiple alternate flows. It helps to get a broader picture of how the various (alternate) flows branch and merge at different points. Besides symbols like fork/join could be intelligently used to capture information that may not be clear in the use case specification. Activity diagrams can be a very helpful input in drawing the interaction diagrams. Need for Interface Requirement Specification While designing systems that need to interface with (existing/pre-designed) external systems, we need to ensure that the external interfaces of our modules are compatible with the interfaces presented by the external system. The IRS is used to capture such requirements. Such interface requirements can also be represented on the class diagram (covered earlier) using the “Realization” relationship. For example, let us consider the scenario in which the Billing system needs to interface with an existing print server. In this case we document the interface provided by the print server as follows: interface PrintServer { // defines an abstract printer server // requires: interface Printer, interface PrintDoc // provides: initialize, print, displayPrintQueue, cancelPrintJob void initialize (Printer p); void print (Printer p, PrintDoc d); void displayPrintQueue (Printer p); void cancelPrintJob (Printer p, PrintDoc d); } //PrintServer Interface specification for Print Server We can then proceed to elaborate the interfaces for Printer and PrintDoc (if required). This ensures that the billing system developers know not only the procedural interface but also the data format to be followed for interfacing with the (existing) print server(s). - 18 -
  • 19. Software Requirement Analysis using UML Need for State Diagrams State diagrams help us to capture certain requirements that may be very crucial to the correct/efficient working of the system. Even if they may not come directly into the final SRS, they do affect the functional/non-functional requirements. A common example can be that of a “Software Defect Tracking” system in which we need to capture not only the valid states (like unassigned/assigned/resolved/deferred/retired) but also the valid state transitions. Specifying Functional Requirements using the Class Diagram Functional requirements are usually written in the language conducive to programmers. This means we are free to use standard programming constructs like sequence, iteration, conditional logic etc which may not necessarily be clear to the customer. We should include a short description of the need/responsibility of each class, each class-attribute as well as each class-method. Specifying Non Functional Requirements Functional requirements specify the actions that the software must perform. Non- functional requirements place restrictions on the product being developed and/or the development process. They may also specify external constraints that the product must meet. Figure 8: Classification of Non Functional Requirements - 19 -
  • 20. Software Requirement Analysis using UML It is usually difficult to identify non-functional requirements, unless clearly specified in the problem statement. In such cases, it is better to probe the customer using open-ended questions in each of the categories given in the above diagram. Software Requirement Specification The SRS document is the official statement of what is required of the system developers. It is NOT a design document. To the extent possible, it should only specify WHAT the system needs to do, rather than HOW it should do it. Each software product company/vendor usually has its own format for documenting the requirements. Ideally the SRS should include the following topics:  Introduction.  General system description.  Specific requirements.  Appendices.  Index. - 20 -