Se Unit-Ii
Se Unit-Ii
Requirement Engineering
The process to gather the software requirements from client, analyse, and document them is known
as requirement engineering.
The goal of requirement engineering is to develop and maintain sophisticated and descriptive
‘System Requirements Specification’ document.
Software Requirements analysis and specification
The software requirements are description of features and functionalities of the target system.
Requirements convey the expectations of users from the software product.
The requirements can be obvious or hidden, known or unknown, expected or unexpected from
client’s point of view
It is divided into two main parts:
1.Software Requirements Analysis: The process of identifying,
analyzing, and defining the system's requirements
2.Software Requirements Specification (SRS):
The formal document that outlines the system’s
requirements in detail
Software Requirements Analysis is the phase where the needs of the stakeholders are
gathered, understood, and documented. The primary goal of this phase is to ensure that
all aspects of the system, both functional and non-functional, are captured accurately
and comprehensively.
1. Requirement Elicitation:
o The process of gathering requirements from various stakeholders,
including users, clients, business analysts, and other subject matter
experts.
o Methods used:
Interviews: Direct discussions with stakeholders to understand their
needs and expectations.
Surveys/Questionnaires: Collecting feedback from users or a large
group of stakeholders.
Workshops: Collaborative group discussions to extract requirements.
Document Analysis: Reviewing existing system documentation or
business process documents.
Prototyping: Developing a preliminary version of the system to gather
feedback.
2. Requirement Classification:
o Once gathered, the requirements are classified into two broad categories:
Functional Requirements: Define the specific behaviors or
functions of the system (e.g., "The system should allow users to
register and log in").
Non-Functional Requirements: Specify the qualities or attributes
the system must have (e.g., performance, security, reliability,
scalability, and usability).
3. Requirement Prioritization:
o This involves prioritizing the requirements to determine which ones are most
important and should be developed first. Prioritization techniques include:
MoSCoW (Must have, Should have, Could have, Won't have).
Kano Model (Basic, Performance, Excitement factors).
4. Requirement Validation:
o Ensuring that the requirements are realistic, feasible, and meet the needs
of the stakeholders.
o This step often involves reviewing the requirements with stakeholders to
ensure they are correctly understood and feasible within project constraints
(e.g., budget, timeline, technology).
5. Feasibility Analysis:
o Assessing the feasibility of the requirements in terms of technical,
operational, and financial constraints.
o This involves analyzing whether the requirements can be implemented
with the available resources and technologies.
1. Introduction:
o Purpose: The purpose of the software, its intended audience, and the
scope of the project.
o Scope: A high-level overview of the system, describing the boundaries of the
system and what will and will not be included.
o Definitions, Acronyms, and Abbreviations: Any terms, acronyms, or
abbreviations used in the document to ensure clarity.
2. System Overview:
o A general description of the system’s purpose, context, and high-level
features. This section typically provides background information on the
problem the software is solving.
3. Functional Requirements:
o Detailed descriptions of the functionalities the system must have. Each
functional requirement should define a specific behavior or interaction.
o For example:
"The system shall allow the user to reset their password via email."
"The system shall generate monthly reports for administrators."
4. Non-Functional Requirements:
o These are the quality attributes of the system that specify how the system
should perform.
o Key non-functional requirements include:
Performance: E.g., "The system must process 1000 transactions per
second."
Security: E.g., "The system shall use AES-256 encryption for all sensitive
data."
Usability: E.g., "The system shall have an intuitive user interface
that can be learned in 1 hour."
Reliability: E.g., "The system shall be available 99.9% of the time."
5. External Interface Requirements:
o Describes how the system will interact with external systems, hardware, or
software components. This includes user interfaces, hardware interfaces,
software interfaces, and communication protocols.
o For example:
User Interface: The layout and design of screens and inputs.
Hardware Interface: Describing how the system will interface with
hardware (e.g., printers, sensors).
Software Interface: Interfaces with other software applications or
systems (e.g., database systems, third-party APIs).
6. System Features:
o A detailed list of all the features that the system will provide, organized in a
structured manner, often with corresponding functional requirements.
o Each feature description typically includes the expected inputs, processing, and
outputs, as well as any specific behaviors or constraints.
7. Assumptions and Constraints:
o Any assumptions made during the requirements gathering process or constraints
on the
system’s design or implementation.
o For example:
"The system will be developed in Java."
"The system must be able to run on a Windows environment."
8. Acceptance Criteria:
o The specific conditions or tests that must be met for the system to be accepted
by the client. This section is crucial for validating the software's functionality
and performance during the testing phase.
9. Appendices:
o Additional information, such as diagrams, prototypes, or examples, that might
be useful for understanding the requirements.
USE CASES AND SCENARIOS
A use case diagram is used to represent the dynamic behavior of a system.
It encapsulates the system's functionality by incorporating use cases, actors, and their
relationships.
It models the tasks, services, and functions required by a system/subsystem of an
application.
It depicts the high-level functionality of a system and also tells how the user handles a
system.
Purpose of Use Case Diagrams
1. The main purpose of a use case diagram is to portray the dynamic aspect of a
system.
2. It accumulates the system's requirement, which includes both internal as well as
external influences.
3. It invokes persons, use cases, and several things that invoke the actors and
elements accountable for the implementation of use case diagrams.
4. It represents how an entity from the external environment can interact with a part
of the system.
Following are the purposes of a use case diagram given below:
1. It gathers the system's needs.
2. It depicts the external view of the system.
3. It recognizes the internal as well as external factors that influence the system.
4. It represents the interaction between the actors.
How to draw a Use Case diagram
1. It is essential to analyse the whole system before starting with drawing a use case diagram, and
then the system's functionalities are found.
2. And once every single functionality is identified, they are then transformed into the use cases to
be used in the use case diagram
3. .After that, we will enlist the actors that will interact with the system.
4. The actors are the person or a thing that invokes the functionality of a system.
5. It may be a system or a private entity, such that it requires an entity to be pertinent to the
functionalities of the system to which it is going to interact
6. .Once both the actors and use cases are enlisted, the relation between the actor and use case/ system
is inspected.
7. It identifies the no of times an actor communicates with the system.
8. Basically, an actor can interact multiple times with a use case or system at a particular instance of
time.
Following are some rules that must be followed while drawing a use case diagram:
1. A pertinent and meaningful name should be assigned to the actor or a use case of a system.
2. The communication of an actor with a use case must be defined in an understandable way.
3. Specified notations to be used as and when required.
4. The most significant interactions should be represented among the multiple no of interactions
between the use case and actors.
Examples of use case
1)
2)
OBJECT-ORIENTED ANALYSIS AND DESIGN (OOAD)
Object-Oriented Analysis and Design (OOAD) is a way to design software by thinking of
everything as objects similar to real-life things.
we first understand what the system needs to do, then identify key objects, and finally decide how
these objects will work together.
This approach helps make software easier to manage, reuse, and grow.
OOAD is based on the concepts of object-oriented programming (OOP) and is an organized and
systematic approach to designing and developing software systems.
It is a software engineering paradigm that integrates two distinct but closely related processes:
Object-Oriented Analysis (OOA) and Object-Oriented Design (OOD).
Important Aspects of OOAD
Below are some important aspects of OOAD:
1. Object-Oriented Programming: In this the real-world items are represented/mapped as software
objects with attributes and methods that relate to their actions.
2. Design Patterns: Design patterns are used by OOAD to help developers in building software
systems that are more efficient and maintainable.
3. UML Diagrams: UML diagrams are used in OOAD to represent the different components and
interactions of a software system.
4. Use Cases: OOAD uses use cases to help developers understand the requirements of a system and
to design software systems that meet those requirements.
Object-Oriented Analysis
Object-Oriented Analysis (OOA) is the process of understanding and analyzing the system
requirements by looking at the problem scenario in terms of objects.
These objects represent real-world entities or concepts that are relevant to the system being
developed.
During OOA, the goal is to identify the objects, their attributes, behaviors, and relationships,
without focusing on how the system will be implemented.
For example: Lets say you’re building a game:
OOA helps you figure out all the things you need to know about the game world – the characters,
their features, and how they interact.
It’s like making a map of everything important.
OOA also helps you understand what your game characters will do. It’s like writing down a script
for each character.
Every program has specific tasks or jobs it needs to do. OOA helps you list and describe these jobs.
In our game, it could be tasks like moving characters or keeping score. It’s like making a to-do list
for your software.
OOA is smart about breaking things into different parts. It splits the job into three categories: things
your game knows, things your game does, and how things in your game behave.
Object-Oriented Design
In the object-oriented software development process, the analysis model, which is initially formed
through object-oriented analysis (OOA), undergoes a transformation during object-oriented design
(OOD) i.e implementation of the conceptual model developed in OOA.
This evolution is crucial because it shapes the analysis model into a detailed design
model.Furthermore, as part of the object-oriented design process, it is essential to define specific
aspects:
Data Organization of Attributes:
o OOD involves specifying how data attributes are organized within the objects.
o This includes determining the types of data each object will hold and how they relate to one
another.
Procedural Description of Operations:
o OOD requires a procedural description for each operation that an object can perform.
o This involves detailing the steps or processes involved in carrying out specific tasks.
Below diagram shows a design pyramid for object-oriented systems. It is having the
following four layers.
1. The Subsystem Layer: It represents the subsystem that enables software to achieve user
requirements and implement technical frameworks that meet user needs.
2. The Class and Object Layer: It represents the class hierarchies that enable the system to develop
using generalization and specialization. This layer also represents each object.
3. The Message Layer: This layer deals with how objects interact with each other. It includes
messages sent between objects, method calls, and the flow of control within the system.
4. The Responsibilities Layer: It focuses on the responsibilities of individual objects. This includes
defining the behaviour of each class, specifying what each object is responsible for, and how it
responds to messages.
DESIGN PATTERNS
Reusable solutions for typical software design challenges are known as design patterns.
Expert object-oriented software engineers use these best practices to write more structured,
manageable, and scalable code.
Design patterns provide a standard terminology and are specific to particular scenarios and
problems. Design patterns are not finished code but templates or blueprints only.
Key Characteristics of Design Patterns
Reusability: Patterns can be applied to different projects and problems, saving time and effort in
solving similar issues.
Standardization: They provide a shared language and understanding among developers, helping in
communication and collaboration.
Efficiency: By using these popular patterns, developers can avoid finding the solution to same
recurring problems, which leads to faster development.
Flexibility: Patterns are abstract solutions/templates that can be adapted to fit various scenarios and
requirements.
Why Learn Design Patterns?
There are multiple reasons to learn design patterns:
Code that is simpler to comprehend, update, and expand is produced with the help of design patterns.
They offer solutions that have been tried and tested as well as best practices.
Learning this enables them to quickly and effectively address similar challenges in various projects.
Developers can produce reusable components that can be utilized in a variety of applications by
implementing design patterns.
This reduces redundancy and saves development time.
Types of Software Design Patterns
There are three types of Design Patterns:
1. Creational Design Pattern
2. Structural Design Pattern
3. Behavioral Design Pattern
Creational Design Patterns
Creational Design Patterns focus on the process of object creation or problems related to object
creation. They help in making a system independent of how its objects are created, composed and
represented.
Relationships
In UML, relationships are of three types:
1)Dependency: A dependency is a semantic relationship between two or more classes where a
change in one class cause changes in another class. It forms a weaker relationship.
In the following example, Student_Name is dependent on the Student_Id.
SEQUENCE DIAGRAM
The sequence diagram represents the flow of messages in the system and is also termed as an
event diagram.
It helps in envisioning several dynamic scenarios.
It portrays the communication between any two lifelines as a time-ordered sequence of events,
such that these lifelines took part at the run time.
In UML, the lifeline is represented by a vertical bar, whereas the message flow is represented
by a vertical dotted line that extends across the bottom of the page.
It incorporates the iterations as well as branching.
Purpose of a Sequence Diagram
1. To model high-level interaction among active objects within a system.
2. To model interaction among objects inside a collaboration realizing a use case.
3. It either models generic interactions or some certain instances of interaction.
2)Actor
A role played by an entity that interacts with the subject is called as an actor. It is out of the scope of
the system. It represents the role, which involves human users and external hardware or subjects. An
actor may or may not represent a physical entity, but it purely depicts the role of an entity. Several
distinct roles can be played by an actor or vice versa.
3)Activation
It is represented by a thin rectangle on the lifeline. It describes that time period in which an operation
is performed by an element, such that the top and the bottom of the rectangle is associated with the
initiation and the completion time, each respectively.
4)Messages
The messages depict the interaction between the objects and are represented by arrows. They are in
the sequential order on the lifeline. The core of the sequence diagram is formed by messages and
lifelines.
Following are types of messages enlisted below:
o Call Message: It defines a particular communication between the lifelines of an interaction, which
represents that the target lifeline has invoked an operation.
o Return Message: It defines a particular communication between the lifelines of interaction that
represent the flow of information from the receiver of the corresponding caller message.
o Self Message: It describes a communication, particularly between the lifelines of an interaction that
represents a message of the same lifeline, has been invoked.
o Recursive Message: A self message sent for recursive purpose is called a recursive message. In
other words, it can be said that the recursive message is a special case of the self message as it
represents the recursive calls.
Note
A note is the capability of attaching several remarks to the element. It basically carries useful
information for the modelers.
EXAMPLE OF SEQUENCE DIGRAM
Following are the types of a state machine diagram that are given below:
1. Behavioral state machine
The behavioral state machine diagram records the behavior of an object within the system. It depicts
an implementation of a particular entity. It models the behavior of the system.
2. Protocol state machine
It captures the behavior of the protocol. The protocol state machine depicts the change in the state of
the protocol and parallel changes within the system. But it does not portray the implementation of a
particular component.
Types of State
The UML consist of three states:
1. Simple state: It does not constitute any substructure.
2. Composite state: It consists of nested states (substates), such that it does not contain more than one
initial state and one final state. It can be nested to any level.
3. Submachine state: The submachine state is semantically identical to the composite state, but it can
be reused.
1. An example of a top-level state machine diagram showing Bank Automated Teller Machine
(ATM) is given below.
2. Initially, the ATM is turned off. After the power supply is turned on, the ATM starts performing
the startup action and enters into the Self Test state.
3. If the test fails, the ATM will enter into the Out Of Service state, or it will undergo a
triggerless transition to the Idle state.
4. This is the state where the customer waits for the interaction.
5. Whenever the customer inserts the bank or credit card in the ATM's card reader, the ATM state
changes from Idle to Serving Customer, the entry action readCard is performed after
entering into Serving Customer state.
6. Since the customer can cancel the transaction at any instant, so the transition from Serving
Customer state back to the Idle state could be triggered by cancel event.
7. Here the Serving Customer is a composite state with sequential substates that are Customer
Authentication, Selecting Transaction, and Transaction.
8. Customer Authentication and Transaction are the composite states itself is displayed by a
hidden decomposition indication icon.
9. After the transaction is finished, the Serving Customer encompasses a triggerless transition
back to the Idle state.
10. On leaving the state, it undergoes the exit action ejectCard that discharges the customer card
ACTIVITY DIAGRAM
In UML, the activity diagram is used to demonstrate the flow of control within the system rather than
the implementation.
It models the concurrent and sequential activities.
The activity diagram helps in envisioning the workflow from one activity to another.
It put emphasis on the condition of flow and the order in which it occurs.
The flow can be sequential, branched, or concurrent, and to deal with such kinds of flows, the
activity diagram has come up with a fork, join, etc.
Components of an Activity Diagram
Activities
The categorization of behaviour into one or more actions is termed as an activity. In other
words, it can be said that an activity is a network of nodes that are connected by edges.
The edges depict the flow of execution.
It may contain action nodes, control nodes, or object nodes.
The control flow of activity is represented by control nodes and object nodes that illustrates
the objects used within an activity. The activities are initiated at the initial node and are
terminated at the final node.
Forks
Forks and join nodes generate the concurrent flow inside the activity.
A fork node consists of one inward edge and several outward edges..
Whenever a data is received at an inward edge, it gets copied and split crossways various
outward edges.
It split a single inward flow into multiple parallel flows.
Join Nodes
Join nodes are the opposite of fork nodes.
A Logical AND operation is performed on all of the inward edges as it synchronizes the flow
of input across one single output (outward) edge.
Pins
It is a small rectangle, which is attached to the action rectangle.
It clears out all the messy and complicated thing to manage the execution flow of activities.
It is an object node that precisely represents one input to or output from the action.
SEQUENCE DIGRAM