Testing of Mini Project – AI-Based Tomato Leaf Disease Detection
1. UNIT TESTING
Unit testing ensures that each individual component of the car price prediction system works
correctly.
1.1 Components Tested
Component Description Test Performed Expected Result
Image Accepts image files Should accept only valid
Upload JPG/PNG
Upload from user image formats
Module
Loads, resizes, Returns
Image Handler Input sample
normalizes 128×128
images
images normalized
array
Validates if image Tested on leaf & Correctly identifies leaf
Leaf
contains green leaf non- leaf images vs. non-leaf
Segmentation
Runs trained model Input sample Outputs
CNN Classifier
prediction 128×128 probability
image vector of length
10
Estimates Brown/yellow Returns accurate
Damage
disease- leaf images damage percentage
Estimator
affected area
Treatment Suggests medicines Returns correct
Input disease name
Recommender & cure time recommendation
Saves History stored &
History Recorder Save dummy
previous retrievable
history
predictions
Displays Call UI functions in
Dashboard UI UI loads without errors
predictions, isolation
graphs
1.2 Unit Testing Tools
● Python unit test
● Manual input testing
● Streamlit debug mode
● Test images (healthy, diseased, fake leaf, non-leaf)
1.3 Unit Test Conclusion
All modules performed as expected after minor fixes in:
● Image preprocessing
● Model loading
● Leaf validation threshold
Unit testing passed successfully.
2. INTEGRATION TESTING
Integration Testing ensures all modules work together smoothly when combined.
2.1 Modules Integrated
1. Image Upload → Image Handler → Leaf Segmentation
2. Leaf Segmentation → CNN Classifier → Damage Estimator
3. CNN Classifier → Treatment Recommender
4. All results → Dashboard UI → History Recorder
Integration Test Scenarios
Test Case Modules Tested Expected Result Status
Valid leaf image ✔
UI → Handler → Segmentation Pass validation
upload Passed
Non-leaf Show “Not a Leaf” ✔
UI → Handler → Segmentation
image warning Passed
upload
Correct ✔
Prediction pipeline Segmentation → CNN Classifier
disease Passed
predicted
Damage % ✔
CNN → Damage Estimator Accurate area %
calculation Passed
Treatment Shows medicine, cure ✔
Classifier → Recommender
generation time Passed
✔
Saving History UI → History Recorder Entry stored
Passed
Upload → Predict → Suggest → ✔
Full flow execution No errors
Save Passed
2.2 Integration Testing Result
All modules integrated successfully.
Only minor issues were fixed:
● Incorrect class label mapping
● Model loading path mismatch
● Streamlit column width adjustments
Integration testing completed successfully.
3. USER ACCEPTANCE TESTING (UAT)
UAT ensures real users are satisfied with the system’s performance and features.
3.1 Test Users
● 3 BCA Students
● 2 College Faculty Members
● 1 Farmer (sample leaf images provided)
3.2 UAT Scenarios
Scenario Expected Output Actual Result Status
Prediction + confidence + ✔
Upload correct leaf image Works
damage % Accepted
perfectly
Upload wrong image (face, ✔
“Not a leaf” warning Shown
object) Accepted
correctly
✔
UI appearance Clean, simple, professional Users satisfied
Accepted
Provid ✔
Treatment suggestion Easy to understand
ed Accepted
clarity
proper
ly
✔
Performance Prediction within 3 seconds Met
Accepted
requirement
Works on laptop/mobile ✔
Accessibility Verified
browser Accepted
3.3 User Feedback Summary
● UI is clean and modern
● Predictions are quick
● Treatment suggestions are useful
● Damage % feature adds value
● History panel is very helpful
● Sidebar information is excellent
3.4 UAT Conclusion
The system meets all acceptance criteria:
✔ Easy to use
✔ Accurate predictions
✔ Helpful treatment suggestions
✔ Visually appealing UI
✔ Suitable for academic + real-world use
UAT test: PASSED