final_test / tests /README.md
Abdelrahman Almatrooshi
Deploy snapshot from main b7a59b11809483dfc959f196f1930240f2662c49
22a6915
# tests
Automated test suite managed by pytest with coverage tracking.
## Running
```bash
pytest
pytest --cov # with coverage report
```
Coverage configuration is in `.coveragerc`.
## Test files
| File | What it covers |
|------|---------------|
| `test_data_preparation.py` | Data loading, feature selection, stratified splits, scaler fitting, LOPO person dict construction |
| `test_models_clip_features.py` | Feature bounding: verifies clipping ranges for all 17 features match physiological limits (yaw +/-45, pitch +/-30, EAR [0, 0.85], MAR [0, 1.0]) |
| `test_pipeline_integration.py` | End-to-end ML pipeline: feature extraction through model inference, output shape validation, score range checks |
## What is tested
- Data pipeline produces correct shapes and splits
- Feature selection returns exactly the 10 expected features
- StandardScaler is fit on training data only
- Clipping bounds match `config/default.yaml` and `ui/pipeline.py`
- Pipeline classes produce valid focus scores in [0, 1]
- Model outputs have correct dimensions for batch inference