UNIT 2 Oose
UNIT 2 Oose
Requirement Analysis
What is Requirement Analysis?
Requirement analysis is the process of understanding what users want from a system. Before
developing software, it is important to clearly define its functions to ensure that it meets user
needs. This process helps in making sure the software works correctly and solves the
intended problem.
Example:
A banking system should allow users to:
Check their account balance.
Transfer money to other accounts.
Pay bills online.
2. Non-Functional Requirements
These define how the system should perform. They focus on the quality and performance of
the system rather than specific functions.
Example:
A website should:
Load in under 3 seconds.
Handle 1,000 users at the same time without crashing.
Be accessible on both mobile and desktop devices.
Requirement Specification
Once requirements are analysed, they need to be documented properly. Requirement
Specification
A Requirement Specification is a formal document that outlines the functionalities, features,
and constraints of a system or product. It serves as a guide for developers, testers, and
designers to ensure that all stakeholders have a clear understanding of what needs to be built.
Key Aspects of Requirement Specification:
1. Acts as a Contract – It establishes a mutual agreement between developers and
customers, ensuring both parties understand the scope and expectations of the project.
2. Defines What Needs to Be Built – Provides a clear and structured description of the
system’s functionalities, performance criteria, and constraints.
3. Ensures Alignment – Helps developers, testers, and designers work in sync by
offering a common reference document.
Types of Requirement Specifications:
1. Software Requirement Specification (SRS) – A detailed document describing
software functionalities, system requirements, and constraints.
2. Business Requirement Specification (BRS) – Outlines the high-level business
objectives and needs of the system.
3. Functional Requirement Specification (FRS) – Defines specific functions and
behaviors of the system.
=================================================================
Requirements Gathering
Requirements gathering is the first and most important step in making a system. It means
collecting information about what the system should do. We talk to different people who will
use or be affected by the system. These people are called stakeholders (such as customers,
employees, and managers).
This step helps us understand what users need so we can build a system that works well for
them.
Steps in Requirements Gathering
1. Identify Stakeholders
• Stakeholders are the people who will use the system or be affected by it.
• They can be customers, employees, managers, or even company owners.
Why is this important?
• If we don’t know who will use the system, we won’t know what they need.
• Each stakeholder may have different needs, so we must consider all of them.
=================================================================
Software Requirement Specification (SRS)
A Software Requirement Specification (SRS) is a document that explains what a software
system should do. It describes the purpose of the software, how it will work, and what
features it must have.
Think of it as a blueprint for building software—just like an architect’s plan for a house. It
helps developers, testers, and users understand the software before it is built.
The SRS is like a contract between:
• The developers (who create the software)
• The users or clients (who will use the software)
SRS Components:
An SRS document typically includes the following sections:
1. Introduction
This section explains the basic details of the software:
• What is the software about?
• Why is it being created?
• How will it help users?
For example, if the software is an online shopping app, the introduction will describe:
• The app's goal (helping people buy products online)
• Who will use it (customers, sellers, admins)
• How it makes shopping easier (secure payments, fast delivery, etc.)
2. Overall Description
This part gives a broader view of the system. It includes:
• Types of users – Who will use the software? (e.g., customers, employees, managers)
• Main features – The key functions of the software (e.g., product search, order
tracking, customer support)
• Limitations or restrictions – Any boundaries for the software (e.g., available only in
certain countries, requires an internet connection)
3. Functional Requirements
These describe what the software must do. It includes all the tasks and features the system
needs to perform.
For example, in a shopping app, functional requirements may include:
• Users can search for products.
• Users can add products to their cart.
• Users can proceed to checkout and make payments.
• Admins can add or remove products from the store.
Each function is explained clearly so developers know exactly what to build.
4. Non-Functional Requirements
These describe how well the software should perform. They focus on quality, including:
• Performance – How fast should the app load? How many users can it handle at once?
• Security – How will user data be protected? Will it use encryption?
• Reliability – Will the system work properly even during heavy usage?
• Usability – How easy is it to navigate and use the app?
For example:
• The shopping app should load within 3 seconds.
• It should encrypt customer payment details for security.
• It should be available 24/7 without crashing.
5. Constraints
This section lists the rules and limitations the software must follow. These could be
technical, legal, or business-related.
Examples:
• The software must be built using Python and MySQL.
• It must comply with data protection laws like GDPR.
• It must support both Android and iOS devices.
✔ Acts as a guide – Developers and testers can refer to it during software development.
✔ Helps in testing – Ensures that the final software meets all requirements.
✔ Saves time and cost – Avoids rework and confusion by having clear expectations from the
start.
=================================================================
Formal System Specification
A Formal System Specification is a method of defining a system using mathematical and
logical notations to ensure accuracy, consistency, and completeness. It helps in designing
error-free systems by providing a precise and unambiguous description of system behavior.
2. Mathematical Logic
• It is a set of rules that describe what actions should happen based on conditions.
• It ensures that the system behaves exactly as expected.
• It follows an "If-Then" structure.
Example:
• If a user enters the correct username and password, they should be logged in.
• If they enter the wrong password three times, their account should be locked.
This ensures that the system follows strict rules without errors.
3. Set Theory
• Set Theory is a way of grouping things together.
• It helps define valid inputs for the system.
Example:
• Suppose we have a set of valid passwords:
o Valid passwords: "pass123", "admin2024", "welcome!"
• A user can only log in if their password is in this set.
• If the user enters a password that is not in the set, login will fail.
This prevents errors and makes sure only valid users can access the system.
Petrinets
A Petri Net is a mathematical model used to describe systems where things happen step by
step. It is widely used to study and design computer systems, workflows, and processes
where multiple activities occur at the same time.
• A token (●) inside a place (⚪ circle) tells us what is happening right now.
• A system starts with tokens in certain places.
• Example: If a machine is Idle, a token will be inside the Idle place.
Step 2: A Transition "Fires" When the Right Condition is Met
=================================================================
UML (Unified Modeling Language) is a set of diagrams that help software developers design
and plan object-oriented systems. It has become the industry standard for representing
how software systems work.
UML was developed by James Rumbaugh, Grady Booch, and Ivor Jacobson and was
later approved by the Object Management Group (OMG) as a standard for software
development.
• Helps developers understand and communicate how a system will work.
• Breaks down complex systems into easy-to-understand diagrams.
• Covers different aspects of software development, such as user interactions, data
structures, processes, and system components.
Main UML Diagrams and Their Purpose
UML Diagram What It Represents
Use Case Diagram How the system interacts with users.
Class Diagram The data elements (classes) in the system and how
they relate to each other.
Interaction Diagram (Sequence & How objects work together to perform a function.
Collaboration)
State Diagram How an object behaves throughout different use
cases.
Activity Diagram The sequence of activities that make up a process.
Component Diagram The different software components and their
dependencies.
Deployment Diagram The hardware and software elements and their
physical relationships.
2. Use Case
• A use case represents a function or action performed by the system.
• It describes what the system does in response to an actor’s request.
• Each use case delivers a specific outcome to the user.
Examples of Use Cases in Different Systems
A. Online Shopping System
• Browse Products – A customer views available products.
• Add to Cart – A customer selects products for purchase.
• Make Payment – The system processes the payment.
• Track Order – A customer checks order status.
3. Relationships
What are Relationships in a Use Case Model?
• Relationships define how actors and use cases are connected.
• There are three main types: Association, Include, and Extend.
A. Association Relationship
• Definition: A direct connection between an actor and a use case.
• Meaning: The actor uses the use case.
• Example:
o In an online shopping system:
▪ A Customer is associated with the Make Payment use case.
Diagram Representation:
scss
CopyEdit
(Customer) ------> (Make Payment)
B. Include Relationship
• Definition: A use case always includes another use case.
• Meaning: The included use case is mandatory whenever the main use case runs.
• Example:
o "Make Payment" always includes "Payment Confirmation" in an online
shopping system.
Diagram Representation:
scss
CopyEdit
(Make Payment) --------> (Payment Confirmation) [<<include>>]
• Whenever "Make Payment" happens, "Payment Confirmation" must occur.
C. Extend Relationship
• Definition: A use case may optionally extend another use case.
• Meaning: The extended use case happens only under certain conditions.
• Example:
o In an ATM system:
▪ "Withdraw Cash" may extend "Print Receipt", but printing the
receipt is optional.
Diagram Representation:
scss
CopyEdit
(Withdraw Cash) --------> (Print Receipt) [<<extend>>]
• The "Withdraw Cash" use case can work without printing a receipt, but if the user
selects the option, the "Print Receipt" use case will be executed.
How a Use Case Model Works
Let’s take an Online Shopping System as an example.
Step 1: Identify the Actors
Actors are users or external systems that interact with the online shopping system.
• Customer (Buys products)
• Admin (Manages inventory and orders)
• Payment System (Processes transactions)
Step 2: Identify the Use Cases
Use cases are the actions performed by the system for the actors.
• Browse Products – Customer views products.
• Add to Cart – Customer selects products.
• Make Payment – Customer completes the purchase.
• Track Order – Customer checks delivery status.
• Manage Inventory – Admin updates product details.
Step 3: Define Relationships
• Customer → Browse Products (Association: Customer can browse products)
• Customer → Make Payment → Payment System (External Interaction)
• Admin → Manage Inventory (Admin updates stock)
• Make Payment → Payment Confirmation (Include Relationship: Payment always
includes confirmation)
=================================================================
Class Diagram
A Class Diagram is a visual representation that shows how different parts of a system (called
"classes") are connected.
Components:
1. Classes – These are like templates or blueprints for creating objects in a program.
Each class represents something meaningful in the system, like a Book or a Member.
2. Attributes – These are pieces of data stored in a class. For example, a Book class
might have an attribute for its title or author.
3. Methods – These are functions inside a class that define what the class can do. For
example, a Library class might have a method to AddBook() or IssueBook().
4. Relationships between classes – These define how different classes are connected to
each other. For example, a Member class might have a relationship with the Book
class, showing that a member can borrow a book.
(Draw empty diagram and mark the parts)
Example – Library System Class Diagram
Imagine a library system where:
• A Library has books and manages them.
• A Book has details like title, author, and ISBN.
• A Member can borrow books from the library.
Here’s how the classes would look:
Classes and Their Details:
1. Book
o Attributes: Title, Author, ISBN
o Methods: Borrow(), Return()
2. Member
o Attributes: Name, MemberID
o Methods: Register(), BorrowBook()
3. Library
o Attributes: Name, Address
o Methods: AddBook(), IssueBook()
Relationships:
• A Library contains many Books.
• A Member can borrow a Book from the Library.
Why Use Class Diagrams?
• Helps in software design: Before writing code, developers can plan how data will be
organized.
• Defines structure clearly: Shows how different classes interact, making it easier for
teams to understand the system.
• Saves time: Reduces confusion during coding and helps in debugging.
=================================================================
Interaction Diagrams
These diagrams show how objects interact with each other during system execution. There
are two types:
A. Sequence Diagram
B. Collaboration Diagram
A. Sequence Diagram
A sequence diagram shows the step-by-step interaction between objects in a system. It
focuses on the order of events and how messages are passed over time.
Key Features:
=================================================================
Activity Diagram
An Activity Diagram is a simple way to show how a process works step by step. It helps us
understand what happens first, what happens next, and how the process ends.
It is like a flowchart, where we use arrows to show the flow of activities. Each step is called
an activity, and the arrows show the order in which the activities happen.
Why Do We Use an Activity Diagram?
Activity diagrams are useful for many reasons:
1. Understanding a process – It helps us see the steps in a task or a system.
2. Finding problems – It helps identify issues, delays, or inefficiencies.
3. Making improvements – Once we see the process clearly, we can make it better.
4. Software design – Programmers use activity diagrams to design how software will
work.
Components of an Activity Diagram
1. Initial Node (Start)
o Represents the starting point of the workflow.
o Depicted as a solid black circle.
2. Activity/Action
o Represents a task or operation in the workflow.
o Depicted as a rounded rectangle.
o Example: "User logs in," "Process order."
3. Control Flow (Arrow)
o Shows the sequence of activities.
o Depicted as a solid arrow pointing from one action to the next.
4. Decision Node (Branching)
o Represents conditional paths (like an IF-ELSE decision).
o Depicted as a diamond shape.
o Example: "Is payment successful?" → Yes → "Ship order"; No → "Retry
payment."
5. Merge Node
o Combines multiple alternative flows back into a single flow.
o Also represented as a diamond but used to join paths.
6. Fork Node (Parallel Execution)
o Splits the workflow into multiple parallel activities.
o Depicted as a thick horizontal or vertical bar.
7. Join Node
o Merges parallel activities back into a single flow.
o Also represented as a thick bar.
8. Swimlanes
o Divides the diagram into sections representing different actors, departments,
or systems.
o Helps clarify responsibilities for each activity.
9. Signals (Send/Receive)
o Represents asynchronous communication or external events.
o Depicted as an envelope icon.
10. Final Node (End)
• Represents the termination of the process.
• Depicted as a solid black circle with an outer ring.
Eg:-
2. Transition – A solid arrow is used to indicate the transition or shift of control from
one state to another. The arrow is labeled with the event that triggers the state change.
3. State – A rounded rectangle represents a state. It defines the conditions or
circumstances of an object in a class at a specific moment in time.
4. Fork - A rounded solid rectangular bar is used to represent a fork notation, where an
incoming arrow originates from the parent state and outgoing arrows point toward the
newly created states. This notation is used when a state splits into two or more
concurrent states.
5. Join-A rounded solid rectangular bar is used to represent a join notation, where
incoming arrows come from multiple joining states and an outgoing arrow leads to the
common goal state. The join notation is used when two or more concurrent states
merge into a single state upon the occurrence of an event.
6. Self transition - We use a solid arrow pointing back to the state itself to represent aself
transition. There might be scenarios when the state of the object does not change upon
the occurrence of an event. We use self transitions to represent such cases.
7. Composite state - We use a rounded rectangle to represent a composite
state also. We represent a state with internal activities using a composite
state.
=================================================================
Functional Modeling
Functional modeling is a method used in system analysis and design that focuses on what a
system does rather than how it works. It represents the system's functions, processes, inputs,
and outputs, ensuring that the system's behavior is well understood before implementation.
Key Aspects of Functional Modeling:
1. Descriptive, Not Procedural:
o Functional modeling describes the functions of a system without detailing
how those functions are implemented internally.
o It answers the “what” rather than the “how.”
2. Focus on Inputs, Processes, and Outputs:
o Input: The data or actions provided by users or other systems.
o Process: The transformation of input data into meaningful outputs.
o Output: The result produced after processing, which could be a report, a
confirmation message, or a completed transaction.
3. Systematic Representation:
o It provides a structured way to analyze system requirements before
development.
o It helps in understanding and documenting the expected behavior of a system.
Common Functional Modeling Techniques:
1. Data Flow Diagrams (DFD):
o Graphically represents how data moves within a system.
o Shows relationships between inputs, processes, and outputs.
2. Use Case Diagrams:
o Depicts interactions between users (actors) and the system.
o Helps in identifying functional requirements.
3. Activity Diagrams:
o Describes the workflow of processes within a system.
o Useful in visualizing decision points and process sequences.
Levels of a DFD
DFDs are divided into different levels based on detail:
Level 0 (Context Diagram)
• The highest-level DFD, providing an overview of the entire system.
• Shows the system as a single process, with external entities interacting with it.
Level 1 (More Detailed Breakdown)
• Expands on Level 0 by breaking the system into multiple processes.
• Shows major functions and their interactions.
=================================================================
CASE Tools (Computer-Aided Software Engineering Tools)
What Are CASE Tools?
Computer-Aided Software Engineering (CASE) tools are software applications that help
automate different phases of the software development lifecycle (SDLC). These tools assist
software engineers, developers, and project managers in designing, coding, testing, and
maintaining software applications. By automating various tasks, CASE tools improve
productivity, enhance software quality, and reduce development time.
========================================================