Skip to content

CosmoEdge Test Scope and Test Cases

This document defines the current test baseline for QA, development, and integration teams. Every conclusion must identify the software version, target platform, model, input, configuration, and duration. A pass on x86, in a build container, or on another chip is not target-device acceptance.

1. Test Scope and Evidence Boundaries

Testing covers these layers:

  1. Static and unit testing: formatting, static analysis, DTO, route, service, and component tests.
  2. Container integration testing: the login, upload, configuration, inference, and event loop on x86 Docker.
  3. Target-platform testing: target-specific models, media paths, and resource behavior on real BM1688, CV186X, or RK3576 devices.
  4. Business acceptance: false positives, misses, event semantics, and sustained operation on fixed positive, negative, and difficult samples.
  5. Release evidence: a frozen candidate commit, package digest, target marker, running version, and complete results.

Preserve these boundaries:

  • Each build selects exactly one inference backend. ONNX, Sophon .nn/.bmodel, and RKNN .rknn artifacts are not cross-backend artifacts.
  • BM1688, CV186X, RK3576, and RV1126B artifacts are not interchangeable based on file names.
  • Open packages use plaintext models and do not require a device-binding certificate. Protected model distribution and its device certificate are separate capabilities.
  • COSMO_DEV_MODE controls development logging, watchdog, and related production behavior. It is not an HTTP-login or device-SN authentication bypass.
  • Live boxes and labels are rendered from Pipeline metadata. The current action catalog has no standalone OSD node.
  • Performance gates must come from measurements of the current candidate, not fixed channel or latency values from another release, model, or platform.

2. Test Environments and Materials

2.1 Platform Matrix

PlatformBackend / artifactApplicable testsEvidence boundary
x86 Linux / WindowsONNX Runtime / .onnxUI, API, workflow, and CPU integrationDoes not establish NPU behavior or capacity
Apple Silicon macOS PreviewEmulated linux/amd64 / .onnxOne local-video evaluation pathNot native arm64, NPU, or production performance evidence
Sophon BM1688BMRT / target-specific model packageInstallation, inference, media, capacity, and stabilityRequires a BM1688 package and device
Sophon CV186XBMRT / target-specific model packageInstallation, inference, media, capacity, and stabilityRequires a CV186X package and device
Rockchip RK3576RKNN Runtime / .rknnRKNN, MPP/RGA, capacity, and stabilityRequires an RK3576 package and device
Rockchip RV1126BRKNN Runtime / .rknnBuild and conditional device validationDeployable acceptance also needs the target model overlay

Record the actual OS, driver, runtime, model, and package identity in the report. This table is not a version lock.

2.2 Test Materials

  • Fixed videos and images with SHA-256 values; inputs must be legally usable and free of unsanitized customer data.
  • Model source, version, digest, input/output contract, preprocessing, postprocessing, and label order.
  • Positive, negative, and difficult samples with an expected result for every sample.
  • Target chip, software version, package digest, runtime, and driver identity.
  • An isolated MQTT broker or HTTP webhook receiver for push testing.
  • A versioned ScenarioBench package and explicit gates for performance tests.

3. Functional and Integration Test Cases

3.1 Authentication, Sessions, and Onboarding (TC-AUTH)

CaseGoalStepsExpected result
TC-AUTH-001First loginSign in to a new data directory with admin / adminLogin returns an mtk; the response requires changing the factory-default password
TC-AUTH-002Invalid sessionCall /gtw/cwai/System/QueryDeviceInfo without an mtk or with an invalid oneHTTP 401 or an explicit authentication failure; it must not be confused with a missing route
TC-AUTH-003Password change and session revocationChange the password, then reuse every token issued before the changeThe password persists; all old tokens for that user are revoked; the new password can log in
TC-AUTH-004Onboarding boundaryCall Status and Complete anonymously; call Reset anonymously and after loginStatus/Complete allow anonymous access; Reset requires a valid mtk; state persists
TC-AUTH-005Open model-distribution boundaryQuery model-authorization status in an Open package and run a bundled plaintext modelAn unavailable provisioning tool does not block Open models; application features are not restricted by device SN
TC-AUTH-006Protected certificate statusTest no certificate, an invalid certificate, and a valid certificate in a Protected package containing the provisionerStates are actionable; invalid or foreign-device certificates are not valid; a valid certificate binds to this device

3.2 Video Input and Media Lifecycle (TC-CAM)

CaseGoalStepsExpected result
TC-CAM-001Local-video uploadQuery upload capabilities, upload a fixed MP4 in chunks, and create a channelProgress, completion, and channel data are correct; no server temporary path is disclosed
TC-CAM-002Play countSet play count to 0, 1, and a value greater than 10 loops indefinitely; 1 plays once; a positive number is total plays; values outside 0–100 cannot persist
TC-CAM-003RTSP inputAdd a fixed RTSP source and observe first frame, sustained playback, and cleanupIt connects and decodes; stop or delete leaves no task, decoder, or preview state behind
TC-CAM-004RTSP reconnectionInterrupt a running RTSP source and then restore itDisconnection is visible; reconnect is automatic; no crash, duplicate task, or permanent stuck state
TC-CAM-005Invalid inputSubmit an unsupported protocol, invalid address, corrupt video, and over-budget fileEach input is safely rejected with an actionable error; other channels remain available

3.3 Model Repository and Target Compatibility (TC-MOD)

CaseGoalStepsExpected result
TC-MOD-001x86 model importImport a supported fixed ONNX with complete metadataThe model is usable; positive and negative image results match the baseline
TC-MOD-002Sophon model importImport a chip-matched .bmodel/model package on the target deviceLoading, tensors, and postprocessing pass; upload success alone is not acceptance
TC-MOD-003RKNN model importLoad the corresponding .rknn on RK3576 or RV1126BRuntime, input format, and output parsing match the target profile
TC-MOD-004Wrong target artifactImport a target-specific artifact on an incompatible chip or backendInitialization or preflight fails explicitly; no silent fallback is reported as success
TC-MOD-005Export policyExport a user-managed model and a preset/encrypted/device-bound modelExportable models return attachments; protected models return an explicit non-exportable error

3.4 Pipeline Orchestration (TC-FLOW)

CaseGoalStepsExpected result
TC-FLOW-001Minimal detection chainCreate “Video Decode → Object Detection → optional Tracking/Filter → Event Report”Nodes, edges, and parameters persist; the running chain produces explainable targets and events
TC-FLOW-002Invalid connectionSave a missing upstream input, incompatible type, or broken edgeFrontend or backend rejects it and identifies an actionable node or field
TC-FLOW-003Import/exportExport a Pipeline and import it into an isolated environment on the same versionNode IDs, model references, parameters, and edges persist; missing models are reported as dependencies
TC-FLOW-004Current action catalogInspect the action list and configure live overlaysNo standalone OSD action exists; Live Display renders Pipeline output metadata

3.5 Scenario Tasks, Regions, and Strategies (TC-TASK)

CaseGoalStepsExpected result
TC-TASK-001ROI behaviorPlace the target inside and outside a fixed region under identical settingsThe positive sample inside creates the expected event; the outside negative sample creates no matching region event
TC-TASK-002Parameter persistenceChange thresholds, alarm interval, deduplication, and time rules; save and restartUI, runtime configuration, and post-restart values agree; one-variable changes remain explainable
TC-TASK-003ScheduleConfigure an active and an inactive time windowTasks run only in the active window; boundary transitions do not duplicate tasks or leak resources
TC-TASK-004Batch switchingEnable, disable, and repeat requests across multiple channelsOperations are idempotent; failures identify their item; inference and media resources release after stop

3.6 Live Display and Rendering (TC-LIVE)

CaseGoalStepsExpected result
TC-LIVE-001Raw/algorithm previewSwitch one channel between raw and algorithm streamsFirst-frame, loading, no-signal, and switching states are correct; stale players and connections are cleaned up
TC-LIVE-002Metadata overlayEnable an algorithm that supports visualization and select its overlayBoxes, labels, regions, and tracks match target metadata; there is no standalone OSD-node dependency
TC-LIVE-003Sustained playbackPreview for the task-defined duration while switching channels and overlaysPlayer, connection, and memory counts do not grow without bound; no persistent black frame or stale overlay

The task must define latency gates and record network, codec, and playback mode. This page does not set a universal millisecond target.

3.7 VLM and DINO (TC-LLM)

CaseGoalStepsExpected result
TC-LLM-001VLM image baselineRun one prompt on fixed positive, negative, and difficult samplesOutput matches the task definition; false positives, misses, latency, and resources are recorded and repeatable
TC-LLM-002VLM video taskBind a fixed video after the image baseline passes and set analysis frequencyEvents, captures, and timing match results; no repeated initialization or sustained timeout
TC-LLM-003DINO open vocabularyTest clear English target words on positive and negative samplesBoxes match the target meaning and location; ambiguous terms and similar negatives are recorded

VLM/DINO gates must bind the model, prompt, input, target FPS, and device. Do not use a universal inference-time value.

3.8 Events and External Push (TC-ALARM)

CaseGoalStepsExpected result
TC-ALARM-001Event query/exportQuery and export fixed events by channel, algorithm, and timeList and export counts, times, and fields agree; encoding is correct; sensitive paths are not disclosed
TC-ALARM-002MQTTConfigure an isolated broker, trigger one fixed event, and listen on the device-report topicRegistration, heartbeat, and event structures match the MQTT reference; disconnect and reconnect are observable
TC-ALARM-003HTTP webhookConfigure an isolated receiver that returns success, timeout, and failureSuccess payload fields are correct; failure does not block the main task; retry/status matches the implementation

3.9 System, Upgrade, and Recovery (TC-SYS)

CaseGoalStepsExpected result
TC-SYS-001Resource-aware uploadQuery capabilities and upload with ample space and at the safety reserveAvailable/required space and refusal reason agree; the disk reserve is enforced
TC-SYS-002Software upgradeRecord bootId and version, upload a valid package, and upgradeName, MD5, archive, and space validation precede reboot; a new bootId plus version proves recovery
TC-SYS-003Invalid upgradeUse a wrong name, digest, target, or dangerous archive structureUpgrade fails before replacing the active application; the old version remains usable or follows the recovery plan
TC-SYS-004WatchdogSimulate a process failure only on an authorized test deviceA non-development build follows its service recovery policy; a COSMO_DEV_MODE build records that watchdog is disabled

4. Performance and Stability Tests

CaseGoalMethodPass condition
TC-PERF-001Capacity staircaseIncrease load channel by channel with a versioned ScenarioBench packageReport the last passing point and first failure; do not turn the highest configured point into a recommendation automatically
TC-PERF-002Preview overheadTest no preview, one preview, every-channel preview, and multiple clients on one streamRecord media, inference, discard, and resources separately for every mode; conclusions are not interchangeable
TC-PERF-003Sustained runRun the fixed full-load point for the required 12/24/72 hoursFull-load coverage reaches the gate; sampling is continuous; no crash, counter rollback, or unbounded resource growth
TC-PERF-004Business accuracyCompare reference and candidate output on a versioned offline datasetUse task-approved class, IoU, confidence, and matching gates; humans review false positives and misses

A public benchmark describes only its recorded platform, model, input, and version. A new candidate needs its own result or an explicit unverified status.

5. Minimum Validation by Change Type

ChangeMinimum validation
DocumentationComplete documentation checks and site build
Frontendi18n, resource i18n, production build, and affected-page acceptance
C++Formatting, CPU test build, cosmo-tests, and focused unit tests
API / networkAuthentication, invalid input, error response, and lifecycle tests
Model / inference / mediaTarget package, target device, fixed real input, and initialization logs
Build / package / resourcesTarget marker, package content, SHA-256, and deployment compatibility

Use CI and Quality Checks and the Build Guide for commands; this page does not maintain a second command list.

6. Test Report Requirements

Every report must include:

  • candidate commit and source tree;
  • platform, OS, runtime, driver, and media path;
  • package name, target marker, and SHA-256;
  • model, input, configuration, and ScenarioBench package identities;
  • exact commands, start/end time, and full-load duration;
  • pass, fail, blocked, and waived results;
  • first failure, logs, and recovery status;
  • unverified boundaries, especially missing target-device, performance, stability, or production acceptance;
  • confirmation that customer data, credentials, device identities, and private addresses were sanitized.

A successful build, x86 result, model upload, or returning web page proves only that layer. None alone is target-device or production acceptance.

Released under the Apache 2.0 License.