TESTING AND VALIDATION
Software testing is an important phase in the development of any
software system. It ensures that the developed system works correctly
and meets the requirements. Testing helps in identifying errors,
improving performance, and ensuring reliability of the application.
In the plant disease detection system, testing plays a crucial role
because the system must provide accurate and fast predictions to
users. The system includes multiple components such as deep
learning model, backend server, and mobile application. Therefore,
different testing methods are required to verify each module.
The testing process for the proposed system includes:
• Unit Testing
• Integration Testing
• Performance Testing
These testing methods ensure that the system is reliable, efficient, and
user-friendly.
UNIT TESTING
Introduction to Unit Testing
Unit testing is a software testing technique in which individual
components or modules of the system are tested separately. Each
module is tested independently to verify that it works correctly.
In the plant disease detection system, unit testing is performed on
each module such as:
• Image upload module
• Image preprocessing module
1
• CNN prediction module
• Backend API module
• Result display module
The main objective of unit testing is to identify errors in individual
modules before integrating them into the complete system.
Objectives of Unit Testing
The objectives of unit testing are:
• To verify that each module works correctly
• To detect errors at early stage
• To ensure proper functionality of code
• To improve reliability of system
• To simplify debugging process
Unit testing helps developers identify issues quickly and fix them
before moving to integration testing.
Unit Testing of Image Upload Module
The image upload module allows users to capture or select a plant leaf
image. This module is tested to ensure that:
• User can select image from gallery
• User can capture image using camera
• Selected image is displayed correctly
• Image is sent to backend successfully
Test Case Example:
Test Case ID: UT01
Module: Image Upload
Input: Upload leaf image
2
Expected Output: Image uploaded successfully
Result: Passed
Unit Testing of Image Preprocessing Module
This module processes the image before sending it to the CNN model.
Testing ensures that:
• Image resizing works correctly
• Image normalization is accurate
• Image converted to array properly
• No error during preprocessing
Test Case Example:
Test Case ID: UT02
Module: Image Preprocessing
Input: Leaf image
Expected Output: Processed image ready for prediction
Result: Passed
Unit Testing of CNN Prediction Module
This is the core module of the system. It is tested to verify:
• Model loads correctly
• Image is predicted correctly
• Disease name is returned
• Confidence score is displayed
Test Case Example:
Test Case ID: UT03
Module: CNN Prediction
Input: Leaf image
3
Expected Output: Correct disease prediction
Result: Passed
Unit Testing of Backend API Module
The backend API connects mobile app with the CNN model.
Testing ensures:
• API receives image correctly
• Model prediction works
• JSON response generated
• Error handling works
Test Case Example:
Test Case ID: UT04
Module: Backend API
Input: Image from mobile
Expected Output: JSON response with disease details
Result: Passed
Advantages of Unit Testing
• Easy error detection
• Improves code quality
• Simplifies debugging
• Increases system reliability
• Ensures each module works correctly
4
INTEGRATION TESTING
Introduction
Integration testing is performed after unit testing. In this testing,
different modules are combined and tested together.
The objective is to ensure that all modules work properly when
integrated.
In the plant disease detection system, integration testing is performed
between:
• Mobile app and backend server
• Backend server and CNN model
• Backend and database
• Result display and API
Objectives of Integration Testing
• Verify communication between modules
• Ensure data flow is correct
• Identify interface errors
• Validate complete workflow
Integration Testing Process
Step 1: Upload image from mobile app
Step 2: Image sent to backend
Step 3: Backend preprocess image
Step 4: CNN model predicts disease
Step 5: Result sent to mobile
Step 6: Result displayed to user
All steps are tested together.
Test Case Example
5
Test Case ID: IT01
Module: Mobile + Backend
Input: Upload leaf image
Expected Output: Disease prediction displayed
Result: Passed
Test Case ID: IT02
Module: Backend + Model
Input: Image
Expected Output: Prediction with confidence
Result: Passed
Integration Issues Found
During testing, few issues were identified:
• Slow API response initially
• Image format error
• Incorrect JSON response
These issues were fixed successfully.
Advantages of Integration Testing
• Ensures complete system works
• Detects communication errors
• Improves system reliability
• Validates real-time workflow
PERFORMANCE TESTING
Introduction
6
Performance testing evaluates the speed, efficiency, and stability of
the system. It ensures that the system performs well under different
conditions.
In plant disease detection system, performance testing checks:
• Prediction speed
• API response time
• System accuracy
• Load handling
Objectives of Performance Testing
• Ensure fast prediction
• Check system stability
• Test response time
• Measure accuracy
• Improve user experience
Response Time Testing
The time taken to predict disease after image upload is measured.
Average Results:
Image upload time: 1 second
Prediction time: 2 seconds
Total response time: 3 seconds
The system provides fast real-time prediction.
Accuracy Testing
Accuracy is measured using test dataset.
7
Total images tested: 500
Correct predictions: 470
Accuracy = 94%
This shows high model performance.
Load Testing
Multiple requests are sent to server.
Results:
10 users → System stable
20 users → Slight delay
50 users → Performance reduced
Optimization done to improve performance.
Stress Testing
System tested under heavy load.
Results:
Handles normal load easily
Slows under heavy load
No crash observed
System remains stable.
Advantages of Performance Testing
• Ensures fast response
• Improves user experience
8
• Detects bottlenecks
• Enhances reliability
• Makes system scalable
TESTING SUMMARY
All testing methods were successfully performed on the plant disease
detection system.
Testing Type | Status
Unit Testing | Passed
Integration Testing | Passed
Performance Testing | Passed
The system works accurately, efficiently, and reliably. Testing
confirms that the developed system meets all requirements and
performs well in real-time conditions.