SE Module 2 Notes
SE Module 2 Notes
• The goal of the requirements analysis and specification phase is to clearly understand
the customer requirements and to systematically organise the requirements into a
document called the Software Requirements Specification (SRS) document.
• Its usually carried out by a few experienced members of the development team.
• The engineers who gather and analyse customer requirements and then write the SRS
document are called as system analysts.
• The SRS document is the final outcome of the requirements analysis and specification
phase.
• Requirement analysis and specification mainly involves carrying out the following
two important activities:
– Requirements gathering and analysis
– Requirements specification
The complete set of requirements is rarely available in the form of a single document from
the customer. The requirements have to be gathered by the analyst from several sources in
bits and pieces which are then analysed to remove several types of problems and
inconsistencies.
Requirements gathering
Requirements analysis
Requirements Gathering
Requirements Analysis
After requirements gathering is complete, the analyst analyses the gathered requirements to
form a clear understanding of the exact customer requirements and to weed out any problems
in the gathered requirements.
The main purpose of the requirements analysis activity is to analyse the gathered
requirements to remove all ambiguities, incompleteness, and inconsistencies from the
gathered customer requirements and to obtain a clear understanding of the software to be
developed.
During requirements analysis, the analyst needs to identify and resolve three main types of
problems in the requirements:
Anomaly
Inconsistency
Incompleteness
Anomaly:
An anomaly is an ambiguity in a requirement. When a requirement is anomalous, several
interpretations of that requirement are possible.
Inconsistency:
Two requirements are said to be inconsistent, if one of the requirements contradicts the other.
Incompleteness:
An incomplete set of requirements is one in which some requirements have been overlooked.
The lack of these features would be felt by the customer much later, possibly while using the
software.
The SRS document usually contains all the user requirements in a structured though an
informal form. The production of the requirements stage of the software development process
is Software Requirements Specifications (SRS) (also called a requirements document).
This report lays a foundation for software engineering activities and is constructing when
entire requirements are elicited and analyzed. SRS is a formal report, which acts as a
representation of software that enables the customers to review whether it (SRS) is according
to their requirements.
1. Correctness:
User review is used to provide the accuracy of requirements stated in the SRS. SRS is said to
be perfect if it covers all the needs that are truly expected from the system.
2. Completeness:
The SRS is complete if, and only if, it includes the following elements:
I. All essential requirements, whether relating to functionality, performance, design.
II. Definition of their responses of the software
III. Full labels and references to all figures, tables, and diagrams
3. Consistency:
The SRS is consistent if, and only if, no subset of individual requirements described in its
conflict. Example: One condition may state that all lights shall be green while another states
that all lights shall be blue.
4. Unambiguousness:
SRS is unambiguous when every fixed requirement has only one interpretation.
The SRS is ranked for importance and stability if each requirement in it has an identifier to
indicate either the significance or stability of that particular requirement. Typically, all
requirements are not equally important. Some prerequisites may be essential, especially for
life-critical applications, while others may be desirable.
6. Modifiability:
SRS should be made as modifiable as likely and should be capable of quickly obtain changes
to the system.
7. Verifiability:
SRS is correct when the specified requirements can be verified with a cost-effective system to
check whether the final software meets those requirements.
8. Traceability:
The SRS is traceable if the origin of each of the requirements is clear and if it facilitates the
referencing of each condition in future development or enhancement documentation.
9. Design Independence:
There should be an option to select from multiple design alternatives for the final system.
More specifically, the SRS should not contain any implementation details.
10. Testability:
An SRS should be written in such a method that it is simple to generate test cases and test
plans from the report.
An end user may be an expert in his/her explicit domain but might not be trained in computer
science. The language should be kept simple and clear.
If the SRS is written for the requirements stage, the details should be explained explicitly.
Over-specification:
It occurs when the analyst tries to address the “how to” aspects in the SRS document. For
example, in the library automation problem, one should not specify whether the library
membership records need to be stored indexed on the member’s first name or on the library
member’s identification (ID) number.
Forward references:
One should not refer to aspects that are discussed much later in the SRS document. Forward
referencing seriously reduces readability of the specification.
Wishful thinking:
This type of problems concern description of aspects which would be difficult to implement.
Noise:
The term noise refers to presence of material not directly relevant to the software
development process.
A Software Requirements Specification (SRS) is a formal document that describes all the
requirements of a software system in a structured manner.
The standard SRS format is generally divided into the following sections:
1. Introduction
This section gives a basic overview of the system and the document.
• Scope: Defines what the software system will do and its objectives.
2. Overall Description
Includes:
• Product Perspective
• Product Functions
• User Characteristics
3. Specific Requirements
a) Functional Requirements
Example:
User login
Online payment
Report generation
b) Non-Functional Requirements
Example:
Security
Reliability
Performance
Speed
Includes:
User Interface
Hardware Interface
Software Interface
Communication Interface
4. Other Requirements
Examples:
Database requirements
Safety requirements
Business rules
5. Appendices
Includes:
Glossary
Additional documents
References
Formal methods are also applied in medical systems such as patient monitoring
devices, heart monitors, and medical equipment software. These systems require
very high reliability because software errors may affect patient safety. Formal
specifications help reduce risks and improve accuracy.
In railway and traffic control systems, formal specification methods are used for
train signaling systems and traffic management systems. These methods help
ensure proper synchronization and avoid dangerous failures or collisions.
Security-critical systems such as authentication software, cryptographic
applications, and defense systems also use formal specifications. They help in
detecting vulnerabilities early and ensure that the system behaves correctly under
all conditions.
Formal methods are additionally used in communication protocols and distributed
systems to verify data transmission and communication correctness. They are also
useful in embedded systems such as automobiles and industrial control systems
where hardware and software work together closely.
1. Difficult to Understand
Formal specifications use mathematical symbols, logic, and notations that are hard for
ordinary users and non-technical stakeholders to understand. Only trained professionals with
knowledge of formal methods can easily read and write them.
2. Time-Consuming
Formal methods require skilled experts, specialized training, and sometimes expensive tools.
Because of this, the initial development cost becomes high.
Customers and end users may not understand mathematical specifications easily. This creates
communication difficulties between developers and users during requirement discussions.
5. Not Suitable for All Projects
Formal specification methods are mainly useful for safety-critical and high-reliability
systems. For small, simple, or low-budget projects, using formal methods may be
unnecessary and impractical.
Block Diagram
Based on the current inputs as well as states, this machine can produce outputs. Thus, the
outputs can be suitable only at positive otherwise negative of the CLK signal. The mealy state
machine’s state diagram is shown below.
Generally, the amount of required states in the mealy machine is below or equivalent to the
number of required states in Moore state machine. There is an equal Moore state machine for
every Mealy state machine. As a result, based on the necessity we can employ one of them.
The Moore state machine state diagram is shown below. In the above state, the diagram
includes four states like a mealy state machine namely A, B, C, and D. the four states as well
as individual outputs are placed in the circles.
Generally, the amount of required states in this machine is greater than otherwise equivalent
to the required number of states in the mealy state machine
Generally, the number of required states in this machine is more than otherwise equivalent to
the required states in MSM (Mealy state machine). For every Moore state machine, there is
a corresponding Mealy state machine. Consequently, depending on the necessity we can
utilize one of them.
There is an equal mealy state machine for every Moore state machine. As a result, based on
the necessity we can employ one of them.
The finite state machines are applicable in vending machines, video games, traffic
lights, controllers in CPU, text parsing, analysis of protocol, recognition of speech, language
processing, etc.
Advantages of Finite State Machine
The advantages of Finite State Machine include the following.
Finite state machines are flexible
Easy to move from a significant abstract to a code execution
Low processor overhead
Easy determination of reachability of a state
Disadvantages of Finite State Machine
The disadvantages of the finite state machine include the following
The expected character of deterministic finite state machines can be not needed in some
areas like computer games
The implementation of huge systems using FSM is hard for managing without any idea of
design.
Not applicable for all domains
The orders of state conversions are inflexible.
Petri nets
• Petri net are a mathematical and graphical modeling tool used to represent systems
that involve concurrent, parallel, and synchronized activities.
• Components of petri nets
• Use cases: Use cases are like scenes in the play. They represent specific things your
system can do.
Relationships
1. Association Relationship
The Include Relationship indicates that a use case includes the functionality of another use
case. It is denoted by a dashed arrow pointing from the including use case to the included use
case. This relationship promotes modular and reusable design.
Example: Social Media Posting
Use Cases: Compose Post, Add Image
Include Relationship: The "Compose Post" use case includes the functionality of "Add
Image." Therefore, composing a post includes the action of adding an image.
3. Extend Relationship
The Extend Relationship illustrates that a use case can be extended by another use case under
specific conditions. It is represented by a dashed arrow with the keyword "extend." This
relationship is useful for handling optional or exceptional behavior.
Example: Flight Booking System
Use Cases: Book Flight, Select Seat
Extend Relationship: The "Select Seat" use case may extend the "Book Flight" use case
when the user wants to choose a specific seat, but it is an optional step.
4. Generalization Relationship
The Generalization Relationship establishes an "is-a" connection between two use cases,
indicating that one use case is a specialized version of another. It is represented by an arrow
pointing from the specialized use case to the general use case.
Example: Vehicle Rental System
Use Cases: Rent Car, Rent Bike
Generalization Relationship: Both "Rent Car" and "Rent Bike" are specialized versions
of the general use case "Rent Vehicle."
Class Diagram
• A UML class diagram shows the structure of a system by displaying its classes, their
attributes, methods, and the relationships between them.
• It helps the team understand how the system is organized and how components
interact.
– Represents classes, attributes, methods, and relationships
– Helps communicate and document the software structure
– Makes it easier for developers and designers to understand the system
Notations
• Class Name: The name of the class is typically written in the top compartment of the
class box and is centered and bold.
• Attributes: Attributes, also known as properties or fields, represent the data members
of the class.
• Methods: Methods, also known as functions or operations, represent the behavior or
functionality of the class.
• Visibility Notation: It indicate the access level of attributes and methods. Common
visibility notations include:
– + for public (visible to all classes)
– - for private (visible only within the class)
– # for protected (visible to subclasses)
Relationships
• Inheritance (or Generalization):
– Represents an "is-a" relationship.
– SubClass1 and SubClass2 are specializations of Super Class.
– A solid line with a hollow arrowhead that point from the child to the parent
class
• Simple Association:
– A structural link between two peer classes.
– There is an association between Class1 and Class2
– A solid line connecting two classes
• Aggregetion:
– It represents a "part of" relationship.
– Class2 is part of Class1.
– Many instances (denoted by the *) of Class2 can be associated with Class1.
– Objects of Class1 and Class2 have separate lifetimes.
– A solid line with an unfilled diamond at the association end connected to the
class of composite
• Composition:
– Objects of Class2 live and die with Class1.
– Class2 cannot stand by itself.
– A solid line with a filled diamond at the association connected to the class of
composite.
• Dependency:
– Exists between two classes if the changes to the definition of one may cause
changes to the other (but not the other way around).
– Class1 depends on Class2
– A dashed line with an open arrow
Purpose
• This is the only UML that can appropriately depict various aspects of the OOPs
concept.
• Proper design and analysis of applications can be faster and efficient.
• It is the base for deployment and component diagram.
• Class diagrams serve as a visual tool for communication among team members and
stakeholders, bridging gaps between technical and non-technical audiences.
Interaction Diagram
A UML Interaction Diagram is a type of behavioural diagram used to visualize how objects in
a system interact through the exchange of messages. It focuses on the dynamic behaviour of a
system by showing what happens, when it happens, and which components
communicate during a specific process or use case. Interaction diagrams capture the
“conversation” between objects, helping designers and developers understand how parts of a
system collaborate to achieve a goal.
1. Communication Diagram
A Communication Diagram depicts the relationships and interactions among software objects
in a system. It focuses on the structural connections between objects rather than the timing or
sequence of messages. This makes it ideal for understanding how system components are
linked and how they collaborate to complete a task.
Components:
• Objects: Objects are described as rectangles with the name of the object on them.
They are the very subjects that perform actions with regard to each other.
• Links: Several straight lines depict the association and transmission of information
between various items.
• Messages: Arrows are to be placed on the link to show the direction of the
communication, often accompanied by the message name and sequence number.
• Interaction Occurrences: Such may refer to situations or cases where certain social
interactions are done.
Advantages:
2. Sequence Diagram
A Sequence Diagram illustrates how messages are exchanged between objects over time. It
provides a clear, chronological view of how operations occur within a specific process or use
case. Each object involved has a lifeline, and messages are arranged vertically in order of
occurrence. Sequence diagrams are especially useful for system modeling, debugging, and
documentation of workflows.
Notations:
• Actors: Represents a type of role where it interacts with the system and its objects.
• Return Message: Return message is a kind of message that represents the pass of
information back to the caller of a corresponded former message.
• Self Message: Self message is a kind of message that represents the invocation of
message of the same lifeline.
• Destroy Message: Destroy message is a kind of message that represents the request
of destroying the lifecycle of target lifeline.
• Duration Message: Duration message shows the distance between two time instants
for a message invocation.
Advantages:
Can become cluttered when too many lifelines or branches are added.
Accuracy depends on the correct sequencing of interactions.
Harder to interpret in highly complex scenarios.
With Creately’s Sequence Diagram Tool, you can quickly visualize interactions, define
message flows, and refine system logic.
3. Timing Diagram
A Timing Diagram focuses on changes in object states over time, often represented using
waveforms. It helps model time-sensitive behavior, showing how an object transitions
between states at specific moments. This type of diagram is crucial for analyzing real-time
systems, embedded processes, or any situation where timing and synchronization are critical.
Advantages:
Advantages:
Offers a clear, top-level view of activities across diagrams.
Allows navigation between multiple interaction diagrams easily.
Combines activity diagram features with added interaction elements for clarity.
Limitations:
Activity Diagrams
• It helps visualize workflows, processes, or activities within a system.
• They depict how different actions are connected and how a system moves from one
state to another.
• They display the order in which activities happen and whether they occur one after the
other (sequential) or at the same time (concurrent).
Notations:
• Initial State
– Representation: Solid filled circle.
– Purpose: Represents the start state of the system.
– Usage: Marks the beginning of the activity flow.
• Final State
– Representation: Circle with a solid filled circle inside.
– Purpose: Represents the termination state of the system.
– Usage: Indicates the end of the activity flow.
• Action State
– Representation: Rectangle with rounded corners.
– Purpose: Represents an operation, business activity, or process.
– Usage: Shows the actions or activities performed within the system.
• Decision
– Representation: Diamond shape with one incoming and multiple outgoing
transitions, each labeled with a guard condition.
– Purpose: Has one input and two or more outputs depending on the condition.
– Usage: Directs the flow based on specific conditions.
• Synchronization
• Fork:
– Representation: Horizontal or vertical bar with one incoming transition and
two or more outgoing transitions.
– Purpose: Divides a single activity flow into two or more concurrent activities.
– Usage: Used when multiple activities need to occur simultaneously.
• Join:
– Representation: Horizontal or vertical bar with two or more incoming
transitions and one outgoing transition.
– Purpose: Combines two or more concurrent activities into a single flow.
– Usage: Ensures that only one of the activities proceeds at a time.
• Merge
– Representation: Diamond shape with multiple incoming transitions and one
outgoing transition.
– Purpose: Merges input flows without synchronization.
– Usage: Allows the flow to proceed without waiting for other inputs.
• Activity Partition (Swimlane)
– Representation: Vertical or horizontal lanes.
– Purpose: Visually groups actions or activities based on the organizational unit
or actor responsible for them.
– Usage: Organizes activities by responsibility or role.
• Transition
– Representation: Directed arrows connecting activity states, initial states, final
states, decision nodes, merge nodes, fork nodes, and join nodes.
– Purpose: Represents movement from the source activity state to the target
activity state.
– Usage: Shows the flow of control between activities.
Order transaction
State Machine Diagrams
• A State Machine Diagram is used to represent the condition of the system or part of
the system at finite instances of time.
• A state machine diagram example for user verification:
Notation:
• Initial state: We use a black filled circle represent the initial state of a System or a
Class.
• Transition: We use a solid arrow to represent the transition or change of control from
one state to another. The arrow is labelled with the event which causes the change in
state.
• Fork: We use the fork notation to represent a state splitting into two or more
concurrent states.
• Join: We use the join notation when two or more states concurrently converge into
one on the occurrence of an event or events.
• Self 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.
• Composite state: We represent a state with internal activities using a composite state.
• Final State: We use a filled circle within a circle notation to represent the final state
in a state machine diagram.
Functional Modeling
• Functional modeling is the process of representing the functions and data flow of a
software system.
• Purpose
– Understand system functionality
– Describe processing of data
– Analyze system operations before development
• Common Tools Used in Functional Modeling
– Data flow diagram (DFD)
– UML diagrams
1. External Entity
The external entity is the object outside the system that interacts with the system by providing
input data or receiving output data. These external entities are also known as sources or sinks.
The important things that you should keep in mind about the external entities are:
The external entity is represented by the rectangles in a data flow diagram (DFD).
It initiates data flow into the system or receives the information from it.
The process is the function that changes the input data into the output data in the system.
The important things that you should keep in mind about the processes are:
A process is represented by the circles or rounded rectangles in the data flow diagram.
Every process must have at least one input and one output data flow.
Always use the verb-noun format to write the name of the function.
Also, the high-level processes can be decomposed or broken down into sub-processes for
more detail in lower DFD levels.
Example: In a library system, a process like “Issue Book” would take data from a user and
then update the records in the data store.
3. Data Store
Data store represents the places where the data is stored for processing when it is needed. It
can be databases, files, or any form of data storage.
The important things that you should keep in mind about the data stores are:
A data store is represented by an open-ended rectangle or sometimes two parallel
horizontal lines in the data flow diagram.
The data stores allow the data to be stored and retrieved by the processes when it is
needed.
Only processes can read from and write to data stores, and the external entities do not
directly access them.
Arrows are used to show the data flow to a data store. An arrow to a data store means data
is being written, and an arrow from a data store means data is being retrieved.
Example: In a hospital management system, a data store like “Patient Records” stores the
patient details for use in various treatment processes.
4. Data Flow
A data flow shows the movement of data between the external entities, processes, and data
stores within the system.
The important things that you should keep in mind about the data flows are:
The data flow is represented by the arrows labeled with the name of the data being moved.
The direction of the arrows shows the flow of the data from the source to the destination.
Data flows link processes, external entities, and data stores together to show the
interactions between them.
Always use noun-based labels that describe the data content for the naming of the data
flow.
Example: In an ATM system, a data flow labeled “PIN Entry” might go from the “User” to
the “Validate PIN” process.
Here are a few rules that you must follow while creating a data flow diagram:
Every process must have at least one input and one output in a data flow diagram.
The external entities cannot exchange data directly with each other; thus, data must pass
through a process.
Data stores must connect only to processes, not directly to other data stores or entities.
Do not include the control flow or decision logic; only focus on the data movement.
Maintain the consistency between DFD levels, so that the data flows match them.
A DFD at the 0-level is also known as the context diagram. It represents the entire system as
a single process. The diagram at this level shows the interaction of the system with the
external entities. A 0-level DFD shows all the input and output data flows between the system
and the external entities. At this level, no data stores are included in the data flow diagram. It
provides a high-level overview of the system without going into the internal processes. Also,
it helps the stakeholders to understand the system boundaries and data exchanges by viewing
it once.
The three main components in this data flow diagram (DFD) are;
External Entities:
o Customer
o Bank
Single Process:
o Online Bookstore System
Data Flows:
o From Customer to System: Order Details, Payment Info
1-Level DFD
A 1-level data flow diagram breaks down the single process from the context diagram into
multiple sub-processes. This diagram shows how the data moves between internal processes,
data stores, and external entities. It includes data stores that were not present in the context
diagram. At this level, each process is labeled and represents a specific function or operation
within the system in the data flow diagram. It shows the detailed data flows of connecting
sub-processes, data stores, and external entities. It provides a better understanding of how the
particular function works within the system. The data flow diagram at this level helps the
analysts to identify the key processes and how they interact with data inputs and outputs.
This level breaks down the main process (from Level 0) into sub-processes for more detail.
Processes:
1.0 Browse/Search Books
Bank
2-Level DFD
A level 2 data flow diagram is a diagram that is further decomposed into one or more
processes from the level 1 DFD into more detailed sub-processes. This DFD provides a more
detailed and granular view of how data flows within a specific part of the system. It maintains
the same data stores and external entities from level 1, where the data seems relevant.
In a 2-level DFD, each sub-process is labeled hierarchically, such as 1.1, 1.2, etc. This data
flow diagram shows the additional data flows between the new sub-processes and the existing
data stores or entities. It highlights the internal logic and functions that make up the single-
level process. The 2-level DFD helps the developers and system designers to understand
exactly how the individual components behave and interact.
At Level 2, we decompose Process 2.0 “Place Order” from the Level 1 DFD into more
detailed sub-processes.
Processes:
2.1 Validate Book Availability
Data Stores:
D1: Book Inventory
External Entities:
Customer
Bank
2. A DFD makes it easier to identify the system boundaries, sources, sinks, and data stores.
3. One of the most helpful aspects of the data flow diagram is that it forms a bridge between
the technologists and the non-technologists.
4. The DFD is very helpful in gathering the requirements and in the analysis of the system,
because it makes the processes much more understandable since they are looked at in
smaller pieces.
5. The DFD helps to find the redundancies, inefficiencies, or missing processes in the design,
and it provides this capability early in the design process.
6. The data flow diagram essentially keeps the design modular by breaking the system into
smaller sub-processes.
7. The DFD is useful for documentation or as a reference as you move through the system
development life cycle.
Disadvantages of Data Flow Diagram (DFD)
1. A DFD can become more complex and difficult to manage for large systems with many
processes.
4. A data flow diagram lacks the ability to represent the conditions, loops, or decision logic
clearly.