Test Workflow Guide

← Back to User Guide

VectorPredictor Test Workflow Guide

This guide provides a detailed, step-by-step workflow for testing the VectorPredictor system using the example data provided.

๐ŸŽฏ Test Objectives

By following this workflow, you will: - Understand the complete user journey - Test all major system features - Verify data processing and validation - Test the age prediction functionality - Learn how to interpret results

๐Ÿ“‹ Prerequisites

Before starting, ensure: - [ ] Django server is running on port 8001 - [ ] You have access to the example_spectra folder - [ ] All dependencies are installed (TensorFlow, XGBoost, etc.) - [ ] Database is properly migrated

๐Ÿš€ Step-by-Step Test Workflow

Phase 1: Initial Setup

Step 1.1: Access the Website

  1. Open your web browser
  2. Navigate to: http://127.0.0.1:8001/
  3. Verify the homepage loads correctly
  4. Check that all navigation links are visible

Expected Result: Homepage displays with navigation menu including Home, Mosquito, Location, Metadata, Spectra, Bioassay, About.

Step 1.2: Create User Account

  1. Click "Sign Up" or navigate to http://127.0.0.1:8001/signup/
  2. Fill in the registration form:
  3. Username: testuser
  4. Email: test@example.com
  5. Password: TestPassword123!
  6. Confirm Password: TestPassword123!
  7. Click "Create Account"
  8. Log in with your new credentials

Expected Result: Account created successfully, redirected to main page.

Phase 2: Basic Data Setup

Step 2.1: Add Mosquito Species

  1. Navigate to "Mosquito" in the main menu
  2. Click "Add Species" or similar button
  3. Add the following species:
  4. Anopheles gambiae s.l
  5. Anopheles funestus
  6. Culex quinquefasciatus
  7. Save each species

Expected Result: Species added to database, visible in species list.

Step 2.2: Add Body Parts

  1. Navigate to "Body Parts" or similar section
  2. Add the following body parts:
  3. head/thorax
  4. abdomen
  5. whole body
  6. Save each body part

Expected Result: Body parts added to database, visible in body parts list.

Step 2.3: Create Collection Location

  1. Navigate to "Location" in the main menu
  2. Click "Add Location" or "Create Location"
  3. Fill in location details:
  4. Name: Test Collection Site
  5. Latitude: -1.2921 (example: Nairobi, Kenya)
  6. Longitude: 36.8219
  7. Description: Test location for sample collection
  8. Save the location

Expected Result: Location created and visible in location list.

Phase 3: Metadata Creation

Step 3.1: Create Metadata Record

  1. Navigate to "Metadata" โ†’ "Create Metadata"
  2. Fill in the metadata form with the following data:

Basic Information: - Metadata Name: Test Sample 1 - Species: Select Anopheles gambiae s.l - Body Part: Select head/thorax - Location: Select Test Collection Site - Collection Date: Use today's date - Sex: Female - Origin: Laboratory

Environmental Conditions: - Storage Temperature: -20 (ยฐC) - Collection Temperature: 25 (ยฐC) - Humidity: 60 (%)

Biological Information: - Physiological Status: Sugar fed or unfed

Spectral Measurement Parameters: - Spectrometer: Bruker Alpha - Min Wavenumber: 400 - Max Wavenumber: 4000 - Scans per Spectrum: 16 - Spectral Resolution: 4 cmโปยน

  1. Click "Save Metadata"

Expected Result: Metadata record created successfully, validation messages appear if any issues.

Step 3.2: Verify Metadata

  1. Go to "Metadata" โ†’ "Metadata List"
  2. Verify your metadata record appears
  3. Click on the record to view details
  4. Check that all information is displayed correctly

Expected Result: Metadata record visible in list with all details preserved.

Phase 4: Spectral Data Upload

Step 4.1: Upload CSV Sample

  1. Navigate to "Spectra" โ†’ "Upload Spectra"
  2. Select the metadata record you just created
  3. Click "Choose Files" and select sample_csv.csv
  4. Click "Upload"
  5. Wait for processing to complete

Expected Result: File uploaded successfully, appears in spectra list.

Step 4.2: Upload TXT Sample

  1. Repeat the upload process with other samples (sample_txt.txt, sample_dat.dat, sample_dpt.dpt, sample_mzz.mzz)
  2. Use the same metadata record or create a new one

Expected Result: TXT file uploaded successfully.

Step 4.3: Test Different File Formats

  1. Try uploading files with different separators (comma, tab, space)
  2. Test with files that have different column names
  3. Verify the system handles various CSV/TXT formats correctly

Expected Result: System correctly identifies and processes different file formats.

Phase 5: Spectral Data Analysis

Step 5.1: View Uploaded Spectra

  1. Navigate to "Spectra" to see your uploaded files
  2. Click on one of the uploaded spectra
  3. Examine the spectral plot and data

Expected Result: Spectral plot displays correctly with wavenumber vs intensity.

Step 5.2: Check Quality Filters

  1. In the spectrum view, look for quality filter results:
  2. Low Intensity Filter
  3. Abnormal Background Filter
  4. Atmospheric Interference Filter
  5. Note which filters pass or fail

Expected Result: Quality indicators displayed with pass/fail status.

Step 5.3: View Spectral Data

  1. Scroll down to see the raw spectral data
  2. Verify the data matches your uploaded file
  3. Check that wavenumbers are in correct range

Expected Result: Raw data displayed in table format.

Phase 6: Age Prediction Testing

Step 6.1: Access Prediction Interface

  1. Navigate to "Predictions" or look for age prediction options
  2. Select a spectrum from your uploaded data
  3. Choose a predictive model (if multiple available)

Expected Result: Prediction interface loads with spectrum selection.

Step 6.2: Run Age Prediction

  1. Select the spectrum you want to analyse
  2. Click "Run Prediction" or similar button
  3. Wait for the model to process

Expected Result: Prediction results displayed with estimated age.

Step 6.3: Interpret Results

  1. Review the predicted age (in days)
  2. Check confidence scores or error margins
  3. Note any warnings or quality indicators

Expected Result: Clear prediction results with confidence metrics.

Phase 7: Advanced Testing

Step 7.1: Test Error Handling

  1. Try uploading an invalid file format
  2. Upload a file with missing data
  3. Test with empty metadata fields

Expected Result: Appropriate error messages displayed.

Step 7.2: Test Data Validation

  1. Create metadata with invalid values
  2. Try uploading files with wrong column names
  3. Test with files outside the expected wavenumber range

Expected Result: Validation errors prevent invalid data entry.

Step 7.3: Test Performance

  1. Upload larger spectral files with multiple spectra
  2. Test with files containing many spectra (batch processing)
  3. Monitor system response times

Expected Result: System handles larger datasets without issues.

๐Ÿ“Š Expected Results Summary

Successful Test Indicators

  • โœ… All pages load without errors
  • โœ… User registration and login work
  • โœ… Data entry forms accept valid input
  • โœ… File uploads complete successfully
  • โœ… Spectral plots display correctly
  • โœ… Quality filters provide meaningful results
  • โœ… Age predictions generate results
  • โœ… Error handling works appropriately

Quality Check Results

  • Low Intensity Filter: Should pass for good quality data
  • Background Filter: Should pass for clean spectra
  • Atmospheric Filter: Should pass for dry samples

Prediction Results

  • Age estimates should be reasonable (0-30 days for lab samples)
  • Confidence scores should be provided
  • Results should be reproducible

๐Ÿ”ง Troubleshooting Common Issues

If Pages Don't Load

  • Check Django server is running
  • Verify port 8001 is accessible
  • Check browser console for errors

If Uploads Fail

  • Verify file format is supported
  • Check file size is reasonable
  • Ensure no special characters in filenames

If Predictions Fail

  • Check TensorFlow/XGBoost are installed
  • Verify ML models are in correct location
  • Check server logs for error messages

If Data Quality Checks Fail

  • Review spectral data quality
  • Check for obvious artifacts
  • Verify file format compliance

๐Ÿ“ Test Documentation

Record Your Results

Create a test report with: - Date and time of testing - Browser and operating system used - Steps completed successfully - Any errors encountered - Performance observations - Suggestions for improvement

Sample Test Report Template

Test Date: [Date]
Tester: [Name]
Environment: [OS/Browser]

โœ… Completed Steps:
- [ ] User registration
- [ ] Basic data setup
- [ ] Metadata creation
- [ ] File uploads
- [ ] Spectral analysis
- [ ] Age predictions

โŒ Issues Found:
- [Description of any problems]

๐Ÿ“Š Performance Notes:
- [Response times, file sizes, etc.]

๐Ÿ’ก Suggestions:
- [Ideas for improvement]

๐ŸŽ‰ Completion Checklist

Before considering the test complete, verify: - [ ] All major features tested - [ ] Error handling verified - [ ] Performance acceptable - [ ] Results documented - [ ] Issues reported (if any) - [ ] System ready for real use


Congratulations! You have successfully tested the VectorPredictor system. This workflow demonstrates the complete user journey from data entry to age prediction, providing confidence that the system works as intended.