Test Plan

Introduction

This test plan covers MVP requirements (49 functional requirements, 22 non-functional requirements).

Test Strategy

Test Levels

Level

Scope

Tools

Unit

Individual functions

Rust #[test]

Integration

Component interactions

Rust integration tests

System

End-to-end workflows

Manual testing

Features Not Tested

Feature

Reason

USB hardware failures

External dependency

Filesystem internals

Platform dependency

Tar format compliance

Third-party library

Test Automation Approach

MVP: Manual testing primarily. Unit tests for core logic.

Unit tests (automatable):

Component

What to Test

chunker.rs

Chunk size calculations, streaming logic

verifier.rs

Checksum generation and verification

manifest.rs

JSON serialization, state management

Integration tests (partially automatable):

Test

Automation Notes

Pack + Unpack workflow

Use temp directories

Manifest persistence

In-memory filesystem

Checksum verification

Known test vectors

System tests (manual only):

Test

Why Manual

USB detection

Requires physical USB hardware

Cross-platform behavior

Requires multiple test machines

Large file handling

Time-intensive, requires disk space

Resume after interruption

Requires manual interruption

Test Cases by Category

Pack Operation Tests

ID

Title

Tests

Priority

TC-PCK-001

Pack Single File into Chunks

FR-TRANSFER-001

high

TC-PCK-002

Pack Directory into Chunks

FR-TRANSFER-001

high

TC-PCK-003

Auto-Detect USB Capacity

FR-TRANSFER-002

high

TC-PCK-004

Generate Chunk Checksums

FR-TRANSFER-003

high

TC-PCK-005

Create Manifest File

FR-TRANSFER-004

high

TC-PCK-006

Stream Without Temp Files

FR-TRANSFER-005

high

TC-PCK-007

Manual Chunk Size Specification

FR-TRANSFER-006

medium

TC-PCK-008

Progress Reporting

FR-TRANSFER-007

medium

TC-PCK-009

USB Swapping Prompt

FR-TRANSFER-008

medium

TC-STA-003

Resume Interrupted Pack

FR-TRANSFER-026

medium

TC-TRANSFER-CLI-001

Pack Command Syntax

FR-TRANSFER-028

high

TC-TRANSFER-NFR-001

Pack 10GB in < 10 Minutes

NFR-TRANSFER-001

high

Test Case: Pack Single File into Chunks TC-PCK-001
status: approved
tags: transfer, pack, chunking
priority: high
release: v1.0

Verify pack operation splits single file into chunks

Test Case: Pack Directory into Chunks TC-PCK-002
status: approved
tags: transfer, pack, directory
priority: high
release: v1.0

Verify pack operation handles directory with multiple files

Test Case: Auto-Detect USB Capacity TC-PCK-003
status: approved
tags: transfer, pack, usb
priority: high
release: v1.0

Verify automatic detection of USB drive capacity

Test Case: Generate Chunk Checksums TC-PCK-004
status: approved
tags: transfer, pack, checksum
priority: high
release: v1.0

Verify checksums generated for each chunk using the configured hash algorithm

Test Case: Create Manifest File TC-PCK-005
status: approved
tags: transfer, pack, manifest
priority: high
release: v1.0

Verify manifest file creation with chunk metadata

Test Case: Stream Without Temp Files TC-PCK-006
status: approved
tags: transfer, pack, streaming
priority: high
release: v1.0

Verify pack operation streams data without intermediate temp files

Test Case: Manual Chunk Size Specification TC-PCK-007
status: approved
tags: transfer, pack, chunk-size
priority: medium
release: v1.0

Verify manual chunk size override functionality

Test Case: Progress Reporting TC-PCK-008
status: approved
tags: transfer, pack, progress
priority: medium
release: v1.0

Verify progress reporting during pack operation

Test Case: USB Swapping Prompt TC-PCK-009
status: approved
tags: transfer, pack, usb, ui
priority: medium
release: v1.0

Verify system prompts for USB swapping when multiple chunks needed

Unpack Operation Tests

ID

Title

Tests

Priority

TC-CRA-004

Unpack Uses Manifest Algorithm

FR-TRANSFER-046

high

TC-STA-004

Resume Interrupted Unpack

FR-TRANSFER-027

medium

TC-TRANSFER-CLI-002

Unpack Command Syntax

FR-TRANSFER-029

high

TC-UNP-001

Reconstruct Files from Chunks

FR-TRANSFER-009

high

TC-UNP-002

Verify Chunk Checksums

FR-TRANSFER-010

high

TC-UNP-003

Place Files in Destination

FR-TRANSFER-011

high

TC-UNP-004

Validate Chunk Completeness

FR-TRANSFER-012

high

TC-UNP-005

Resume Partial Unpack

FR-TRANSFER-013

medium

TC-UNP-006

Delete Chunks After Unpack

FR-TRANSFER-014

medium

TC-UNP-007

Unpack Progress Display

FR-TRANSFER-015

medium

Test Case: Reconstruct Files from Chunks TC-UNP-001
status: approved
tags: transfer, unpack, reconstruction
priority: high
release: v1.0

Verify unpack reconstructs original files from chunks

Test Case: Verify Chunk Checksums TC-UNP-002
status: approved
tags: transfer, unpack, checksum
priority: high
release: v1.0

Verify chunk checksums before reconstruction

Test Case: Place Files in Destination TC-UNP-003
status: approved
tags: transfer, unpack, destination
priority: high
release: v1.0

Verify files placed in correct destination directory

Test Case: Validate Chunk Completeness TC-UNP-004
status: approved
tags: transfer, unpack, validation
priority: high
release: v1.0

Verify all required chunks present before unpack

Test Case: Resume Partial Unpack TC-UNP-005
status: approved
tags: transfer, unpack, resume
priority: medium
release: v1.0

Verify unpack can resume after interruption

Test Case: Delete Chunks After Unpack TC-UNP-006
status: approved
tags: transfer, unpack, cleanup
priority: medium
release: v1.0

Verify optional chunk deletion after successful unpack

Test Case: Unpack Progress Display TC-UNP-007
status: approved
tags: transfer, unpack, ui, progress
priority: medium
release: v1.0

Verify progress reporting during file reconstruction

List Operation Tests

ID

Title

Tests

Priority

TC-LST-001

Display Chunk Inventory

FR-TRANSFER-016

high

TC-LST-002

Show Chunk Sizes and Status

FR-TRANSFER-017

high

TC-LST-003

Identify Missing Chunks

FR-TRANSFER-018

medium

TC-LST-004

Show Estimated Total Size

FR-TRANSFER-019

medium

TC-TRANSFER-CLI-003

List Command Syntax

FR-TRANSFER-030

high

Test Case: Display Chunk Inventory TC-LST-001
status: approved
tags: transfer, list, inventory
priority: high
release: v1.0

Verify list command displays all available chunks

Test Case: Show Chunk Sizes and Status TC-LST-002
status: approved
tags: transfer, list, status
priority: high
release: v1.0

Verify list shows chunk sizes and completion status

Test Case: Identify Missing Chunks TC-LST-003
status: approved
tags: transfer, list, missing
priority: medium
release: v1.0

Verify list identifies missing chunks from manifest

Test Case: Show Estimated Total Size TC-LST-004
status: approved
tags: transfer, list, size
priority: medium
release: v1.0

Verify list shows estimated total transfer size

Integrity Tests

ID

Title

Tests

Priority

TC-INT-001

Generate SHA-256 Checksums

FR-TRANSFER-020

critical

TC-INT-002

Verify Checksums During Unpack

FR-TRANSFER-021

critical

TC-INT-003

Detect Corrupted Chunks

FR-TRANSFER-022

critical

TC-INT-004

Verify Final File Integrity

FR-TRANSFER-023

high

TC-TRANSFER-NFR-007

Checksum Verification Reliability

NFR-TRANSFER-007

critical

TC-TRANSFER-NFR-010

Data Corruption Detection

NFR-TRANSFER-010

critical

Test Case: Generate SHA-256 Checksums TC-INT-001
status: approved
tags: transfer, integrity, checksum
priority: critical
release: v1.0

Verify checksums generated for all chunks using the configured hash algorithm

Test Case: Verify Checksums During Unpack TC-INT-002
status: approved
tags: transfer, integrity, verification
priority: critical
release: v1.0

Verify checksums validated during unpack operation

Test Case: Detect Corrupted Chunks TC-INT-003
status: approved
tags: transfer, integrity, corruption
priority: critical
release: v1.0

Verify corrupted chunks detected via checksum mismatch

Test Case: Verify Final File Integrity TC-INT-004
status: approved
tags: transfer, integrity, final
priority: high
release: v1.0

Verify final reconstructed file integrity matches original

Cryptographic Agility Tests

ID

Title

Tests

Priority

TC-CRA-001

Select Hash Algorithm via CLI

FR-TRANSFER-045

high

TC-CRA-002

Default Hash Algorithm

FR-TRANSFER-045

high

TC-CRA-003

Algorithm Recorded in Manifest

FR-TRANSFER-046

high

TC-CRA-004

Unpack Uses Manifest Algorithm

FR-TRANSFER-046

high

TC-CRA-005

Pluggable Hash Backend Interface

FR-TRANSFER-047

high

TC-CRA-006

Invalid Algorithm Rejected

FR-TRANSFER-045

medium

TC-TRANSFER-NFR-022

Cryptographic Agility Architecture

NFR-TRANSFER-022

high

Test Case: Select Hash Algorithm via CLI TC-CRA-001
status: approved
tags: transfer, crypto-agility, cli
priority: high
release: v1.0

Preconditions: Application built and available

Steps:

  1. Run airgap-transfer pack <source> <dest> --hash-algorithm sha256

  2. Verify pack completes and manifest shows "hash_algorithm": "sha256"

  3. Repeat with a different supported algorithm (e.g., sha512)

  4. Verify manifest reflects the selected algorithm

Pass Criteria: Checksums generated using the user-specified algorithm; manifest records the correct algorithm identifier.

Test Case: Default Hash Algorithm TC-CRA-002
status: approved
tags: transfer, crypto-agility, cli
priority: high
release: v1.0

Preconditions: Application built and available

Steps:

  1. Run airgap-transfer pack <source> <dest> without --hash-algorithm

  2. Inspect manifest file

Pass Criteria: Default algorithm is SHA-256; manifest shows "hash_algorithm": "sha256".

Test Case: Algorithm Recorded in Manifest TC-CRA-003
status: approved
tags: transfer, crypto-agility, manifest
priority: high
release: v1.0

Preconditions: Pack completed with a non-default algorithm

Steps:

  1. Pack with --hash-algorithm sha512

  2. Read manifest JSON

  3. Verify hash_algorithm field is "sha512"

  4. Verify each chunk checksum prefix matches (e.g., sha512:...)

Pass Criteria: Manifest correctly identifies the algorithm used; checksum prefixes are consistent.

Test Case: Unpack Uses Manifest Algorithm TC-CRA-004
status: approved
tags: transfer, crypto-agility, unpack
priority: high
release: v1.0

Preconditions: Chunks packed with a non-default algorithm

Steps:

  1. Pack with --hash-algorithm sha512

  2. Run airgap-transfer unpack (without specifying algorithm)

  3. Verify unpack reads algorithm from manifest and verifies correctly

Pass Criteria: Unpack automatically uses the algorithm recorded in the manifest; verification succeeds.

Test Case: Pluggable Hash Backend Interface TC-CRA-005
status: approved
tags: transfer, crypto-agility, architecture
priority: high
release: v1.0

Preconditions: Source code available

Steps:

  1. Verify HashAlgorithm trait exists with required methods (hash, verify, algorithm identifier)

  2. Verify SHA-256 backend implements the trait

  3. Verify adding a new backend requires only implementing the trait (no changes to chunker, manifest, or CLI modules)

Pass Criteria: Trait-based interface exists; multiple backends can coexist; new backends do not require changes to other modules.

Test Case: Invalid Algorithm Rejected TC-CRA-006
status: approved
tags: transfer, crypto-agility, error
priority: medium
release: v1.0

Preconditions: Application built and available

Steps:

  1. Run airgap-transfer pack <source> <dest> --hash-algorithm unsupported

  2. Observe error output

Pass Criteria: Clear error message listing supported algorithms; operation does not proceed.

State Management Tests

ID

Title

Tests

Priority

TC-STA-001

Persist Operation State

FR-TRANSFER-024

high

TC-STA-002

Track Chunk Completion

FR-TRANSFER-025

high

TC-STA-003

Resume Interrupted Pack

FR-TRANSFER-026

medium

TC-STA-004

Resume Interrupted Unpack

FR-TRANSFER-027

medium

Test Case: Persist Operation State TC-STA-001
status: approved
tags: transfer, state, persistence
priority: high
release: v1.0

Verify operation state persisted to disk

Test Case: Track Chunk Completion TC-STA-002
status: approved
tags: transfer, state, tracking
priority: high
release: v1.0

Verify chunk completion tracked in state file

Test Case: Resume Interrupted Pack TC-STA-003
status: approved
tags: transfer, state, resume, pack
priority: medium
release: v1.0

Verify pack operation can resume after interruption

Test Case: Resume Interrupted Unpack TC-STA-004
status: approved
tags: transfer, state, resume, unpack
priority: medium
release: v1.0

Verify unpack operation can resume after interruption

Command Interface Tests

ID

Title

Tests

Priority

TC-CRA-001

Select Hash Algorithm via CLI

FR-TRANSFER-045

high

TC-CRA-002

Default Hash Algorithm

FR-TRANSFER-045

high

TC-TRANSFER-CLI-001

Pack Command Syntax

FR-TRANSFER-028

high

TC-TRANSFER-CLI-002

Unpack Command Syntax

FR-TRANSFER-029

high

TC-TRANSFER-CLI-003

List Command Syntax

FR-TRANSFER-030

high

TC-TRANSFER-CLI-004

Dry-Run Mode

FR-TRANSFER-031

high

TC-TRANSFER-CLI-005

No-Verify Flag

FR-TRANSFER-032

high

TC-TRANSFER-CLI-006

Chunk Size Flag

FR-TRANSFER-033

medium

TC-TRANSFER-CLI-007

Verbose Flag

FR-TRANSFER-034

medium

TC-TRANSFER-NFR-013

Help Text Availability

NFR-TRANSFER-013

high

Test Case: Pack Command Syntax TC-TRANSFER-CLI-001
status: approved
tags: transfer, cli, pack
priority: high
release: v1.0

Verify pack command accepts correct syntax and arguments

Test Case: Unpack Command Syntax TC-TRANSFER-CLI-002
status: approved
tags: transfer, cli, unpack
priority: high
release: v1.0

Verify unpack command accepts correct syntax and arguments

Test Case: List Command Syntax TC-TRANSFER-CLI-003
status: approved
tags: transfer, cli, list
priority: high
release: v1.0

Verify list command accepts correct syntax and arguments

Test Case: Dry-Run Mode TC-TRANSFER-CLI-004
status: approved
tags: transfer, cli, dry-run
priority: high
release: v1.0

Verify dry-run mode previews operation without execution

Test Case: No-Verify Flag TC-TRANSFER-CLI-005
status: approved
tags: transfer, cli, verify
priority: high
release: v1.0

Verify that checksum verification is enabled by default and that the –no-verify flag disables it

Test Case: Chunk Size Flag TC-TRANSFER-CLI-006
status: approved
tags: transfer, cli, configuration
priority: medium
release: v1.0

Verify –chunk-size flag allows manual chunk size specification

Test Case: Verbose Flag TC-TRANSFER-CLI-007
status: approved
tags: transfer, cli, logging
priority: medium
release: v1.0

Verify –verbose flag enables detailed output logging

Error Handling Tests

ID

Title

Tests

Priority

TC-CRA-006

Invalid Algorithm Rejected

FR-TRANSFER-045

medium

TC-TRANSFER-ERR-001

Insufficient USB Capacity Error

FR-TRANSFER-035

high

TC-TRANSFER-ERR-002

Missing Chunks Error

FR-TRANSFER-036

high

TC-TRANSFER-ERR-003

Clear Error Messages

FR-TRANSFER-037

high

Test Case: Insufficient USB Capacity Error TC-TRANSFER-ERR-001
status: approved
tags: transfer, error, usb
priority: high
release: v1.0

Verify error when USB capacity insufficient for chunk

Test Case: Missing Chunks Error TC-TRANSFER-ERR-002
status: approved
tags: transfer, error, missing
priority: high
release: v1.0

Verify error when required chunks missing during unpack

Test Case: Clear Error Messages TC-TRANSFER-ERR-003
status: approved
tags: transfer, error, usability
priority: high
release: v1.0

Verify all error messages clear and actionable

Safety Tests

ID

Title

Tests

Priority

TC-SAF-001

Confirm File Overwrite

FR-TRANSFER-038

high

TC-SAF-002

Validate Destination Paths

FR-TRANSFER-039

high

TC-SAF-003

USB Sync Before Removal

FR-TRANSFER-040

high

TC-SAF-004

Atomic Operations

FR-TRANSFER-041

high

Test Case: Confirm File Overwrite TC-SAF-001
status: approved
tags: transfer, safety, overwrite
priority: high
release: v1.0

Verify confirmation required before overwriting existing files

Test Case: Validate Destination Paths TC-SAF-002
status: approved
tags: transfer, safety, validation
priority: high
release: v1.0

Verify destination paths validated before write

Test Case: USB Sync Before Removal TC-SAF-003
status: approved
tags: transfer, safety, sync
priority: high
release: v1.0

Verify USB synced before prompting for removal

Test Case: Atomic Operations TC-SAF-004
status: approved
tags: transfer, safety, reliability
priority: high
release: v1.0

Verify operations are atomic where possible (no partial state on failure)

Deployment Tests

Test Case: Offline Build Dependencies TC-TRANSFER-DEP-001
status: approved
tags: transfer, deployment, offline
priority: critical
release: v1.0

Verify all dependencies available for offline build via cargo vendor

Test Case: Internet-Free Build TC-TRANSFER-DEP-002
status: approved
tags: transfer, deployment, offline
priority: critical
release: v1.0

Verify build process works without internet after initial setup

Test Case: Single Static Binary Deployment TC-TRANSFER-DEP-003
status: approved
tags: transfer, deployment
priority: high
release: v1.0

Verify deployment produces single, static binary with no external dependencies

Non-Functional Tests

ID

Title

Tests

Priority

TC-TRANSFER-NFR-001

Pack 10GB in < 10 Minutes

NFR-TRANSFER-001

high

TC-TRANSFER-NFR-002

Memory Usage < 100 MB

NFR-TRANSFER-002

medium

TC-TRANSFER-NFR-020

Streaming Architecture Verification

NFR-TRANSFER-020

high

TC-TRANSFER-NFR-021

Concurrent Chunk Processing

NFR-TRANSFER-021

low

Test Case: Pack 10GB in < 10 Minutes TC-TRANSFER-NFR-001
status: approved
tags: transfer, performance, pack
priority: high
release: v1.0

Verify 10GB file packs in under 10 minutes

Test Case: Memory Usage < 100 MB TC-TRANSFER-NFR-002
status: approved
tags: transfer, performance, memory
priority: medium
release: v1.0

Verify memory usage stays under 100 MB during operations

Test Case: Offline Functionality TC-TRANSFER-NFR-003
status: approved
tags: transfer, offline, privacy
priority: critical
release: v1.0

Verify 100% functionality with network disconnected

Test Case: Cross-Platform Compatibility TC-TRANSFER-NFR-004
status: approved
tags: transfer, portability, cross-platform
priority: high
release: v1.0

Verify functionality on Linux, macOS, Windows

Test Case: Privacy Guarantee Verification TC-TRANSFER-NFR-005
status: approved
tags: transfer, privacy, security
priority: critical
release: v1.0

Verify no network calls under any circumstance (monitor with network sniffer)

Test Case: Air-Gap Deployment Test TC-TRANSFER-NFR-006
status: approved
tags: transfer, deployment, offline
priority: critical
release: v1.0

Verify build and execution on air-gapped system with vendored dependencies

Test Case: Checksum Verification Reliability TC-TRANSFER-NFR-007
status: approved
tags: transfer, reliability, integrity
priority: critical
release: v1.0

Verify all chunks verified with the manifest-specified hash algorithm before reconstruction

Test Case: Idempotent Pack Operation TC-TRANSFER-NFR-008
status: approved
tags: transfer, reliability
priority: high
release: v1.0

Verify running pack operation multiple times produces same output without errors

Test Case: Graceful Interruption Handling TC-TRANSFER-NFR-009
status: approved
tags: transfer, reliability, error-handling
priority: high
release: v1.0

Verify Ctrl+C during pack/unpack allows resume without data loss

Test Case: Data Corruption Detection TC-TRANSFER-NFR-010
status: approved
tags: transfer, reliability, integrity
priority: critical
release: v1.0

Verify corrupted chunks detected via checksum mismatch with clear error message

Test Case: Progress Indicator Display TC-TRANSFER-NFR-011
status: approved
tags: transfer, usability, ui
priority: medium
release: v1.0

Verify progress indicators shown for operations >2 seconds

Test Case: Error Message Clarity TC-TRANSFER-NFR-012
status: approved
tags: transfer, usability, error-handling
priority: high
release: v1.0

Verify error messages include failure details and suggested fixes

Test Case: Help Text Availability TC-TRANSFER-NFR-013
status: approved
tags: transfer, usability, cli
priority: high
release: v1.0

Verify –help flag provides comprehensive help for all commands

Test Case: First-Time User Experience TC-TRANSFER-NFR-014
status: approved
tags: transfer, usability
priority: medium
release: v1.0

Verify new user can transfer file in <5 minutes using provided examples

Test Case: Test Coverage Verification TC-TRANSFER-NFR-015
status: approved
tags: transfer, maintainability, testing
priority: high
release: v1.0

Verify codebase achieves ≥80% test coverage via cargo tarpaulin

Test Case: API Documentation Completeness TC-TRANSFER-NFR-016
status: approved
tags: transfer, maintainability, documentation
priority: high
release: v1.0

Verify all public APIs have rustdoc documentation

Test Case: Clippy Compliance Check TC-TRANSFER-NFR-017
status: approved
tags: transfer, maintainability, code-quality
priority: high
release: v1.0

Verify cargo clippy passes with zero warnings

Test Case: Code Formatting Check TC-TRANSFER-NFR-018
status: approved
tags: transfer, maintainability, code-quality
priority: high
release: v1.0

Verify code formatted with rustfmt (cargo fmt –check)

Test Case: Large File Support TC-TRANSFER-NFR-019
status: approved
tags: transfer, scalability
priority: medium
release: v1.0

Verify successful pack/unpack of 100GB file

Test Case: Streaming Architecture Verification TC-TRANSFER-NFR-020
status: approved
tags: transfer, scalability, performance
priority: high
release: v1.0

Verify files larger than RAM handled via streaming (monitor memory usage)

Test Case: Concurrent Chunk Processing TC-TRANSFER-NFR-021
status: approved
tags: transfer, scalability, performance
priority: low
release: v1.0

Verify concurrent chunk verification improves performance

Test Case: Cryptographic Agility Architecture TC-TRANSFER-NFR-022
status: approved
tags: transfer, security, crypto-agility
priority: high
release: v1.0

Preconditions: Source code and built binary available

Steps:

  1. Verify hash module uses a trait-based interface (HashAlgorithm trait)

  2. Pack data with SHA-256 (default), verify checksums

  3. Pack same data with an alternative algorithm, verify checksums

  4. Verify both manifests are structurally identical except for algorithm and checksum values

  5. Verify unpack correctly handles both manifests without user intervention

Pass Criteria: Multiple hash algorithms supported through a common interface; no architectural changes required to add a new algorithm.

Test Procedures

Offline Operation Test (TC-TRANSFER-NFR-003)

Preconditions:

  • App installed

  • Network disconnected (airplane mode or an air-gapped system)

Steps:

  • Disconnect network

  • Pack 1GB test dataset

  • Unpack and verify

  • Check all operations completed

Pass Criteria: All operations complete successfully with no network.

Checksum Verification Test (TC-INT-003)

Preconditions:

  • Valid chunk files

  • Manifest with checksums

Steps:

  • Corrupt one chunk file (modify 1 byte)

  • Run unpack operation

  • Verify error is reported

  • Confirm unpack aborts

Pass Criteria: Corrupted chunk detected, unpack aborted with clear error.

Pass/Fail Criteria

  • All Critical tests must pass before release

  • All High priority tests must pass before release

  • Medium priority tests: 90% pass rate acceptable