Edited Practical File
Edited Practical File
PRACTICAL FILE
(BCS-651)
AIM:
Prepare a SRS document in line with the IEEE recommended standards.
Description:
An SRS is basically an organization's understanding (in writing) of a customer or potential client's system
requirements and dependencies at a particular point in time (usually) prior to any actual design or
development work. It's a two-way insurance policy that assures that both the client and the organization
understand the other's requirements from that perspective at a given point in time.
The SRS document itself states in precise and explicit language those functions and capabilities a software
system (i.e., a software application, an eCommerce Web site, and so on) must provide, as well as states any
required constraints by which the system must abide. The SRS also functions as a blueprint for completing
a project with as little cost growth as possible. The SRS is often referred to as the "parent" document
because all subsequent project management documents, such as design specifications, statements of work,
software architecture specifications, testing and validation plans, and documentation plans, are related to it.
It's important to note that an SRS contains functional and nonfunctional requirements only; it doesn't offer
design suggestions, possible solutions to technology or business issues, or any other information other than
what the development team understands the customer's system requirements to be.
1. Introduction:
1.1 Purpose
This document provides a detailed description of the requirements for DriftSentinel, a real-time
MLOps framework designed to monitor deployed machine learning systems for data drift and data
poisoning attacks. It serves as a reference for developers, stakeholders, and evaluators to understand
system functionality and constraints.
1.2 Document Conventions
· “Shall” indicates mandatory requirements
· “Should” indicates recommended requirements
· “May” indicates optional features
1.3 Intended Audience
· Software Developers
· Machine Learning Engineers
· Project Evaluators / Faculty
· System Architects
1.4 Additional Information
This system focuses on post-deployment monitoring of machine learning models and ensures their
reliability and security in dynamic environments.
1.5 Contact Information / Team Members
Project Name: DriftSentinel
1.6 References
· IEEE SRS Documentation Standards
· MLOps Best Practices
· Statistical Drift Detection Method
2. Overall Description:
2.1 Product Perspective
DriftSentinel is a monitoring layer that operates alongside deployed machine learning models. It
continuously analyzes incoming data streams to detect anomalies and distribution shifts.
2.2 Product Functions
· Real-time model inference monitoring
· Data drift detection
· Data poisoning detection
· Alert generation and logging
· Automated retraining trigger
· Model version management
2.3 User Classes and Characteristics
User Type Description
Admin Monitors alerts and system logs
ML Engineer Manages model lifecycle and retraining
End User Sends prediction requests
2.4 Operating Environment
· Operating System: Windows / Linux
· Programming Language: Python
· Deployment: Docker containers
· Optional: Cloud platforms (AWS, GCP, Azure)
2.5 User Environment
· API-based interaction
· Monitoring dashboard (optional)
· Command-line interface for backend
2.6 Design and Implementation Constraints
· Must support real-time data processing
· Should maintain low latency
· Must integrate with MLflow
· Must use streaming architecture
2.7 Assumptions and Dependencies
· Availability of training and baseline data
· Continuous incoming data stream
· Stable network connectivity
4. System Features:
4.1 Real-Time Monitoring System:
Description and Priority
Continuously monitors incoming inference data.
Priority: High
Action / Result
Captures and stores input data for analysis.
Functional Requirements
· The system shall log all incoming data
· The system shall process data in real time
4.2 Drift Detection Module:
Description and Priority
Detects statistical changes in data distribution.
Priority: High
Action / Result
Triggers alerts when drift is detected.
Functional Requirements
· The system shall compute PSI, KL Divergence, KS Test
· The system shall compare live data with baseline data
· The system shall generate drift scores
4.3 Data Poisoning Detection Module:
Description and Priority
Detects anomalous or malicious inputs.
Priority: High
Action / Result
Flags suspicious data and logs events.
Functional Requirements
· The system shall use anomaly detection techniques
· The system shall detect abnormal input patterns
· The system shall monitor confidence variations
4.4 Decision Engine:
Description and Priority
Determines system response based on analysis.
Priority: High
Action / Result
Triggers alerts or retraining processes.
Functional Requirements
· The system shall evaluate thresholds
· The system shall initiate mitigation actions
4.5 Model Management System:
Description and Priority
Manages model versions and updates.
Priority: Medium
Action / Result
Stores and updates model versions.
Functional Requirements
· The system shall maintain version history
· The system shall support rollback
· The system shall track performance metrics
AIM:
Draw the use case diagram and specify the role of each of the actors. Also state the precondition, post
condition and function of each use case.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 Mb RAM, Standard keyboard n mouse, colored monitor.
Software Requirements:
[Link], Windows XP.
Description:
A use case diagram represents the interaction between users (actors) and the system. It helps in understanding
system functionality from a user’s perspective and defines the scope of the system.
In this phase, DriftSentinel focuses on model inference, real-time monitoring, drift detection, poisoning detection,
and dashboard visualization, without including retraining or model management.
Actors and Their Roles:
1. End User (Client)
· Sends input data for prediction
· Receives prediction results
2. Admin
· Monitors system alerts
· Views dashboard and logs
3. System (DriftSentinel)
· Performs prediction
· Detects drift and anomalies
· Generates alerts
Use Cases
1. Send Prediction Request
2. Generate Prediction
3. Stream Data to Monitoring System
4. Detect Data Drift
5. Generate Alerts
6. View Monitoring Dashboard
Use Case Specifications
Use Case 1: Send Prediction Request
· Actor: End User
· Precondition: System is active and API is available
· Postcondition: Input data is sent to the system
· Function: Sends data for prediction
Use Case 2: Generate Prediction
· Actor: System
· Precondition: Input data received
· Postcondition: Prediction output generated
· Function: Processes input using ML model
Use Case 3: Stream Data to Monitoring System
· Actor: System
· Precondition: Prediction completed
· Postcondition: Data sent to monitoring pipeline
· Function: Streams input and output data for analysis
Use Case 4: Detect Data Drift
· Actor: System
· Precondition: Sufficient data collected
· Postcondition: Drift score generated
· Function: Compares current data with baseline distribution
Use Case 5: Generate Alerts
· Actor: Admin
· Precondition: Drift or anomaly detected
· Postcondition: Alert generated
· Function: Notifies abnormal system behavior
Use Case 6: View Monitoring Dashboard
· Actor: Admin
· Precondition: System running
· Postcondition: Metrics displayed
· Function: Displays drift, anomalies, and system logs
Conclusion
The use case diagram of DriftSentinel clearly represents interactions between users and the system in the monitoring
phase. It focuses on prediction, drift detection, anomaly detection, and visualization, providing a clear understanding
of system functionality without involving retraining processes.
Experiment No.:3
AIM:
Draw the activity diagram.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 Mb RAM, Standard keyboard n mouse, colored monitor.
Software Requirements:
[Link], Windows XP.
Theory:
An activity diagram represents the workflow of a system by showing the sequence of activities and
decision points. It helps in understanding how different components of the system interact during
execution.
In DriftSentinel, the activity diagram illustrates the flow from user request → model inference →
monitoring → drift detection → alert generation → dashboard visualization.
Actors:
1. End User (Client)
· Sends input data for prediction
· Receives prediction results
2. Admin
· Monitors alerts
· Views dashboard
3. System (DriftSentinel)
· Performs prediction
· Monitors incoming data
· Detects data drift
· Generates alerts
Activities:
1. Send Prediction Request
· Precondition: System is active and API is available
· Postcondition: Input data received
· Function: User sends data for prediction
2. Generate Prediction
· Precondition: Input data received
· Postcondition: Prediction output generated
· Function: System processes input using ML model
3. Stream Data to Monitoring System
· Precondition: Prediction completed
· Postcondition: Data sent to monitoring pipeline
· Function: Stores input data for analysis
4. Detect Data Drift
· Precondition: Sufficient data collected
· Postcondition: Drift score generated
· Function: Compares current data with baseline
5. Generate Alert
· Precondition: Drift detected
· Postcondition: Alert generated
· Function: Notifies admin about drift
6. View Dashboard
· Precondition: System running
· Postcondition: Monitoring metrics displayed
· Function: Shows drift and system logs
Output:
Conclusion:
The activity diagram of DriftSentinel represents the workflow of the system from prediction to drift
detection and alert generation. It clearly shows how the system monitors real-time data and ensures
reliability without including advanced features like retraining or anomaly detection.
Experiment No.:4
AIM:
Identify the classes. Classify them as weak and strong classes and draw the class diagram.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 Mb RAM, Standard keyboard n mouse, colored monitor.
Software Requirements:
[Link], Windows XP.
Theory:
A class diagram models the static structure of a system. It shows relationships between classes, objects,
attributes, and operations.
As mentioned above, and as seen in Diagram 1, classes are represented by rectangular symbols, and
different arrows are used to represent the relationship between classes. Note that class diagrams don’t
depict any interactions between classes.
Class
The class name is always shown in the first section, the attributes in the second,
and operations in the third. Attributes are values that define a class. Classes can
carry out processes known as operations.
Note: there can be a fourth section (responsibility), which is an optional section for
including additional information about the class.
Visibility
Bidirectional
Association
Unilateral
Association
Inheritance
Dependency
Aggregation
Multiplicity
Output:
Conclusion:
The class diagram of DriftSentinel represents the static structure of the system by identifying key
components and their relationships.
Experiment No.:5
AIM:
Draw the sequence diagram for any two scenarios.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
[Link] UML, Windows XP
Theory:
UML sequence diagrams model the flow of logic within a system in a visual manner. They help in
documenting and validating system behavior by showing interactions between different components over
time.
Sequence diagrams are widely used for dynamic modeling and are essential for understanding how
different parts of a system communicate during execution.
Output:
Conclusion:
The sequence diagrams for DriftSentinel illustrate the dynamic interaction between system components
during prediction and drift detection processes. They help in understanding the flow of data and control,
ensuring that the system behavior is clearly defined and validated.
Experiment No.:6
AIM:
Draw the collaboration diagram.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
[Link] UML, Windows XP
Theory:
Collaboration diagrams (also known as communication diagrams) represent the interactions between
objects in a system. They show how objects are connected and how messages are passed between them.
Objects are represented as nodes, and arrows indicate the flow of messages. Sequence numbers (such as 1,
1.1, 1.2, etc.) are used to show the order of interactions between objects.
These diagrams help in understanding system communication and object relationships.
Collaboration Flow (Message Sequence):
Scenario: Prediction → Monitoring → Drift Detection → Alert
Output:
Conclusion:
The collaboration diagram of DriftSentinel illustrates the interaction between system components and the
sequence of message exchanges. It provides a clear understanding of how data flows from the user to the
monitoring system and how drift detection leads to alert generation and visualization on the dashboard.
Experiment No.:7
AIM:
Draw the component diagram.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
[Link] UML, Windows XP
Theory:
A component is something required to execute a stereotype function. Examples of stereotypes in
components include executables, documents, database tables, files, and library files.
Components are wired together by using an assembly connector to connect the required interface of one
component with the provided interface of another component. This illustrates the service consumer -
service provider relationship between the two components.
An assembly connector is a "connector between two components that defines that one component provides
the services that another component requires. An assembly connector is a connector that is defined from a
required interface or port to a provided interface or port."
When using a component diagram to show the internal structure of a component, the provided and required
interfaces of the encompassing component can delegate to the corresponding interfaces of the contained
components.
A delegation connector is a "connector that links the external contract of a component (as specified by its
ports) to the internal realization of that behavior by the component’s parts." Examples include APIs,
databases, services, and libraries.
Components interact using:
· Provided Interfaces (lollipop) → services offered
· Required Interfaces (socket) → services needed
These interactions define the relationship between system modules and help in understanding system
architecture.
Components Identified in DriftSentinel:
1. API Service (FastAPI)
2. Model Inference Component
3. Monitoring Engine
4. Drift Detection Component
5. Alert Service
6. Dashboard UI
7. Database
Flow of Interaction:
1. API Service → Model Inference
2. Model Inference → Monitoring Engine
3. Monitoring Engine → Drift Detection
4. Drift Detection → Alert Service
5. Alert Service → Dashboard UI
6. Monitoring Engine → Database
Output:
Conclusion:
The component diagram of DriftSentinel represents the modular architecture of the system by illustrating
how different components interact with each other. It provides a clear understanding of system structure
and the flow of data between modules, ensuring maintainability and scalability.
Experiment No.:8
AIM:
Draw the state chart diagram.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
[Link] UML, Windows XP
Theory:
UML uses diagrams to represent systems, which are broadly categorized into behavioral and structural
diagrams. A state chart diagram is a behavioral diagram that represents the different states of a system
and transitions between those states based on events.
It helps in understanding how a system behaves over time in response to inputs and conditions.
States Identified in DriftSentinel:
1. Idle State
2. Receiving Request
3. Processing Prediction
4. Monitoring Data
5. Detecting Drift
6. Alert Generated
7. Displaying Dashboard
Output:
Conclusion:
The state chart diagram of DriftSentinel represents the different states of the system and how it transitions
from receiving a request to detecting drift and generating alerts. It clearly illustrates system behavior.
Experiment No.:9
AIM:
To perform forward engineering in Java (Model to Code Conversion).
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
Java, Windows XP
Theory:
Forward engineering is the process of converting a high-level model such as a UML class diagram into
actual code. In Java, this involves translating classes, attributes, and methods from the design into Java
classes.
This ensures that the implementation follows the system design accurately.
Example:
1. UML Class Diagram (Text Format):
// Attributes
private String name;
private int age;
// Default Constructor
public Person() {
}
// Parameterized Constructor
public Person(String name, int age) {
[Link] = name;
[Link] = age;
}
// Getter Methods
public String getName() {
return name;
}
// Setter Methods
public void setName(String name) {
[Link] = name;
}
// toString Method
@Override
public String toString() {
return "Person{name='" + name + "', age=" + age + "}";
}
[Link](22);
[Link]([Link]());
}
}
Conclusion:
The UML class diagram is successfully converted into Java code using forward engineering. The Person
class includes attributes, constructors, getter and setter methods, and a toString method. This demonstrates
how system design can be translated into a working implementation using Java.
Experiment No.:10
AIM:
To perform reverse engineering in Java (Code to Model Conversion).
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
Java, Windows XP
Theory:
Reverse engineering is the process of analyzing existing code to derive a higher-level model or design
representation. In Java, this typically involves converting source code into UML diagrams such as class
diagrams.
This helps in understanding system structure, relationships, and functionality, especially when
documentation is not available.
Example:
1. Given Java Code
// [Link]
// Attributes
private String name;
private int age;
// Constructors
public Person() {
}
// Other Method
public void celebrateBirthday() {
age++;
[Link]("Happy Birthday, " + name + "! You are now " + age + " years old.");
}
// toString Method
@Override
public String toString() {
return "Person{name='" + name + "', age=" + age + "}";
}
}
Explanation:
· Attributes → Converted from private variables
· Constructors → Represent object initialization
· Methods → Represent class behavior
· Access modifiers (+ / -) → Show visibility
Conclusion:
Reverse engineering successfully converts Java code into a UML class diagram, providing a clear visual
representation of the system structure. This helps in understandingand maintaining software systems.
Experiment No.:11
AIM:
Draw the deployment diagram.
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 MB RAM, Standard keyboard and mouse, colored monitor.
Software Requirements:
Java, Windows XP
Theory:
A UML Deployment Diagram represents the physical architecture of a system by showing how software
components are deployed on hardware nodes. It illustrates the relationship between hardware devices and
software artifacts.
Deployment diagrams help in understanding how the system will run in a real-world environment and how
different components interact across machines.
Nodes Identified:
1. Client Device (User System)
· Sends API requests
· Displays dashboard
2. Application Server
· Hosts API Service
· Contains Model Inference component
· Runs Monitoring Engine
3. Processing Unit (Drift Detection Server)
· Executes drift detection logic
4. Database Server
· Stores logs and monitoring data
· Dashboard
Conclusion:
The deployment diagram of DriftSentinel illustrates how system components are distributed across
different hardware nodes. It provides a clear view of system architecture and helps in understanding how
the application operates in a real-world environment.