`test-driver` is a use-case-driven verification framework for software systems that are developed under increasingly fluid, fast-moving and agentic development conditions.
Its core premise is that verification should evolve together with the behavior and implementation it protects:
> Tests begin fluid and exploratory when software is changing quickly, adapt with agentic assistance while behavior stabilizes, and crystallize into deterministic test code when implementation and expected behavior become sufficiently mature.
The framework is intended to support, from one coherent conceptual model:
- integration testing,
- end-to-end and user-journey testing,
- multi-user interaction testing,
- authorization and security testing,
- resilience and failure testing,
- later, scale and performance testing.
The framework treats a test not primarily as source code, but as a **verification asset** that connects intended behavior to observed implementation behavior over time.
---
## 2. Core Principles
### 2.1 Intent precedes implementation
Tests ultimately protect intended behavior, not incidental implementation details.
A user-facing capability should therefore be described first in terms of purpose, actors, expected outcomes, claims and invariants rather than UI clicks or protocol calls.
### 2.2 Use cases are the primary behavioral source
The core source object is a **UseCase**.
A use case describes purposeful behavior involving one or more actors and a system under test. Integration, journey, multi-user and security tests are projections or transformations of that same use case rather than unrelated test suites.
### 2.3 Agenticity is a means, not the source of truth
Agents are particularly useful for:
- interpreting intent,
- navigating unstable interaction surfaces,
- discovering alternative paths,
- generating scenario variations,
- exploring adversarial behavior,
- adapting tests to legitimate mechanical changes,
- investigating and minimizing failures.
The ultimate verdict should, wherever possible, come from explicit and independent oracles rather than from an actor agent judging its own success.
### 2.4 Exploration precedes crystallization
Agentic tests should not remain agentic merely because they started that way.
As behavior and implementation become stable, agentic realizations are progressively hardened and finally crystallized into deterministic tests.
A scenario determines enough context for one or more actors to execute purposeful behavior.
## 5.6 Schedule
A **Schedule** defines causal and temporal relationships between actions.
Instead of assuming every scenario is a linear sequence, the framework should support a causal graph including relationships such as:
- must happen before,
- caused by,
- wait until,
- concurrent with,
- within time T,
- must never occur during interval T.
Schedules are central to multi-user and concurrency testing.
---
# 6. Variation Layer
## 6.1 Lens
A **Lens** is the verification perspective applied to a use case.
Initial lens canon:
### Integration Lens
Do participating components communicate correctly?
### Journey Lens
Can an actor achieve the intended outcome through the complete system?
### Interaction Lens
Does the system remain correct when multiple independent actors interact with shared state?
### Security Lens
Do claims and invariants survive unauthorized, manipulated, adversarial or logically invalid behavior?
### Resilience Lens
Does the use case remain valid under component, dependency or network failures?
### Scale Lens
Does the behavior remain correct and useful under realistic populations and load?
## 6.2 Variant
A **Variant** is an alternative realization of a scenario that preserves enough identity with its originating use case to be meaningfully compared.
Variants may differ in:
- actor roles,
- data,
- sequence,
- timing,
- interaction surface,
- environment,
- dependency state.
## 6.3 Mutation
A **Mutation** is a deliberate transformation of a scenario intended to probe robustness, correctness or security.
Initial mutation canon:
```text
actor-substitution
resource-substitution
tenant-substitution
sequence-reordering
step-skipping
replay
repetition
concurrency
surface-substitution
invalid-state
privilege-mutation
dependency-failure
time-shift
```
Security scenarios should preferentially be derived as transformations of ordinary business use cases rather than maintained as a disconnected testing universe.
---
# 7. Execution Layer
## 7.1 Driver
A **Driver** exposes an interaction surface to an actor or deterministic test implementation.
Examples:
```text
BrowserDriver
HttpDriver
CliDriver
MailDriver
QueueDriver
```
Drivers should support both agentic and deterministic realizations where practical.
## 7.2 Semantic Action
A **Semantic Action** describes a meaningful action independently of the mechanics needed to perform it.
Examples:
```text
open_resource(R)
grant_access(Bob, READ)
revoke_access(Bob)
approve_invoice(I)
```
Semantic actions form an important bridge between agentic exploration and deterministic crystallization.
An agent may initially discover how a semantic action is performed through an unstable interface. Later the driver may provide a stable deterministic implementation of the same semantic action.
## 7.3 Actor Runtime
The **Actor Runtime** executes actor behavior while preserving actor isolation.
It is responsible for:
- identity/session isolation,
- agent or deterministic execution,
- memory isolation,
- surface access,
- action recording,
- evidence correlation.
## 7.4 Orchestrator
The **Orchestrator** coordinates:
- actors,
- scenario state,
- barriers,
- schedules,
- clocks,
- world setup and teardown,
- run lifecycle.
The orchestrator may know the complete world state even when individual actors do not.
## 7.5 Observer
An **Observer** captures facts about what happened without being the actor responsible for producing the behavior.
Observers may inspect:
- externally visible outcomes,
- API responses,
- domain state,
- logs,
- traces,
- metrics,
- audit records,
- messages,
- UI state.
## 7.6 Observation
An **Observation** is a captured fact produced during a run.
## 7.7 Evidence
**Evidence** is persisted observation material supporting later judgment, diagnosis and lineage.
A run should be able to produce an evidence pack containing, where applicable:
- run identifier,
- use-case and scenario version,
- system/component versions,
- environment,
- actor identities and roles,
- agent/runtime versions,
- random seeds,
- action timeline,
- screenshots or UI traces,
- requests and responses,
- domain-state observations,
- logs,
- metrics,
- distributed traces,
- oracle evaluations,
- verdict.
## 7.8 Oracle
An **Oracle** evaluates evidence against a claim or invariant.
Initial oracle categories:
- outcome oracle,
- state oracle,
- authorization oracle,
- invariant oracle,
- interaction oracle,
- temporal oracle,
- negative temporal oracle,
- audit oracle,
- telemetry oracle,
- semantic oracle.
Deterministic oracles are preferred where possible.
## 7.9 Verdict
A **Verdict** summarizes the result of an oracle or scenario execution.
Initial verdict canon:
```text
PASS
FAIL
SUSPICIOUS
INCONCLUSIVE
```
The non-Boolean states are important for exploratory and agentic testing where uncertainty may be real and should not be hidden.
## 7.10 Finding
A **Finding** is a meaningful detected discrepancy, defect, risk or unexpected behavior that warrants persistence and possible investigation.
Findings may later generate new or hardened verification assets.
## 7.11 Investigator
An **Investigator** attempts to understand a finding and may:
- reproduce it,
- minimize the scenario,
- identify relevant evidence,
- distinguish product defect from test defect,
- propose a deterministic regression test.
The investigator may itself be agentic.
---
# 8. Verification Asset
A **Verification Asset** is the central managed object of test-driver.
It represents something the framework has reason to verify over time.
A verification asset connects:
```text
UseCase / Requirement
|
v
Verification Asset
|
+--> Agentic Scenario
|
+--> Adaptive Scenario
|
+--> Hardened Scenario
|
+--> Deterministic Test Implementation
```
The identity of the verification asset should survive changes in its test implementation.
A verification asset may contain:
```yaml
id: document-share-read
usecase: document/share
protects:
claims:
- recipient-can-read
- recipient-cannot-write
invariants:
- tenant-isolation
- least-privilege
maturity: adaptive
execution:
mode: agentic
surfaces:
- browser
lineage:
created_from: usecase
```
---
# 9. Evolution Layer
## 9.1 Test Maturity
Test-driver uses a progressive maturity model:
```text
T0 Exploratory
T1 Agentic
T2 Adaptive
T3 Specified
T4 Hardened
T5 Deterministic
```
### T0 — Exploratory
The framework knows the intent but little about the stable realization.
### T1 — Agentic
An agent can pursue the intended outcome through available surfaces.
### T2 — Adaptive
The scenario has acquired partial structure and can adapt to legitimate implementation change.
### T3 — Specified
Expected behavior, actions and oracles are increasingly explicit.
### T4 — Hardened
The scenario is tightly constrained and should require little interpretation.
### T5 — Deterministic
The verification executes as conventional deterministic test code without agentic involvement.
## 9.2 Use-Case Maturity
Use-case maturity is independent from test maturity.
Initial model:
```text
U0 Hypothesis
U1 Emerging
U2 Established
U3 Stable
U4 Contractual
```
A stable use case may temporarily require agentic tests when a new implementation is introduced.
The first reference scenario for test-driver should intentionally exercise multi-user state and security semantics.
## Use case
> Alice owns resource R. Alice grants Bob read access. Bob can access R. Carol cannot access R. Alice revokes Bob's access. Bob can no longer access R.
## Actors
```text
Alice — owner
Bob — recipient
Carol — unrelated user
```
## Claims
```text
Bob can read R after grant.
Bob cannot modify R with read-only permission.
Bob cannot read R after revocation.
```
## Invariants
```text
Carol never gains access to R.
Tenant isolation remains intact.
Authorization must be consistent across surfaces.
```
## Derived security mutations
```text
Carol attempts direct access to R.
Bob attempts write access.
Bob substitutes another resource identifier.
Bob retries access immediately after revocation.
Bob attempts access through another surface.
Grant and revoke are executed concurrently.
```
This scenario is intended as the first vertical slice because it exercises:
- multiple actors,
- identity isolation,
- shared state,
- authorization,
- positive and negative behavior,
- temporal transitions,
- mutation,
- deterministic oracles,
- eventual crystallization.
---
# 14. Initial Architecture Boundaries
The initial implementation should preserve the following logical components:
> **test-driver keeps verification useful while software changes rapidly, then turns learned behavior into cheap deterministic confidence as the system stabilizes.**