← TinyGPT · docs · devlog · roadmap · speedup
source: docs/test-coverage.md · view on GitHub ↗

Test Coverage Goals — tinygpt

Tier: EXEMPLARY

tinygpt targets EXEMPLARY test coverage across all three runtimes: Swift (native Mac), Python (reference impl), and TypeScript (browser).

Coverage Targets

ComponentTargetFrameworkCI Gate
Swift (TinyGPTModel)>80% lineXCTest + xccovReports (gate TBD)
Swift (TinyGPTIO)>85% lineXCTest + xccovReports (gate TBD)
Python (python_ref/)>70% lineunittest + coverageReports
TypeScript (browser/src/)>75% lineVitest + v8 coverageReports

CI Integration

Swift coverage

Python coverage

TypeScript coverage

Running Coverage Locally

Swift

cd native-mac
xcodebuild test \
  -scheme TinyGPT-Package \
  -destination 'platform=macOS' \
  -resultBundlePath /tmp/test-result.xcresult \
  CLANG_ENABLE_CODE_COVERAGE=YES
xcrun xccov view --report /tmp/test-result.xcresult

Python

pip install coverage
coverage run --source=python_ref tests/test_phase1.py
coverage run --source=python_ref --append tests/test_lora.py
coverage report -m

TypeScript (browser)

cd browser
npm test:coverage

Test Inventory

Swift (181+ tests across 28 files)

Python (14+ tests across 2 files)

TypeScript (54 tests across 4 files)

Eval smoke tests (24 bash scripts)