Skip to content

Unit Testing

Mirza Sneha edited this page Mar 24, 2026 · 1 revision

The FindMySpot project includes comprehensive testing to ensure that all major components of the system function correctly and reliably. Unit testing, functional testing, and integration testing were performed across the backend, AI detection system, and frontend interactions to validate both individual features and overall system behavior.

A dedicated testing script (test_system.py) was developed to simulate real-world usage and verify the correctness of core system functionalities. This script tests multiple modules, including:

  • API health and connectivity
  • User registration and authentication
  • Vehicle registration and retrieval
  • License plate detection recording
  • Detection history tracking
  • Notification system functionality

Each test validates that specific endpoints behave correctly and return expected outputs. For example, API endpoints such as /api/auth/register, /api/vehicles, /api/detection/record, and /api/notifications are tested to ensure proper request handling, correct data storage, and accurate responses.

The testing process also includes validation of edge cases and error handling. Scenarios such as invalid inputs, unregistered license plates, failed API requests, and incorrect data formats were tested to confirm that the system handles errors gracefully and maintains stability under unexpected conditions. This demonstrates strong coverage of both normal and abnormal use cases.

In addition to backend testing, the AI-based detection system includes built-in validation logic. The detection pipeline uses OpenCV and OCR to identify potential license plate candidates, applies filtering rules based on size, aspect ratio, and confidence thresholds, and uses a time-window consensus mechanism to finalize detections. This ensures that only reliable and accurate detections are processed and sent to the backend.

The frontend was also tested to ensure correct interaction with backend services. The user interface allows users to search for vehicles and manually check in vehicles, and these interactions were validated by confirming correct API requests and responses. The frontend communicates with backend endpoints such as /api/parking/locate and /api/detection/record, ensuring that user inputs are properly processed and displayed. Testing was performed continuously throughout development, particularly after implementing major features such as detection recording, notifications, and parking history. This ensured that new features did not introduce regressions or break existing functionality.

Overall, the FindMySpot project demonstrates strong unit and functional testing coverage by validating individual components, handling edge cases, and ensuring proper integration between frontend, backend, AI, and database systems. This testing approach significantly improves system reliability and correctness.

Clone this wiki locally