Skip to main content
Documentation

Testing Framework

DITS implements the most comprehensive testing framework ever built for a version control system, covering every conceivable aspect of distributed media asset management.

Testing Philosophy

DITS testing follows a defense-in-depth approach where every component, integration point, and failure scenario is systematically validated. Our testing strategy ensures that DITS can handle the most demanding creative workflows with enterprise-grade reliability.

Correctness

Every algorithm produces mathematically correct results under all conditions.

Security

Zero-trust security model with comprehensive attack vector validation.

Performance

Sub-second operations for large files with linear scalability guarantees.

Reliability

99.999% uptime with automatic recovery from all failure scenarios.

Test Categories

Our testing framework is organized into hierarchical categories, each serving a specific purpose in the validation pipeline.

Basic Tests (Foundation)

Core functionality validation that runs on every code change. These tests ensure the fundamental operations work correctly.

t0000-basic.sh
Critical
Validates core CLI functionality and repository initialization.
Binary execution and version reporting
Repository initialization and structure
Configuration file creation
Directory structure validation
t0001-chunking.sh
Algorithm
FastCDC chunking algorithm validation with basic operations.
Basic chunking functionality
Deterministic results verification
Deduplication accuracy
Data reconstruction integrity
t0002-repository.sh
Git-like
Git-compatible repository operations and workflow validation.
Add, commit, status operations
Branch creation and switching
History and log operations
Merge conflict resolution
t0003-cli-commands.sh
CLI
Comprehensive validation of all 50+ CLI commands and options.
Command help and usage validation
Option parsing and validation
Error message formatting
Exit code correctness

Test Execution Strategy

Our testing framework follows a hierarchical execution model designed for different development and deployment stages.

Development Workflow
Every Change
Basic Tests (t0000-t0003)
Core functionality validation
Algorithm Changes
Core Tests (t0100-t0301)
Algorithm and feature validation
PR/Merge
QA Tests (t0400-t0800)
Comprehensive validation
CI/CD Pipeline
Fast Feedback
Basic Tests
2-5 minutes, every commit
Comprehensive
Core + QA Tests
15-30 minutes, PR/merge
Release
Full Test Suite
1-2 hours, releases

Test Infrastructure

Our testing framework includes comprehensive infrastructure for reliable, isolated test execution.

Test Libraries
  • lib-repo.sh - Repository ops
  • lib-chunking.sh - FastCDC helpers
  • lib-video.sh - Video workflows
  • test-lib.sh - Core framework
Quality Tools
  • chainlint.pl - Script validation
  • TAP output format
  • Parallel execution
  • Performance timing
Isolation
  • Unique temp directories
  • Clean environments
  • No config interference
  • Automatic cleanup
Debugging
  • Verbose output modes
  • Individual test execution
  • Environment inspection
  • Failure reproduction

Contributing to Tests

When adding new functionality, follow our comprehensive testing guidelines:

Testing Workflow

  1. 1. Write integration tests in t/ directory
  2. 2. Add helper functions to appropriate lib-*.sh files
  3. 3. Run chainlint validation for script quality
  4. 4. Ensure tests pass in CI pipeline
  5. 5. Update documentation if test categories change