SPB Git

Repository Public License

testing.md 7.6 KB

# Testing

# Summary

Suite Runs on Count Last result
Engine tests (Packages/ORIXCameraKit/Tests) host Mac 108 see the README's Release Status
App-hosted unit tests (Tests/) iOS Simulator 22 same
UI tests (UITests/) iOS Simulator, virtual camera 27 iPhone: 27 of 27 passed · iPad: 27 of 27 passed
Physical device — 0 never run

Date of the last full run: 2026-11-21. Code coverage was not measured.

# What "tested" means here

There are three levels, and they must not be confused.

  1. Engine verified. An algorithm or file operation is checked against a known answer on the Mac. Example: the histogram of a solid colour has exactly one non-zero bin per channel.
  2. Pipeline verified in the Simulator. The app is driven through its interface; frames come from the synthetic scene through VirtualCameraBackend; everything downstream is the production code: pipeline, Metal monitor, analysis, recorder, accumulators, fusion, storage, index, library, editor, export.
  3. Hardware verified. A real camera, on a real device. Nothing is at this level. DeviceCameraBackend compiles for iOS and has never executed.

# Engine tests

Scripts/build.sh kit (or swift test in the package). Swift Testing.

File Covers
MonitoringTests.swift histogram exactness, clipping fractions, single-channel clipping, smoothing, format rejection; focus score sharp vs defocused, flat field, edge mask, threshold formula; zebra levels and coverage; Metal monitor pass-through, 90° rotation, mirroring, fit and fill, zebra pixels, shadow warning, GPU peaking against the CPU reference (over 99.5 % agreement), monochrome, LUT, clipping warning, false colour, magnifier; .cube parsing and errors; built-in looks
ComputationalTests.swift accumulator mean, maximum, size rejection, light trails, motion blur, 16-bit precision; night stack PSNR gain, ghost rejection, shifted merge; registration of known translations and rejection of implausible ones; pyramid reconstruction, fusion identity, fusion of a two-zone bracket, errors
EditingTests.swift identity recipe, one stop of exposure in linear light, temperature and tint direction, saturation, contrast, monochrome, tone curve monotonicity, sharpening vs noise reduction, vignette, geometry sizes, rotation and flip pixel positions, straighten without empty corners, preview and 16-bit renders; recipe JSON, history, bounded history, presets, RAW developer rejections
MediaTests.swift metadata fields present and absent, video metadata; every export format round trip, resize, quality, colour space, metadata policies, byte-identical original, file names, 16-bit depth, video passthrough and re-encode; recorder for H.264, HEVC and ProRes, time-lapse retiming, audio track, drop accounting, empty recording; storage atomicity, names, adoption, thumbnails; library CRUD, search, albums, delete, reconcile, persistence, duplicates; exposure maths, blur risk, storage estimates, scene assessment, white balance gains, colour cast; grids, aspect guides, level; capture geometry against rendered pixels; capabilities
LibraryFeatureTests.swift RAW settings in the recipe, crop geometry (CropMath)

Test inputs are generated: solid colours, ramps, checkerboards, an aperiodic value-noise texture for registration, seeded Gaussian noise, and the synthetic scene. No photograph is stored in the repository.

# App-hosted unit tests

Tests/LibraryEditorExportTests.swift: the editor session (commit, undo, redo, reset, presets keep geometry, crop normalisation), export flows writing real files from a seeded in-memory library, metadata rows only for present fields, library selection and deletion.

# UI tests

Scripts/build.sh uitest runs the app-hosted unit tests and the UI tests, and exports screenshots and failure attachments to build/shots/<simulator>/.

ORIXCameraUITests.swift (camera):

Test Asserts
first launch welcome screen, then the running camera
Auto captures no manual strip; library count goes 0 → 1 → 2
tap to focus, compensation the slider changes the value
self-timer nothing captured during the countdown; one capture after
manual controls the ISO the camera reports changes after the dial moves; AUTO restores the metered value; shutter, white-balance preset (3200K) and manual focus likewise
unavailable formats RAW and ProRAW are disabled in the Simulator and the reason is on screen; JPEG can be chosen
tools sheet peaking and zebra toggles; the zebra coverage badge appears
lens switching telephoto selected; front cameras listed on their own
recording REC badge; modes locked while recording; one movie saved
video format 4K and H.264 reflected in the top bar
long exposure, light trails (stopped early), night stack, bracket fusion, time-lapse, intervalometer (5 shots) each ends with the expected number of library items
analysis panel present; false colour and clipping toggles; capture works
every mode reachable each mode selected with the camera running
access denied the explanation card with both actions
relaunch a capture is still there after terminating and relaunching

LibraryUITests.swift (library, on a seeded library): filters and search; viewer, favourite, metadata, delete with confirmation; editor slider, undo, redo, presets, crop handles, the recipe saved on the item; export producing a file; albums; settings; opening the library from the camera and returning to a running camera.

# Limits of the UI tests

  • They cannot see pixels: that the picture is right is the engine tests' job.
  • Dials are driven with drags, sliders with drags; VoiceOver was not used.
  • The share sheet, saving to Photos and the system permission alerts are not exercised.
  • Light and dark appearance are not both asserted; the camera is always dark.

# Device test plan (not started)

To be run on at least one recent Pro iPhone, one non-Pro iPhone and one iPad. Record model, iOS version and result for each line in docs/research/camera-capability-matrix.md.

  1. Start-up. First launch, permission prompt, time to first frame, each lens, front camera, orientation of the preview in every device orientation (iPad: all four interface orientations).
  2. Auto. Capture, tap to focus and expose, compensation, timer, burst, flash modes; orientation of saved photos.
  3. Manual. Each dial against the readback; limits of each range; exposure lock; focus pull; white-balance presets and lock; zoom.
  4. RAW. Bayer RAW and RAW+HEIC on each lens; ProRAW where offered; the DNG opens in another raw developer; RAW development in the editor.
  5. Video. Each resolution and frame rate offered; each codec including ProRes; sound; stabilisation badge; torch; a ten-minute 4K recording with the drop count and heat badge noted; orientation of movies.
  6. Interruptions. Incoming call, switch to another camera app, background, lock, kill during recording, then relaunch and check recovery.
  7. Creative. Each tool on a tripod and hand-held; bracket fusion memory on a 4 GB and a 6 GB device.
  8. Monitoring. Zebra against a grey card at known exposure; peaking against manual focus on a chart; level against a bubble level.
  9. Library and export. Save to Photos (photo, RAW pair, video), share sheet, every export format.
  10. Accessibility. VoiceOver through every mode; largest Dynamic Type; Reduce Motion; Increase Contrast.
  11. Performance. See performance.md.
Files main
Menu

Theme