Files

54 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Unit Tests
브라우저에서 실행되는 결정론적 수치·계약 테스트입니다. 별도 Node.js test runner가 필요하지
않습니다.
## 실행
가장 간단한 자동 실행은 저장소 루트의 `test.cmd`입니다. 임시 local server와 headless Edge/Chrome을
실행하고 결과에 맞는 process exit code를 반환합니다.
수동 확인은 `start.cmd`를 실행한 뒤 최신 Edge 또는 Chrome에서
<http://127.0.0.1:4173/tests/>을 열어 페이지 상단의 통과/실패 합계와 각 결과를 확인합니다.
Unit과 integration module은 같은 browser runner에서 순서대로 실행됩니다. 다시 실행하려면 페이지를
새로 고치세요. 다른 포트를 사용했다면 URL의 포트도 바꾸며, `tests/index.html`을 파일로 직접 열면
안 됩니다.
## 범위
- `contracts.test.js`: Array·Scene·Experiment·Result schema, algorithm·scale·beam-spread 관계 검증,
안전한 asset 경로와 이동 fixture
- `acoustics.test.js`: seed 재현성, 자유음장 전파, trajectory 보간, sample 정렬 시간창과
tone/noise/asset 절대 시간 연속성, calibration, STFT, CPU DAS와 DAS-PHAT
- `gcc-phat.test.js`: reference 선택, near-field lag 부호, 광대역 source peak, alias·메모리
선할당 제한, 0–1 score bound·scan 범위 불변성과 geometry/STFT/IFFT workspace 재사용
- `localization.test.js`: 알고리즘 registry와 generic CPU/backend dispatcher, power/score
의미, portable GCC-PHAT block·streaming 경로
- `cfar.test.js`: CA/OS multiplier, nominal per-CUT Pfa, full symmetric reference,
모든 tested/untested bin과 zero-threshold JSON 상태
- `activity-monitor.test.js`: 단일 채널 complete-frame CFAR, raw frame×bin 보존,
deterministic workload·hard cap과 취소
- `spectral-flux.test.js`: Dixon Hamming/full-DFT raw novelty, causal peak picker,
latency, exact output preflight와 memory cap
- `realtime-localizer.test.js`: 기존 CPU DAS와 bit-exact map 동등성, chunk 경계 독립성,
bounded ring/result batch, 취소와 geometry·steering cache 연산 절감
- `builder.test.js`: Builder scene model, source/asset·trajectory 조작, 오디오 크기와 WAV 사전 검증
- `array-builder.test.js`: Array 문서 모델, 격자·선형·둘레·Fermat·seed random 프리셋,
최소 간격, 직접 채널 편집, calibration 보존과 geometry 진단
- `array-builder-canvas.test.js`: 동일 축척 좌표 왕복, y-up 변환, pointer clamp, hit test,
1/2/5 grid와 keyboard nudge
- `beam-pattern.test.js`: conventional receive array-factor 부호·raw complex/power, XY/XZ/YZ
좌표, analog Nyquist 초과 파장, front/back 동률, 조건부 HPBW, angular phase-step 해상도와
exact workload cap
- `evaluation.test.js`: local maximum·8-connected component·marker watershed peak 묶기,
검출 감도, truth matching, energy/sidelobe/main-lobe 및 비확률적 beam-spread covariance ellipse
- `camera.test.js`: canonical input hash, workload 추정, Scene 정렬의 분석 band 보존,
이동 timeline 계획·재생 보간, Result schema 검증
- `webgpu.test.js`: WGSL buffer packing, DAS-PHAT phase normalization, bin/point batching,
장치 한계와 typed CPU fallback 정책
- `split-pane.test.js`: 조절식 설정 패널의 포인터 좌표, 최소·최대 폭과 양쪽 배치
WebGPU unit test 대부분은 실제 GPU 없이 planner와 binary layout을 검증합니다. 실제 GPU 수치 일치는
integration test에서 adapter가 있을 때 수행합니다.