Skip to content
bitzorcas
中EN

Concept

Testing Strategy

Understand the five-layer BitzOrcas testing system, from unit tests to commercial release evidence, and choose the right verification set for each change.

Last updated

BitzOrcas is an application template, a package-based framework, and a commercial delivery product. Its tests must answer more than “does this method return the right value?” They must also prove module boundaries, ORM parity, template consumption, and release provenance.

Five layers of evidence

Fast diagnosisRelease permission

Code-level rules

Architecture constraints

Adapter / infrastructure contracts

Repository-external Consumer

Immutable Commercial GA

Development feedback

Target-environment cutover

LayerQuestionTypical project or gate
CodeAre domain rules, transitions, and failure paths correct?Unit, Application, Licensing tests
ArchitectureAre invalid dependencies, retired paths, reflection, and catalog drift blocked?Architecture tests
AdapterDo SqlSugar, EF Core, messaging, and storage implementations preserve semantics?Integration + Testcontainers parity
ConsumptionCan customers build with templates and PackageReference only?ConsumerTemplate, Consumer Contract
ReleaseAre feed, signatures, provenance, SBOM, and external Consumer evidence trustworthy?Commercial GA

Lower-level tests cannot replace higher-level evidence. Green unit tests do not prove that EF Core and SqlSugar preserve the same concurrency behavior. A green local Consumer contract does not prove that production packages were signed and uploaded to the controlled feed.

Main test projects

The repository now has more than the five projects described in early docs. Common entry points are:

ProjectFocus
BitzOrcas.Unit.TestsDomain primitives, value objects, pure business rules
BitzOrcas.Application.TestsHandlers, pipelines, authorization, orchestration
BitzOrcas.Architecture.TestsDependency direction, source red lines, CI and catalog contracts
BitzOrcas.Integration.TestsAPI Shell, databases, ORM parity, messaging, migrations
BitzOrcas.CodeGeneration.TestsTemplate rendering and generated-code rules
BitzOrcas.Generator.Package.TestsGenerator behavior as NuGet analyzer assets
BitzOrcas.ConsumerTemplate.TestsProfile and template combination output
BitzOrcas.Framework.ConsumerContract.TestsPackage consumption through an isolated feed
BitzOrcas.Licensing.TestsOnline, offline, grace, expiry, revocation, replay protection
BitzOrcas.Workflow.*TestsWorkflow engine and persistence contracts

Use tests/ and BitzOrcas.Modern.slnx as the complete inventory.

Match tests to the change

ChangeSmallest useful development set
Domain rule or value objectUnit + relevant Application tests
Module dependency, project reference, directory moveArchitecture tests
Store, repository, mapping, migrationUnit + Architecture + relevant Docker parity
Source GeneratorGenerator + Generator Package + Architecture tests
Profile, template, commercial manifestConsumerTemplate + verify-template.sh + Consumer Contract
CI workflow or scriptCiQualityGateTests + target script
LicensingLicensing + Architecture + Consumer Contract
Documentation onlyContent/link checks and git diff --check; verify commands against source

Common commands

Terminal window
# Architecture boundaries
dotnet test tests/BitzOrcas.Architecture.Tests --configuration Release
# Non-Docker integration tests
dotnet test tests/BitzOrcas.Integration.Tests \
--configuration Release \
--filter "Category!=Docker"
# Local PackageReference Consumer contract
dotnet test tests/BitzOrcas.Framework.ConsumerContract.Tests \
--configuration Release \
--blame-hang-timeout 12m
# Full 14-step local merge gate
scripts/build/verify-all.sh

The docker-integration-contracts workflow splits Docker contracts into 13 shards. To reproduce a failure locally, copy the exact --filter from that job instead of starting with the entire Docker suite.

Consumer Contract scope

The local Consumer Contract packs candidate packages from current source, creates a temporary feed, and isolates NUGET_PACKAGES, HTTP cache, plugin cache, and DOTNET_CLI_HOME. An external project then runs:

restore → build → test → Release publish (currently `PublishTrimmed=false`) → package asset checks

This proves PackageReference closure, generator assets, and source-exposure rules. A separate Commercial GA run must still verify the production feed, signatures, and release evidence.

The local Consumer Contract does not prove trimming or Native AOT safety. Product verify-all.sh runs PublishTrimmed=true for the full API Host, but that does not prove every physically trimmed Consumer Profile. See Consumer Contracts for the gap and completion path.

Test ownership and duplication boundaries

FactPrimary ownerWhat a higher layer keeps
Aggregate transitionUnitOne critical HTTP/transaction path
Authorization/validation pipelineApplicationRepresentative denial through a real host
ORM translation and concurrencyDocker parityBusiness result, not duplicate SQL internals
Generator diagnosticGenerator unit/snapshotNuGet analyzer consumption contract
Package closure and source isolationConsumer ContractGA re-verification of formal artifacts
Signature/SBOM/provenanceCommercial GATarget uses only an accepted batch

Copying dozens of identical assertions into every layer increases maintenance without independent evidence. High-level tests should cross real boundaries; low-level tests should enumerate business branches.

Pre-merge evidence record

For every verifiable slice, record the exact command, configuration, filter, pass/fail/skip counts, whether Docker or external dependencies participated, and omitted gates with reasons. “Tests passed” cannot distinguish the non-Docker fast set, all 13 shards, and formal GA.

For external or long-running gates, “not run/external prerequisite unavailable” is valid evidence language. A historical result or lower test layer must not be promoted into the current conclusion.

Reading a failure

  1. Find the first failed step; later errors may be cascading symptoms.
  2. Reproduce with the same configuration, RID, and filter.
  3. For Docker failures, separate image/container/readiness problems from business assertions.
  4. For parity failures, compare observable semantics rather than internal SQL or implementation shape.
  5. For Consumer failures, start with temporary NuGet.Config, Package Source Mapping, and the first missing package.
  6. After the fix, run the focused regression and then the full gate required by the slice.

See also


Chapter Navigation

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%