Module 2 - Software Requirement Analysis & Modeling

Requirement Engineering: Feasibility & Elicitation

Requirement Engineering is the process of defining, documenting and maintaining the requirements. It involves gathering and defining the services provided by the system, as well as the constraints under which it operates and is developed. A requirement mandates that something be accomplished, transformed, produced, or provided. Making design decisions without understanding all constraints results in a system that fails to meet customer expectations. Furthermore, the cost of correcting errors increases as the design process advances; an error detected in the maintenance phase is 20 times as costly to fix as an error detected in the coding stage.

Feasibility Study Elicitation & Analysis Specification Verification & Validation Requirements Management

1. Feasibility Study

Feasibility Studies aim to objectively and rationally uncover the strengths and weaknesses of the existing business or proposed venture, the opportunities and threats, the resources required, and ultimately the prospects for success. The two criteria to judge feasibility are the cost required and the value to be attained.

2. Requirements Elicitation

This is the process of discovering the requirements for a system by communicating with the customers, system users, and others who have a stake in the system development. The success of an elicitation technique depends on the maturity of the analyst, developers, users, and the customer involved.

Direct Communication

  • Interviews: Strong medium to collect requirements. Can be structured (pre-set agenda of open questions) or non-structured (context-free, no pre-set agenda). They can be one-to-one or group interviews to uncover missing requirements.
  • Surveys & Questionnaires: Documents with pre-defined sets of objective questions handed to stakeholders. A shortcoming is that unlisted options might leave issues unattended.

Analysis & Observation

  • Task & Domain Analysis: Engineers analyze the operation for which the new system is required or consult domain experts for general and specific requirements.
  • Observation: Experts visit the client's workplace to observe the actual working of existing installed systems and workflows to draw conclusions.

Interactive Methods

  • Brainstorming: Informal debates intended to generate new ideas. Requires a highly trained facilitator to handle group bias and conflicts.
  • Prototyping: Building user interfaces without detailed functionality for the user to interpret features and provide feedback.
  • JAD (Joint Application Development): Collaborative workshops involving the client/end-user throughout development for faster times and greater satisfaction.

3. Requirements Specification

The process by which a document is developed which clearly communicates the requirements. The requirements are captured and expressed in a software requirements specification (SRS).

4. Requirements Verification & Validation

The process of ensuring that the requirements and the SRS are in compliance with the needs of the clients and the system. Techniques include reviews, inspections, walkthroughs, and prototyping.

Verification Validation
"Are we building the product right?" "Are we building the right product?"
Evaluates if the software correctly implements the specific functions according to the written specification. Evaluates if the final software actually meets the true needs, requirements, and expectations of the customer.
It is a process-oriented activity checking for consistency and compliance at each stage. It is a product-oriented activity checking the final behavior and real-world usability.
Techniques: Reviews, inspections, and walkthroughs of requirements. Techniques: Prototyping and user acceptance testing.

Requirement Engineering: Analysis & Specification

Requirements Analysis is the essential process of studying and analyzing the customer and stakeholder needs to arrive at a definition of software requirements. It involves refining and scrutinizing gathered requirements to make them consistent and unambiguous. This step is critical because customers may provide requirements that are impossible to implement due to dependencies, and business analysts might interpret needs differently than programmers would.

Software Requirement Analysis Problem Recognition Evaluation & Synthesis Modeling Specification Review

Activities Involved in Analyzing Requirements

Requirements Specification & Perspectives

Requirements are documented from two primary perspectives: User Requirements (statements in natural language plus diagrams of services and constraints, written for customers) and System Requirements (structured documents setting out detailed descriptions of functions and constraints, forming part of the contract).

Functional Requirements

Requirements that the end user specifically demands as basic facilities the system should offer.

  • Must be necessarily incorporated into the system as part of the contract.
  • Stated in the form of input given, operations performed, and output expected.
  • Directly visible in the final product.

Non-Functional Requirements

Quality constraints (non-behavioral requirements) the system must satisfy according to the project contract.

  • Performance: Response time, security, storage space.
  • Life Cycle: Maintainability, portability, reliability, scalability.
  • Constraints: Interface, operating, and economic constraints.

Domain Requirements

Requirements characteristic of a particular category or domain of projects.

  • Basic functions that a system of a specific domain must necessarily exhibit.
  • They are not user-specific, but rather identified from the domain model itself (e.g., an academic software inherently needing access to faculty and student lists).

Requirement Modeling

A model is a representation of some aspect of the system being built. Requirements modeling is an approach used in projects where the requirements keep on evolving throughout the project. Creating a model helps ensure the project's exact requirements are documented clearly, creates a strong foundation for the overall needs, clarifies and refines the design, and simplifies complex aspects of systems.

Models can be in a variety of graphical representations and forms, including structured approaches (like Entity Relationship Diagrams and Data Flow Diagrams) and Object-Oriented approaches (UML Diagrams such as Use Case, Class, Sequence, Collaboration, Activity, and State Diagrams).

Software Requirements Scenario-based models e.g., use cases, user stories Class models e.g., class diagrams, collaboration diagrams Behavioral models e.g., state diagrams, sequence diagrams Flow models e.g., DFDs, data models

The Requirements modeling action results in one or more of the following types of models, each examining the system from a different perspective:

1. Scenario-Based Models

These models depict the system from the point of view of the customer or user. They identify the various system "actors" and capture user stories and use cases.

2. Data Models

These models depict the information domain for the problem. They help in understanding the data structures that the system must process and manage.

3. Class-Oriented Models

They represent object-oriented classes, defining their attributes and operations. They also map the manner in which different classes collaborate to achieve the system requirements.

4. Flow-Oriented Models

These represent the functional elements of the system. They map out exactly how these functions transform data as it moves through the entire system (e.g., Data Flow Diagrams).

5. Behavioral Models

These models depict how the software behaves as a consequence of external "events". Examples include state diagrams and sequence diagrams that track dynamic state changes.

Scenario Based Model (Use Cases & Activity)

Scenario-based elements depict how the user interacts with the system and the specific sequence of activities that occur as the software is used. The primary objective of scenario-based modeling is to look at a system from the user's perspective and produce a use case. It makes sense to start with this step as other requirements modeling stages will make reference to these use cases.

Traveler Get Boarding Pass Search Flights Buy Air Tickets

Unified Modeling Language (UML) & Use Case Diagrams

Requirement modeling with UML begins with the creation of scenarios in the form of use cases, activity diagrams, and swim lanes to develop the understanding of how the system would be used. Because a single diagram cannot capture the different elements of a system in its entirety, UML is made up of nine diagrams used to model a system at different points in its life cycle.

Use Case Diagrams are used to identify the primary elements and processes that form the system. When a system is analyzed to gather its functionalities, use cases are prepared and actors are identified.

Purpose

  • To gather the requirements of a system.
  • To get an outside view of a system.
  • To identify the external and internal factors influencing the system.
  • To show the interaction between the system and the actors.

Features & Functions

  • Focuses on the behavior of the system from an external (user's) point of view.
  • Helps discover requirements and describes functions from top to bottom.
  • Specifies types of interactions taking place and defines the system's boundary.
  • Useful for communicating with clients, designing test cases, and discovering new features.

Elements of a Use Case Diagram

A use case diagram consists of several fundamental elements that map out the system's behavior and its interacting external entities.

1. Actor

An external entity (person, hardware, or external system) that lies outside the system boundary but interacts with it. Represented as a stickman with a unique name.

  • Primary Actor: Main users who drive the system requirements to achieve an observable goal.
  • Secondary Actor: Entities that supervise or manage the system (often appear more "inside" the system).

2. Use Case

Describes how a person actually uses the process to accomplish a goal. It represents the sequence of events or transactions performed by the actor.

  • Initiated by an actor to assess functionality.
  • Represented as an oval/ellipse with the name written inside.

3. Boundary & Association

  • System Boundary: A rectangular box enclosing the use cases, defining the visual limit and scope of what the system will be.
  • Association: A solid line connecting an actor to a use case, indicating that the actor participates in that specific sequence of actions.
Online Shopping System (Boundary) Customer Make Purchase Process Payment Apply Discount <<include>> <<extend>>

Relationships Between Use Cases

A relationship defines how use cases interact with one another. There are three primary types of relationships in a Use Case Diagram:

Guidelines for Drawing a Use Case Diagram:

Names of use cases should clearly identify the functionalities performed. Do not try to include all types of relationships, as the main purpose is to identify high-level requirements. Always give suitable names to actors and ensure relationships and dependencies are shown clearly.

Activity Diagram

An activity is a particular operation of the system, and an activity diagram is a behavioral diagram that depicts the behavior of a system. It portrays the control flow from a start point to a finish point, showing the various decision paths that exist while the activity is being executed. Instead of implementation details, it demonstrates the flow of control, emphasizing the condition of flow and the order in which it occurs (which can be sequential, branched, or concurrent). It is also termed an object-oriented flowchart.

Purpose of Activity Diagram

  • To draw the activity flow of a system.
  • To describe the sequence from one activity to another.
  • To describe the parallel, branched, and concurrent flow of the system.

Benefits of Activity Diagram

  • Dynamic modelling of the system or a process.
  • Illustrates the various steps involved in a UML use case.
  • Models software elements like methods, operations, and functions.
  • Shows the constraints, conditions, and logic behind algorithms.

Elements of an Activity Diagram

Initial Activity Receive Order Fork (Split concurrent) Fill Order Send Invoice Decision Box [Guard] Join (Merge concurrent) Final Activity

How to Draw an Activity Diagram

An activity diagram is an enhancement of a flowchart that represents the workflow among various activities, encompassing unique skills like modeling concurrent flows. When drawing an activity diagram, the following rules should be followed:

Example: Activity Diagram for Railway Ticket Booking

Below is a practical example of an Activity Diagram illustrating the flow of a commuter booking a ticket (adapted from a ticket vending or booking system). It demonstrates the sequential flow, a decision node for payment types, and the merging of those paths to finalize the booking.

Initial Node Start Session Provide Trip Info Process Payment Info Decision [pay with cash] [pay with card] Authorize Payment Merge Dispense Ticket Final Node

Software Requirement Specification (SRS)

A Software Requirements Specification (SRS) is a document that describes what the software will do and how it will be expected to perform. It describes the functionality the product needs to fulfill all stakeholder (business, user) needs, providing a detailed overview of the software product, its parameters, goals, target audience, user interface, and hardware/software requirements. An SRS minimizes the time and effort required by developers and reduces the overall development cost.

Characteristics of a Good SRS

For an SRS to be effective and reliable, it must exhibit the following twelve characteristics:

Accuracy & Completeness

  • Correctness: Covers all requirements actually expected from the system.
  • Completeness: Covers all functional and non-functional requirements properly.
  • Consistency: No logical or terminological conflicts between any set of requirements.
  • Unambiguousness: All stated requirements have only one interpretation.

Structure & Flexibility

  • Ranking: Classifies requirements by importance/stability (e.g., desirable vs. essential).
  • Modifiability: Capable of easily accepting changes, with modifications properly indexed.
  • Traceability: Requirements can be traced to design components, code segments, and test cases.
  • Design Independence: Excludes implementation details, allowing multiple design alternatives.

Evaluation & Clarity

  • Verifiability: Specific techniques exist to quantifiably measure if the requirement is met.
  • Testability: Written so it is easy to generate test cases and plans.
  • Understandable: Avoids formal notations so non-expert customers can read it easily.
  • Right Abstraction: Detail level matches the phase (deep for requirements, light for feasibility).

SRS Document Format (IEEE Standard)

When writing an SRS, organizations often rely on standard outlines, such as the IEEE template, to ensure all critical details are captured systematically. The standard structure includes:

Section Subsections & Details
1. Introduction 1.1 Purpose: Sets expectations and defines the product's goal.
1.2 Intended Audience & 1.3 Intended Use: Defines who accesses the SRS (developers, testers, stakeholders) and how.
1.4 Scope: Benefits, objectives, and overall business goals.
1.5 Definitions and Acronyms: Includes risk definitions for safety-critical teams.
2. Overall Description 2.1 User Needs: Defines primary/secondary users and buyers, detailing how they will use the product.
2.2 Assumptions and Dependencies: Lists factors impacting fulfillment, assumptions that could be false, and external software component dependencies.
3. System Features and Requirements 3.1 Functional Requirements: Essential requirements and risks to build the product.
3.2 External Interface Requirements: How the product interfaces with other users, hardware, software, or communications (critical for embedded systems).
3.3 System Features: Required features for the system to function.
3.4 Nonfunctional Requirements: Performance, safety, security, and quality constraints.

Finalizing the SRS

Once the SRS document is completed, it must be approved by key stakeholders. Everyone involved in the project must review and adhere to the latest approved version of the document.

Data Flow Diagram (DFD)

A Data Flow Diagram (DFD) is a traditional visual representation of the information flows within a system. A neat and clear DFD can graphically depict the right amount of the system requirement, showing what kind of data will be input to the system and what data is received as the output. It can be manual, automated, or a combination of both. The objective of a DFD (also called a data flow graph or bubble chart) is to show the scope and boundaries of a system as a whole by illustrating where data comes from, where it goes, what changes the information, and where it is stored.

Logical DFD

It specifies the logical processes performed on the data and portrays the system's activities. It focuses on what is being accomplished rather than how.

Physical DFD

A graphical representation showing the system's internal and external entities, specifying who is actually carrying out the process rather than what is being accomplished.

Elements of Data Flow Diagram

Data Flow Diagrams are composed of four basic symbols:

External Entity Process Data Store Data Flow

Levels of DFD: Level 0 (Context Diagram)

An entire system is depicted by a single data flow diagram which gives the complete system overview, known as the context diagram. Successive expansion of processes is done to show the operations in detail, which is called levelling. Generally, the maximum level of DFD is 3 (Level 0, 1, and 2).

Level 0 DFD (Context Level Diagram) is the simplest DFD. The outermost level is concerned with how the system interacts with the outside world, representing the entire system as a single bubble with its relationships to external entities.

How to create Level 0 DFD:

  • Identify the main system.
  • Identify the external people who interact with the system.
  • Decide what data these entities will enter into the system.
  • Determine what these entities expect as output from the system.
Clothes ordering system Customer Clothes supplier Clothes store Sales manager Customer order Receipt Clothes order Receipt Clothes order Management reports

Levels of DFD: Level 1 DFD

In a 1-level DFD, the context diagram is decomposed into multiple bubbles/processes. The entire system is divided into modules, representing how data moves through different modules. This level highlights the main functions of the system and breaks down the high-level process of the 0-level DFD into subprocesses, providing a high-level view that identifies the major processes and data stores.

How to create Level 1 DFD:

  • Focus on your process and break it into 2 or more sub-processes.
  • Identify what data flows between these processes and between the entities.
  • Identify what permanent data files (data stores) are used in this system.
  • Note: No new external entities can be introduced at this level.
Customer Clothes Store Supplier Sales manager Order clothes Inventory Generate reports Order inventory Order Orders Order Bill Order Order Inventory details Inventory details Reports Orders Inventory order Inventory details Inventory order Inventory details

Levels of DFD: Level 2 DFD

A Level 2 DFD goes one step deeper into the parts of a 1-level DFD. Each process from level 1 is exploded even more into sub-processes, and this decomposition continues for each level as needed. It can be used to plan or record the specific, necessary details about the system's functioning, and the total number of levels possible depends entirely on the complexity of the system.

Customers 1.1 Manage Customer Information 1.2 Manage Transaction Information 1.3 Release Cash and Receipts Customer Database Transaction Database Customer Info Customer Info Transaction Details Transaction Details Confirmation Transaction Details Update Confirmed Transaction Cash & Receipt

The True Value of a DFD

With a data flow diagram, users are able to visualize exactly how the system will operate, what it will accomplish, and how it will be implemented. DFDs provide end-users with a physical idea of how the data they input ultimately affects the structure of the whole system. Furthermore, drawing and comparing the old system's DFD with the new system's DFD is a standard practice to draw comparisons and help implement a much more efficient system architecture.