Module 2
Module 2
Engineering and
Design Engineering
Module 2
IEEE Definition of Software Requirement
1. Requirement Elicitation
2. Requirement Analysis
3. Requirement Specification
4. Requirement Validation
Software Requirements Engineering (SRE)
Requireme
Requireme
Requirement Requireme nt
nt
Elicitation nt Analysis Specificatio
Validation
n (SRS)
1. Requirement Elicitation
2. Requirement Analysis
3. Requirement Specification
4. Requirement Validation
Requirements Gathering
requirements:
○ The analyst drafts requirements and shares them
with users.
○ Users give feedback.
consensus is reached.
3. Task Analysis:
● Users view software as a set of services (tasks).
● The analyst identifies the tasks users want the software
to perform.
● Each task is broken into detailed steps with user input
● Purpose:
● Helps the analyst understand user activities in detail and
organize them into a hierarchy of subtasks.
4. Scenario Analysis:
● A task can behave differently under various conditions
(scenarios).
● Each scenario represents a different situation in which a task is
performed.
The analyst identifies all possible scenarios for each task and defines:
● System behavior in each case.
● Conditions that trigger the scenario.
● Required system responses.
● Business Requirements
○ High-level objectives of the customer or organization (e.g., "Increase user engagement by 25%").
● Customer Requirements
○ Statements of what the system should provide, described from the user’s point of view.
● Technical Requirements
○ More detailed and often system-oriented; include design constraints, technologies, etc.
Categories of Customer Requirements
● Functional Requirements :
○ Example : The system shall allow users to log in using a username and password.
● Non-functional Requirements:
● Examples:
○ The system shall allow users to log in with a username and password.
1. Operation mode 1
2. Operation mode 2
● Example:
○ The system shall respond to user input within 2 seconds under normal load.
Example: Search book availability in
library
Functional vs Non-Functional
Requirements
Non-Functional
Aspect Functional Requirement
Requirement
Describes what the Describes how the
Definition system should do system performs (quality
(functions, features) attributes)
Performance, reliability,
Focus Behavior of the system
usability, etc.
- Login feature - Generate - System should load
Examples reports - Payment within 2 seconds - Should
process support 1000 users
Measured via
Easily testable with inputs
Testability performance, usability
and outputs
tests
Developers, testers,
Mostly developers,
Stakeholder Interest architects, users,
testers
managers
Requirements Analysis
• After collecting requirements, the analyst carefully examines them to
understand the exact needs of the customer.
• The gathered data may contain:
– Contradictions
– Ambiguities
– Incomplete information
• This happens because stakeholders usually have only a partial view of the
system.
• The analyst must identify and resolve all issues by conducting further
discussions with the stakeholders.
● Requirement Analysis is the process of
understanding, refining, and modeling user and
system requirements after they have been elicited.
Principle Explanation
● Modeling tools:
○ State diagrams
○ UML models
Requirements Modeling
• The SRS contains all user requirements in a structured but informal format.
• The difficulty lies in addressing the needs of a diverse audience who will
use the document differently.
Users of SRS Document
• Users, customers, and marketing personnel
• Software developers
• Test engineers
• User documentation writers
• Project managers
• Maintenance engineers
Importance of SRS
• Forms an agreement between the customers and the developers
• Reduces future reworks
• Provides a basis for estimating costs and schedules
• Provides a baseline for validation and verification
• Facilitates future extensions
Characteristics of a Good SRS
Document
• Concise
• Implementation-independent
• Traceable
• Modifiable
• Identification of response to undesired events
• Verifiable
Structure of SRS (Software
Requirements Specification)
1. Introduction 3. System Features &
○ 1.1 Purpose Requirements
○ 1.2 Intended Audience – 3.1 Functional
○ 1.3 Scope Requirements
○ 1.4 Definition – 3.2 Use Cases / Sequence
○ 1.5 References Diagrams
2. Overall Description – 3.3 External Interface
○ 2.1 User Interface
Requirements
○ 2.2 System Interface – 3.4 Database
Requirements
○ 2.3 Software & Hardware
Requirements – 3.5 Non-Functional
Requirements
○ 2.4 Constraints
4. Deliver for Approval
○ 2.5 User Characteristics
Requirement Validation
Real-Life Example
An Online Shopping System can be divided into:
● User Management Module
● Product Management Module
● Shopping Cart Module
● Payment Module
● Order Management Module
Each module performs its own task independently while collaborating to complete the
shopping process.
Abstraction
It focuses on what the system does rather than how it does it.
Purpose
Real-Life Example
An ATM Machine allows customers to withdraw cash without exposing the internal
banking processes.
Types of Abstraction
1. Data Abstraction
Example
A BankAccount class provides methods like:
● Deposit()
● Withdraw()
● CheckBalance()
The user need not know how the balance is stored internally.
2. Procedural Abstraction
Example
Calling the function:
PrintReport()
The user does not need to know how the report is generated.
Coupling and Cohesion
● Coupling
○ Coupling refers to the degree of interdependence between software modules.
○ High coupling means that modules are closely connected and changes in one module may
affect other modules.
○ Low coupling means that modules are independent, and changes in one module have little
impact on other modules.
● Cohesion
○ Cohesion refers to the degree to which elements within a module work together to fulfill a
single, well-defined purpose.
○ High cohesion means that elements are closely related and focused on a single purpose,
while low cohesion means that elements are loosely related and serve multiple purposes.
● Both coupling and cohesion are important factors in determining the
maintainability, scalability, and reliability of a software system.
● High coupling and low cohesion can make a system difficult to change and
test, while low coupling and high cohesion make a system easier to maintain
and improve.
Types of Coupling
1. Data Coupling Modules communicate by passing only the required Customer Billing System
data as parameters. This is the best and most passing customer ID and bill
desirable form of coupling. amount.
2. Stamp Coupling A complete data structure is passed even though Passing an entire
(Data-Structured only part of it is needed, leading to unnecessary Employee object when only
Coupling) dependency. the employee ID is required.
3. Control Coupling One module passes control information (flags or A sorting function receiving
commands) that determines the behavior of another a flag to sort in ascending or
module. descending order.
4. External Coupling Modules depend on external systems, devices, file Reading data from an
formats, communication protocols, or hardware. external database or printer.
5. Common Coupling Multiple modules share the same global data or Several modules accessing
global variables. Changes to shared data affect all the same global
dependent modules. configuration variable.
Type of Coupling Brief Description Example
6. Content Coupling One module directly accesses or modifies the A module directly modifying
internal data or logic of another module. This is the another module's private
worst form of coupling and should be avoided. variables.
7. Temporal Modules depend on the order or timing of execution. A database connection must
Coupling One module must execute before another. be established before
executing SQL queries.
8. Sequential The output of one module becomes the input of Output of a data validation
Coupling another, creating a sequence of dependencies. module passed to a report
generation module.
10. Functional One module depends on the functionality of another Payment module calling the
Coupling by calling its methods or functions. If excessive, it Tax Calculation module.
leads to tight dependency.
Type of Coupling Brief Description Example
12. Interaction Methods of one class invoke methods of another Order class calling methods
Coupling class. Lower interaction through well-defined of the Payment class.
interfaces is preferred.
13. Component One class depends on another by using it as an Student class containing an
Coupling object, method parameter, or local variable. object of the Course class.
Common in object-oriented programming.
Types of Cohesion
1. Functional Cohesion All elements of a module contribute to A Login module that only
one well-defined task. This is the best authenticates users.
and most desirable type of cohesion.
2. Sequential Cohesion The output of one part of a module Read data → Validate data →
becomes the input of the next part, Process data.
creating a sequence of operations.
3. Communicational Elements work on the same input data Updating a student record and
Cohesion or produce the same output data. printing the updated record.
4. Procedural Cohesion Elements are grouped because they Calculate GPA → Print Result →
follow a specific sequence of execution, Update Record.
even though they may perform different
tasks.
5. Temporal Cohesion Elements are grouped because they are System startup module that initializes
executed at the same time or during the memory, loads configuration, and
same phase. establishes database connections.
Type of Cohesion Brief Description Example
1. Functional All elements of a module contribute to one A Login module that only
Cohesion well-defined task. This is the best and most authenticates users.
desirable type of cohesion.
6. Logical Cohesion Elements perform similar kinds of A single input module that reads data
operations, but the specific operation is from keyboard, file, or network based
selected using a control flag or parameter. on a user option.
7. Coincidental Unrelated tasks are grouped together in one A module that prints reports,
Cohesion module without any meaningful relationship. calculates salary, and sends emails.
This is the worst form of cohesion.
8. Informational A module contains multiple operations that A BankAccount class with methods
Cohesion work on the same data structure or object, like deposit(), withdraw(), and
each with its own entry point. Common in checkBalance().
object-oriented systems.
9. Layer Cohesion Elements are grouped according to their A Presentation layer handling only
responsibility within a specific architectural user interface functions.
layer.
Layered Architecture
Typical Layers
Examples
● Login page
● Registration page
● Dashboard
● Mobile app screens
2. Business Logic Layer (Application Layer)
Responsibilities
Examples
Responsibilities
Examples
● MySQL
● Oracle
● PostgreSQL
● SQL Server
Working of Layered Architecture
Example: In an e-commerce application, the Model manages product data, the View
displays product information to users, and the Controller handles actions such as
searching products or placing orders.
Components of MVC
1. Model
The Model represents the data and business logic of the application.
Responsibilities
Example
● Product details
● Customer information
● Order records
● Inventory data
2. View
The View is the user interface (UI) of the application.
Responsibilities
Example
● Login page
● Product catalog page
● Shopping cart page
● Order summary page
3. Controller
The Controller acts as an intermediary between the Model and the View.
Responsibilities
Example
Client-Server Architecture is a software architecture style in which the system is divided into
two main components: the Client, which requests services, and the Server, which processes
those requests and provides the required services or resources.
The client and server communicate over a network using communication protocols such as
HTTP, HTTPS, FTP, or TCP/IP.
Components of Client–Server Architecture
1. Client
The Client is the front-end application or device used by the user to request
services from the server.
Responsibilities
Examples
Responsibilities
Examples
● Web Server
● Database Server
● File Server
● Mail Server