Files
ai-training/_docs/02_document/tests/resilience-tests.md
T
Oleksandr Bezdieniezhnykh 142c6c4de8 Refactor constants management to use Pydantic BaseModel for configuration
- Replaced module-level path variables in constants.py with a structured Pydantic Config class.
- Updated all relevant modules (train.py, augmentation.py, exports.py, dataset-visualiser.py, manual_run.py) to access paths through the new config structure.
- Fixed bugs related to image processing and model saving.
- Enhanced test infrastructure to accommodate the new configuration approach.

This refactor improves code maintainability and clarity by centralizing configuration management.
2026-03-27 18:18:30 +02:00

1.8 KiB

Resilience Test Scenarios

RT-AUG-01: Augmentation handles corrupted image gracefully

  • Input: 1 valid image + 1 corrupted image file (truncated JPEG) in data/ dir
  • Action: Run augment_annotations()
  • Expected: Valid image produces 8 outputs; corrupted image skipped without crashing pipeline; total output: 8 files
  • Traces: Restriction: Augmentation exception handling per-image

RT-AUG-02: Augmentation handles missing label file

  • Input: 1 image with no matching label file
  • Action: Run augment_annotation() on the image
  • Expected: Exception caught per-thread; does not crash pipeline
  • Traces: Restriction: Augmentation exception handling

RT-AUG-03: Augmentation transform failure produces fewer variants

  • Input: 1 image + label that causes some transforms to fail (extremely narrow bbox)
  • Action: Run augment_inner()
  • Expected: Returns 1-8 ImageLabel objects (original always present; failed variants skipped); no crash
  • Traces: Restriction: Transform failure handling

RT-DSF-01: Dataset formation with empty processed directory

  • Input: Empty processed images dir
  • Action: Run form_dataset()
  • Expected: Creates empty train/valid/test directories; no crash
  • Traces: Restriction: Edge case handling

RT-ENC-01: Decrypt with corrupted ciphertext

  • Input: Randomly modified ciphertext bytes
  • Action: Security.decrypt_to(corrupted_bytes, key)
  • Expected: Either raises exception or returns garbage bytes (not original)
  • Traces: AC: Encryption integrity

RT-AQM-01: Malformed msgpack message

  • Input: Random bytes that aren't valid msgpack
  • Action: Pass to message handler
  • Expected: Exception caught; handler doesn't crash
  • Traces: AC: Error handling for malformed messages